home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / Programming / Source / WAIS / ir / futil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-02  |  2.1 KB  |  72 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.  
  4.   
  5. */
  6.  
  7. #ifndef FUTIL_H
  8. #define FUTIL_H
  9.  
  10. #include "cdialect.h"
  11. #include "cutil.h"
  12.  
  13. #define MAX_FILE_NAME_LEN 255
  14.  
  15. /* the following defines should be in stdio.h, but the
  16.    gnu C compiler doesn't define them for some reason
  17.  */
  18. #ifndef SEEK_SET 
  19. #define SEEK_SET 0  /* ANSI added by brewster */
  20. #define SEEK_CUR 1  /* ANSI added by brewster */
  21. #define SEEK_END 2  /* ANSI added by brewster */
  22. #endif
  23.  
  24. /* enhanced standard functions - don't call them directly, use the
  25.    macros below */
  26. FILE*    fs_fopen _AP((char* fileName,char* mode));
  27. long    fs_fclose _AP((FILE* file));
  28. long     fs_fseek _AP((FILE* file,long offset,long wherefrom));
  29. long     fs_ftell _AP((FILE* file));
  30.  
  31. #ifdef __cplusplus
  32. /* declare these as C style functions */
  33. extern "C"
  34.     {
  35. #endif /* def __cplusplus */
  36.  
  37. /* macros for standard functions.  call these in your program.  */
  38. #define s_fopen(name,mode)    fs_fopen((name),(mode))
  39. #define s_fclose(file)        { fs_fclose((FILE*)file); file = NULL; }
  40. #define s_fseek(file,offset,wherefrom) fs_fseek(file,offset,wherefrom)
  41. #define s_ftell(file)    fs_ftell(file)
  42.  
  43. void grow_file _AP((FILE* file,long length));
  44. long read_bytes _AP((long n_bytes,FILE *stream));
  45. long write_bytes _AP((long value, long n_bytes, FILE* stream));
  46. long read_bytes_from_memory _AP((long n_bytes, unsigned char* block));
  47.  
  48. time_t file_write_date _AP((char* filename)); /* os dependent */
  49. char *truename _AP((char *filename, char *full_path));
  50. long file_length _AP((FILE* stream));
  51. char *pathname_name _AP((char *pathname));
  52. char *pathname_directory _AP((char *pathname, char *destination));
  53. char *current_user_name _AP((void));
  54. boolean probe_file _AP((char *filename));
  55. boolean touch_file _AP((char *filename));
  56. char *merge_pathnames _AP((char *pathname, char *directory));
  57.  
  58. #ifdef THINK_C
  59. void setFileType _AP((char* fileName,FType type,FType creator));
  60. #endif /* def THINK_C */
  61.  
  62. boolean read_string_from_file _AP((FILE* stream,char* array,
  63.                    long array_length));
  64.  
  65. long count_lines _AP((FILE *stream));
  66.  
  67. #ifdef __cplusplus
  68.     }
  69. #endif /* def __cplusplus */
  70.  
  71. #endif /* FUTIL_H */
  72.