home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / assembler / armmaker / !ARMmaker / h / fsutils next >
Encoding:
Text File  |  1994-07-15  |  2.4 KB  |  90 lines

  1. /*
  2.    fsutils: (C) Steven Haslam 1992-1994
  3.    Filing system utilities
  4. */
  5.  
  6. #ifndef __fsutils_h
  7. #define __fsutils_h
  8.  
  9. #include <time.h> /* Warning! Acorn C release 3 doesn't allow this twice */
  10.  
  11. typedef  int   fshandle;      /* A FileSwitch file handle */
  12.  
  13. #define  fs_badhandle         -1
  14.  
  15. /* fs_o_ are reason codes for fsopen() */
  16.  
  17. #define  fs_o_readonly        0x40
  18. #define  fs_o_output          0x80
  19. #define  fs_o_readwrite       0xC0
  20.  
  21. #define  fs_o_trapnotfound    0x08
  22. #define  fs_o_trapdirobject   0x04
  23.  
  24. #define  fs_o_systempath      0x00
  25. #define  fs_o_userpathvar     0x01
  26. #define  fs_o_userpath        0x02
  27. #define  fs_o_nopath          0x03
  28.  
  29. /* e.g. to open a new file for output using a user path, trapping the notfound and directory-object errors, use:
  30.  
  31.    fshandle fsh;
  32.  
  33.    fsh = fsopen (fs_o_output | fs_o_trapnotfound | fs_o_trapdirobject | fs_o_userpath, filename, userpath);
  34. */
  35.  
  36. /* fs_r_ and fs_w_ are reason codes for fsgbpb
  37.    If *_userptr is used, add an extra parameter for the pointer to
  38.    read from/write to */
  39.  
  40. #define  fs_r_userptr         3
  41. #define  fs_r_systemptr       4
  42.  
  43. #define  fs_w_userptr         1
  44. #define  fs_w_systemptr       2
  45.  
  46. /* Reason codes for the fsseek's whence parameter */
  47.  
  48. #define  fs_s_set             0
  49. #define  fs_s_cur             1
  50. #define  fs_s_end             2
  51.  
  52. typedef struct fsfind
  53. {
  54.    char  directory[256];
  55.    char  filename[16];
  56.    char  wildcard[16];
  57.    int   object;
  58. } fsfind_blk;
  59.  
  60. typedef struct fsfstat
  61. {
  62.    const char  *filename;
  63.    int      length;
  64.    time_t   timestamp;
  65.    int      filetype;
  66. } fsfstat_blk;
  67.  
  68. extern   int   fsfindf (const char*, const char*, struct fsfind*);
  69. extern   int   fsfindn (struct fsfind*);
  70. extern   int   fsfstat (struct fsfstat*);
  71. extern   int   fsloadf (void*, const char*);
  72. extern   int   fsfexists (const char*);
  73. extern   int   fssetsize (const char*, const int);
  74. extern   int   fssetinfo (struct fsfstat*);
  75. extern   int   fssettype (const char*, const int);
  76. extern   int   fsfensure (const char*);
  77. extern   int   fsmakedir (const char*);
  78. extern   int   fsclose (fshandle);
  79. extern   fshandle fsopen (int, const char*, ...);
  80. extern   int   fsseek (fshandle, int, int);
  81. extern   int   fsgbpb (int, fshandle, const void*, int, ...);
  82. extern   int   fsext (fshandle);
  83. extern   int   fsptr (fshandle);
  84. extern   int   fsbget (fshandle);
  85. extern   int   fsbput (char, fshandle);
  86. extern   int   fscdir (const char*);
  87. extern   int   fsputs (const char*, fshandle);
  88.  
  89. #endif
  90.