home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / sharewar / quake106 / utils / common / cmdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  2.2 KB  |  98 lines

  1. // cmdlib.h
  2.  
  3. #ifndef __CMDLIB__
  4. #define __CMDLIB__
  5.  
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #include <errno.h>
  10. #include <ctype.h>
  11. #include <time.h>
  12. #include <stdarg.h>
  13.  
  14. #ifndef __BYTEBOOL__
  15. #define __BYTEBOOL__
  16. typedef enum {false, true} qboolean;
  17. typedef unsigned char byte;
  18. #endif
  19.  
  20. // the dec offsetof macro doesn't work very well...
  21. #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
  22.  
  23.  
  24. // set these before calling CheckParm
  25. extern int myargc;
  26. extern char **myargv;
  27.  
  28. char *strupr (char *in);
  29. char *strlower (char *in);
  30. int Q_strncasecmp (char *s1, char *s2, int n);
  31. int Q_strcasecmp (char *s1, char *s2);
  32. void Q_getwd (char *out);
  33.  
  34. int filelength (FILE *f);
  35. int    FileTime (char *path);
  36.  
  37. void    Q_mkdir (char *path);
  38.  
  39. extern    char        qdir[1024];
  40. extern    char        gamedir[1024];
  41. void SetQdirFromPath (char *path);
  42. char *ExpandPath (char *path);
  43. char *ExpandPathAndArchive (char *path);
  44.  
  45.  
  46. double I_FloatTime (void);
  47.  
  48. void    Error (char *error, ...);
  49. int        CheckParm (char *check);
  50.  
  51. FILE    *SafeOpenWrite (char *filename);
  52. FILE    *SafeOpenRead (char *filename);
  53. void    SafeRead (FILE *f, void *buffer, int count);
  54. void    SafeWrite (FILE *f, void *buffer, int count);
  55.  
  56. int        LoadFile (char *filename, void **bufferptr);
  57. void    SaveFile (char *filename, void *buffer, int count);
  58.  
  59. void     DefaultExtension (char *path, char *extension);
  60. void     DefaultPath (char *path, char *basepath);
  61. void     StripFilename (char *path);
  62. void     StripExtension (char *path);
  63.  
  64. void     ExtractFilePath (char *path, char *dest);
  65. void     ExtractFileBase (char *path, char *dest);
  66. void    ExtractFileExtension (char *path, char *dest);
  67.  
  68. int     ParseNum (char *str);
  69.  
  70. short    BigShort (short l);
  71. short    LittleShort (short l);
  72. int        BigLong (int l);
  73. int        LittleLong (int l);
  74. float    BigFloat (float l);
  75. float    LittleFloat (float l);
  76.  
  77.  
  78. char *COM_Parse (char *data);
  79.  
  80. extern    char        com_token[1024];
  81. extern    qboolean    com_eof;
  82.  
  83. char *copystring(char *s);
  84.  
  85.  
  86. void CRC_Init(unsigned short *crcvalue);
  87. void CRC_ProcessByte(unsigned short *crcvalue, byte data);
  88. unsigned short CRC_Value(unsigned short crcvalue);
  89.  
  90. void    CreatePath (char *path);
  91. void CopyFile (char *from, char *to);
  92.  
  93. extern    qboolean        archive;
  94. extern    char            archivedir[1024];
  95.  
  96.  
  97. #endif
  98.