home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / XARCHIE2.TAR / pprot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-02  |  1.6 KB  |  50 lines

  1. /*
  2.  * Copyright (c) 1989, 1990, 1991 by the University of Washington
  3.  *
  4.  * For copying and distribution information, please see the file
  5.  * <copyright.h>.
  6.  */
  7.  
  8. #include <copyright.h>
  9.  
  10. #ifndef MAXPATHLEN
  11. # ifdef VMS
  12. #  define MAXPATHLEN 32
  13. # else /* not VMS */
  14. #  include <sys/param.h>
  15. # endif /* VMS */
  16. #endif
  17.  
  18. /* Protocol Definitions */
  19.  
  20. #define           VFPROT_VNO    1      /* Protocol Version Number           */
  21.  
  22. #define           DIRSRV_PORT      1525   /* Server port used if not in srvtab */
  23. #define        PROSPERO_PORT    191    /* Officially assigned prived port   */
  24. #define           PROS_FIRST_PRIVP 901    /* First privileged port to try      */
  25. #define        PROS_NUM_PRIVP   20     /* Number of privileged ports to try */
  26.  
  27. #define           MAXPKT            1024   /* Max size of response from server  */
  28. #define           SEQ_SIZE        32     /* Max size of sequence text in resp */ 
  29. #define           MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
  30.  
  31. #define           MAX_FWD_DEPTH    20     /* Max fwd pointers to follow        */
  32.  
  33. #define S_AD_SZ        sizeof(struct sockaddr_in)
  34.  
  35. /* Replacement for strtok that doesn't keep state.  Both the variable  */
  36. /* S and the variable S_next must be defined.  To initialize, assign   */
  37. /* the string to be stepped through to S_next, then call get_token on  */
  38. /* S.  The first token will be in S, and S_next will point to the next */
  39. /* token.  Like strtok, this macro does modify the string passed to it */
  40. #define get_token(S,C) \
  41.     S = S/**/_next; \
  42.     if(S) { \
  43.      while(*S == C) S++; \
  44.      S/**/_next = index(S,C); \
  45.      if(S/**/_next) *(S/**/_next++) = '\0'; \
  46.      if(!*S) S = NULL; \
  47.     }
  48.  
  49.  
  50.