home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume21 / coda / part01 / client.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-08  |  2.6 KB  |  122 lines

  1. /*
  2. **  Copyright 1989 BBN Systems and Technologies Corporation.
  3. **  All Rights Reserved.
  4. **  This is free software, and may be distributed under the terms of the
  5. **  GNU Public License; see the file COPYING for more details.
  6. **
  7. **  Header file for CODA clients.
  8. **  $Header: client.h,v 2.0 90/03/23 14:41:08 rsalz Exp $
  9. */
  10. /* SUPPRESS 223 *//* Nested comment */
  11. #include <stdio.h>
  12.  
  13. #ifdef    XENIX
  14. /* Stupid, just plain stupid... */
  15. #undef    NULL
  16. #define NULL        0
  17. #endif    /* XENIX */
  18.  
  19. /*
  20. **  Constants, compilation control, et cetera.
  21. */
  22.  
  23. /* Assorted constants. */
  24. #define TRUE        1        /* Any non-zero value        */
  25. #define FALSE        0        /* Must be zero            */
  26. #define NOBODY        -2        /* NFS's idea of root        */
  27. #define PORTNUMBER    1999        /* Port to contact server on    */
  28. #define SIZE        256        /* String buffer size        */
  29. #define LINES_DELTA    50        /* Growth clump of line array    */
  30.  
  31. /*
  32. **  Set our exit codes; tell stupid VMS to shut up.  This goes away
  33. **  when ANSI C comes along.
  34. */
  35. #ifndef    VMS
  36. #define CODA_INIT    "%s/.codarc"    /* Argument to %s is $HOME    */
  37. #define EXITOK        0
  38. #define EXITERR        1
  39. #else
  40. #define CODA_INIT    "SYS$LOGIN:CODA.DAT"
  41. #define EXITOK        0x10000001
  42. #define EXITERR        0x10000002
  43. #endif    /* VMS */
  44.  
  45. /* Comile in RCS id strings? */
  46. #ifndef    SABER
  47. #define RCSID
  48. #endif    /* SABER */
  49.  
  50. /* Hide routines that can be hidden? */
  51. #define STATIC        static        /* .. */
  52. /*efine STATIC        /* NULL */    /* .. */
  53.  
  54. /* Trust register allocations? */
  55. #define REGISTER    register    /* .. */
  56. /*efine REGISTER    /* NULL */    /* .. */
  57.  
  58. /* Shut up, okay? */
  59. #ifdef    lint
  60. #undef putc
  61. #undef putchar
  62. #undef RCSID
  63. #endif    /* lint */
  64.  
  65. /* Memory allocation. */
  66. #define NEW(T, c)        \
  67.     ((T *)malloc((unsigned int)(sizeof (T) * (c))))
  68. #define GROW(p, T, c)        \
  69.     ((T *)realloc((char *)p, (unsigned int)(sizeof (T) * (c))))
  70. #define COPY(p)            \
  71.     strcpy(NEW(char, strlen(p) + 1), p)
  72.  
  73. #define WHITE(c)        ((c) == ' ' || c == '\t')
  74.  
  75. typedef int        BOOL;
  76.  
  77.  
  78.  
  79. /*
  80. **  Data is declared everywhere, lives oncewhere.
  81. */
  82. #ifdef    MAINLINE
  83. #define EXTERN        /* NULL */
  84. #else
  85. #define EXTERN        extern
  86. #endif    /* MAINLINE */
  87.  
  88. EXTERN int    SRVtrace;        /* Trace server IO?        */
  89.  
  90. void    Fatal();
  91. void    GetPassword();
  92. int    SRVcget();
  93. int    SRVget();
  94. int    SRVopen();
  95. void    SRVclose();
  96. void    SRVput();
  97.  
  98. /* From the C library. */
  99. extern int    errno;
  100. extern int    optind;
  101. extern char    *optarg;
  102.  
  103. extern long    atol();
  104. extern char    *getenv();
  105. extern char    *malloc();
  106. extern char    *mktemp();
  107. extern char    *realloc();
  108. extern char    *strchr();
  109. extern char    *strrchr();
  110. extern char    *strcpy();
  111.  
  112. #ifdef    BSD
  113. extern char    *sprintf();        /* Too painful, my ass        */
  114. #endif    /* BSD */
  115.  
  116. #ifdef    ATTsysv
  117. extern void    exit();
  118. extern void    perror();
  119. extern char    *memset();
  120. extern char    *memcpy();
  121. #endif    /* ATTsysv */
  122.