home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / tcpip / amitcp-support / ncftp-1.5.6 / src / rcs / util.h,v < prev    next >
Encoding:
Text File  |  1994-06-29  |  2.3 KB  |  114 lines

  1. head    14020.12;
  2. access;
  3. symbols
  4.     ORIGINAL:14020.12;
  5. locks; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 14020.12
  10. date    93.07.09.11.32.49;    author alph;    state Exp;
  11. branches;
  12. next    ;
  13.  
  14.  
  15. desc
  16. @Original version
  17. @
  18.  
  19.  
  20. 14020.12
  21. log
  22. @checked in with -k by alph at 1993/10/10 19:59:56
  23. @
  24. text
  25. @/* Util.h */
  26.  
  27. #ifndef _util_h_
  28. #define _util_h_
  29.  
  30. /*  $RCSfile: util.h,v $
  31.  *  $Revision: 14020.12 $
  32.  *  $Date: 93/07/09 11:32:49 $
  33.  */
  34.  
  35. typedef char string[128], str32[32], longstring[512];
  36. typedef char Hostname[64];
  37.  
  38. /* For Perror. */
  39. #ifdef DB_ERRS
  40. #    ifdef __LINE__
  41. #        define PERROR(p,e) Perror(p, __LINE__, e)
  42.         void Perror(char *, int, char *);
  43. #    else
  44. #        define PERROR(p,e) Perror(p, e)
  45.         void Perror(char *, char *);
  46. #    endif
  47. #else
  48. #    define PERROR(p,e) Perror(e)
  49.     void Perror(char *);
  50. #endif
  51.  
  52. #ifdef NO_VARARGS
  53. #    define dbprintf if (debug) (void) printf
  54. #else
  55. #    ifndef DB_STREAM
  56. #        define DB_STREAM stdout
  57. #    endif
  58.     void dbprintf(char *fmt, ...);
  59. #endif
  60.  
  61. /* For 'Getopt.' */
  62. #define BADCH   ((int)'?')
  63. #define EMSG    ""
  64.  
  65. /* Handy macros. */
  66. #define Strncpy(d,s) _Strncpy((char *) (d), (char *) (s), (size_t) sizeof(d))
  67. #define Strncat(d,s) _Strncat((char *) (d), (char *) (s), (size_t) sizeof(d))
  68. #define FGets(a,b) fgets((a), (int) (sizeof(a) - 2), (b))
  69.  
  70. #ifndef NO_CONST
  71. typedef int (*cmp_t)(const void *, const void *);
  72. #else
  73. typedef int (*cmp_t)(void *, void *);
  74. #endif
  75.  
  76. #define QSort(base,n,sz,cmp) \
  77.     qsort(base, (size_t)(n), (size_t)(sz), (cmp_t)(cmp))
  78.  
  79. #ifndef SIG_PARAMS
  80. #define SIG_PARAMS (int sig)
  81. #endif
  82. typedef void (*Sig_t) SIG_PARAMS;
  83.  
  84. #define Signal(a,proc) signal((a), (Sig_t)(proc))
  85.  
  86. /* Protos. */
  87. char *_Strncat(char *dst, char *src, register size_t n);
  88. char *_Strncpy(char *dst, char *src, register size_t n);
  89. char *NewString(char *oldstr);
  90. char **re_makeargv(char *promptstr, int *argc);
  91. char *onoff(int);
  92. int StrToBool(char *s);
  93. int confirm(char *cmd, char *file);
  94. void fatal(char *msg);
  95. char *get_cwd(char *buf, int size);
  96. int tmp_name(char *str);
  97. int Getopt(int argc, char **argv, char *opstring);
  98. void Getopt_Reset(void);
  99. char *Gets(char *promptstr, char *sline, size_t size);
  100. size_t RemoveTrailingNewline(char *cp, int *stripped);
  101. unsigned long UnLSDate(char *dstr);
  102. char *Strpcpy(char *dst, char *src);
  103. int UserLoggedIn(void);
  104. char *LocalPath(char *path);
  105. char *LocalDotPath(char *path);
  106. char *GetHomeDir(char *home);
  107.  
  108. #ifdef NO_STRSTR
  109. char *strstr(char *s1, char *s2);
  110. #endif
  111.  
  112. #endif    /* _util_h_ */
  113. @
  114.