home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume22 / archie / part01 / pprot.h < prev    next >
C/C++ Source or Header  |  1991-08-21  |  2KB  |  44 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.  * <uw-copyright.h>.
  6.  */
  7.  
  8. #include <uw-copyright.h>
  9.  
  10. #ifndef MAXPATHLEN
  11. #include <sys/param.h>
  12. #endif
  13.  
  14. /* Protocol Definitions */
  15.  
  16. #define           VFPROT_VNO    1      /* Protocol Version Number           */
  17.  
  18. #define           DIRSRV_PORT      1525   /* Server port used if not in srvtab */
  19. #define        PROSPERO_PORT    191    /* Officially assigned prived port   */
  20. #define           PROS_FIRST_PRIVP 901    /* First privileged port to try      */
  21. #define        PROS_NUM_PRIVP   20     /* Number of privileged ports to try */
  22.  
  23. #define           MAXPKT            1024   /* Max size of response from server  */
  24. #define           SEQ_SIZE        32     /* Max size of sequence text in resp */ 
  25. #define           MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
  26.  
  27. #define S_AD_SZ        sizeof(struct sockaddr_in)
  28.  
  29. /* Replacement for strtok that doesn't keep state.  Both the variable  */
  30. /* S and the variable S_next must be defined.  To initialize, assign   */
  31. /* the string to be stepped through to S_next, then call get_token on  */
  32. /* S.  The first token will be in S, and S_next will point to the next */
  33. /* token.  Like strtok, this macro does modify the string passed to it */
  34. #define get_token(S,C) \
  35.     S = S/**/_next; \
  36.     if(S) { \
  37.      while(*S == C) S++; \
  38.      S/**/_next = index(S,C); \
  39.      if(S/**/_next) *(S/**/_next++) = '\0'; \
  40.      if(!*S) S = NULL; \
  41.     }
  42.  
  43.  
  44.