home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / forut062.zip / ForUtil-0.62 / lib / forutil.h < prev    next >
C/C++ Source or Header  |  1996-08-28  |  3KB  |  120 lines

  1. /*****
  2. * forutil.h : public header file for libforUtil.a
  3. *
  4. * This file Version    $Revision: 1.7 $
  5. *
  6. * Creation date:    Mon Feb  4 04:03:18 GMT+0100 1980
  7. * Last modification:     $Date: 1996/08/28 17:41:58 $
  8. * By:            $Author: koen $
  9. * Current State:    $State: Exp $
  10. *
  11. * Author:        koen
  12. * (C)Copyright 1995 Ripley Software Development
  13. * All Rights Reserved
  14. *****/
  15. /*****
  16. * $Source: /usr/local/rcs/ForUtil/lib/RCS/forutil.h,v $
  17. *****/
  18. /*****
  19. * ChangeLog 
  20. * $Log: forutil.h,v $
  21. * Revision 1.7  1996/08/28 17:41:58  koen
  22. * Added proto for print_version_id
  23. *
  24. * Revision 1.6  1996/08/27 19:20:41  koen
  25. * msdos related changes
  26. *
  27. * Revision 1.5  1996/08/07 21:19:06  koen
  28. * Added the sysdeps header file
  29. *
  30. * Revision 1.4  1996/08/02 14:54:25  koen
  31. * Added prototypes for downcase, file_has_ext and strend. 
  32. * Moved system dependent stuff to sysdeps.h
  33. *
  34. * Revision 1.3  1996/07/30 02:03:05  koen
  35. * Added a few default values if autoconf.h is not found. 
  36. * Added a prototype for get_filename_part.
  37. *
  38. * Revision 1.2  1996/07/16 09:20:41  koen
  39. * minor changes
  40. *
  41. * Revision 1.1  1996/04/25 02:30:40  koen
  42. * Initial Revision
  43. *
  44. *****/ 
  45.  
  46. #ifndef _forutil_h_
  47. #define _forutil_h_
  48.  
  49. #include "sysdeps.h"
  50.  
  51. #define SCAN_ARG(ARG) {if(arg[1] == '\0') \
  52.     { fprintf(stderr, "%s requires an argument\n", ARG); exit(1); }}
  53.  
  54. /***** Proto's from filelist.c *****/
  55.  
  56. /* create a filelist of path, store in **file_list, no of files stored
  57. * is returned in num_files. Table of extensions to use is in ext_table,
  58. * total no of extensions is in num_extensions */
  59. extern void build_file_list(char **file_list[], int *num_files, char *path, 
  60.     char *ext_table[], int num_extensions);
  61.  
  62. /***** Proto's from stringutil.c *****/
  63.  
  64. /* print program version number; p_minor is an rcs $Revision: 1.7 $ keyword */
  65. extern void print_version_id(char *p_name, char *p_major, char *p_minor);
  66.  
  67. /* makes text in string all lowercase */
  68. inline void downcase(char *string);
  69.  
  70. /* makes text in string all uppercase */
  71. extern inline void upcase(char *string);
  72.  
  73. /* return true if file s1 has an extension */
  74. extern inline int file_has_ext(char *s1);
  75.  
  76. /* return true if s2 is at the end of s1 */
  77. extern inline int strend(char *s1, char *s2);
  78.  
  79. /* remove all spaces from a string */
  80. extern void stripspaces(char *string);
  81.  
  82. #if !defined (HAVE_STRSTR)
  83. #ifndef WINDOWS
  84. extern char *strstr(char *s1, char *s2);
  85. #endif
  86. #endif
  87.  
  88. /* returns the last known error according to the value of errno */
  89. extern char *ErrorString(void);
  90.  
  91. /***** Proto's from Splitpath.c *****/
  92.  
  93. /* split filename into a fully qualified file & and pathname */
  94. extern int ParseFilename(char *fullname, char *filename, char *pathname);
  95.  
  96. /* get the filename part of any given path + filespec */
  97. extern void get_filename_part(char *fullname, char *filename);
  98.  
  99. /***** Proto's from environment.c *****/
  100.  
  101. /* scan & substitute any environment variables in file */
  102. extern int scan_for_environment(char *file);
  103.  
  104. /* create a directory */
  105. extern int make_directory(char *dir_to_make);
  106.  
  107. /* write text to file filename */
  108. extern int string_to_file(char *text, char *filename);
  109.  
  110. /* see if a file exists. If it does, return size of file */
  111. extern unsigned long check_if_file_exists(char *file);
  112.  
  113. /* return the login name, true name and home directory of a user */
  114. extern char *get_user_login(void);
  115. extern char *get_user_name(void);
  116. extern void get_home_dir(char **home_dir);
  117.  
  118. /* Don't add anything after this endif! */
  119. #endif /* _forutil_h_ */
  120.