home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CRCDOS.ARJ / GENLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-12  |  2.7 KB  |  79 lines

  1. /*********************************************************************/
  2. /* Module name: genlib.h                                             */
  3. /* Date: 27 Dec 87                                                   */
  4. /* Environment: Turbo C 1.0                                          */
  5. /* Author: R. E. Faith                                               */
  6. /* Notice: Public Domain: The following conditions apply to use:     */
  7. /*         1) No fee shall be charged for distribution.              */
  8. /*         2) Modifications may be made, but authorship information  */
  9. /*            for all contributing authors shall be retained.        */
  10. /*         3) This code may not be included as part of a commercial  */
  11. /*            package.                                               */
  12. /* This program is provided AS IS without any warranty, expressed or */
  13. /* implied, including, but not limited to, fitness for a particular  */
  14. /* purpose.                                                          */
  15. /*********************************************************************/
  16.  
  17. /* General typedefs */
  18. typedef unsigned char    BYTE;
  19. typedef unsigned short    WORD;
  20. typedef unsigned long    LONGWORD;
  21.  
  22. /* General definitions */
  23. #define FA_ALL    (FA_HIDDEN | FA_SYSTEM | FA_DIREC)
  24.  
  25. /* c_break.c */
  26. extern int    c_break( void );
  27.  
  28. /* chandler.c */
  29. extern int    __CriticalError;
  30. extern int    __CritErrIGNORE;
  31. extern int    chandler( int errval, int ax, int bp, int si );
  32.  
  33. /* getopt.c */
  34. extern char    *optarg;
  35. extern int    opterr;
  36. extern int    optind;
  37. extern int    optopt;
  38. extern char    SW;
  39. extern int    getopt( int argc, char **argv, char *opts );
  40.  
  41. /* fnstuff.c */
  42. extern int    isroot( char *path );
  43. extern int    hasdotname( char *path );
  44. extern char    *fnappend( char *path, char *file );
  45. extern char    *fntomsdos( char *path );
  46. extern char    *fntounix( char *path );
  47.  
  48. /* crcstuff.c */
  49. extern WORD    get_crc_ccitt( WORD crc, char *buf, int size );
  50. extern WORD    get_crc_16( WORD crc, char *buf, int size );
  51.  
  52. /* undoc.c */
  53. /* This is an undocumented DOS table.  A better format might be more */
  54. /* correct, but this works well for the current program. */
  55. typedef struct {
  56.     BYTE    name[67];
  57.     WORD    data[7];
  58. } far *MNT_TAB_PTR;
  59. /* These are undocumented DOS flags for data[0] in the above structure */
  60. #define IS_USED        0x4000        /* Masks for data[0] */
  61. #define IS_JOIN        0x2000
  62. #define IS_SUBST    0x1000
  63. extern MNT_TAB_PTR    get_mnt_tab( void );
  64. extern char        *get_label( int drive );
  65.  
  66. /* sys.c */
  67. struct disk_free {
  68.     unsigned long    total;
  69.     unsigned long    avail;
  70.     unsigned long    used;
  71. };
  72. #define B_TO_K(x)    ((x) / 1024U)
  73. extern int    drive_count( void );
  74. extern int    get_free( int drive, struct disk_free *df );
  75.  
  76. /* expand.c */
  77. extern int    expand( char *progname, char *path,
  78.             int (*func)(), int mode );
  79.