home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / C_ARCHI1.TAR / archie / pprot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-19  |  1.8 KB  |  56 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.  * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
  8.  */
  9.  
  10. #include <copyright.h>
  11.  
  12. #ifndef MAXPATHLEN
  13. # ifdef VMS
  14. #  define MAXPATHLEN 32
  15. # else /* not VMS */
  16. #  if defined(MSDOS) && !defined(OS2)
  17. #   define MAXPATHLEN 255
  18. #  else /* not MSDOS */
  19. #   include <sys/param.h>
  20. #  endif /* MSDOS && !OS2 */
  21. # endif /* VMS */
  22. #endif
  23.  
  24. /* Protocol Definitions */
  25.  
  26. #define           VFPROT_VNO    1      /* Protocol Version Number           */
  27.  
  28. #define           DIRSRV_PORT      1525   /* Server port used if not in srvtab */
  29. #define        PROSPERO_PORT    191    /* Officially assigned prived port   */
  30. #define           PROS_FIRST_PRIVP 901    /* First privileged port to try      */
  31. #define        PROS_NUM_PRIVP   20     /* Number of privileged ports to try */
  32.  
  33. #define           MAXPKT            1024   /* Max size of response from server  */
  34. #define           SEQ_SIZE        32     /* Max size of sequence text in resp */ 
  35. #define           MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
  36.  
  37. #define           MAX_FWD_DEPTH    20     /* Max fwd pointers to follow        */
  38.  
  39. #define S_AD_SZ        sizeof(struct sockaddr_in)
  40.  
  41. /* Replacement for strtok that doesn't keep state.  Both the variable  */
  42. /* S and the variable S_next must be defined.  To initialize, assign   */
  43. /* the string to be stepped through to S_next, then call get_token on  */
  44. /* S.  The first token will be in S, and S_next will point to the next */
  45. /* token.  Like strtok, this macro does modify the string passed to it */
  46. #define get_token(S,C) \
  47.     S = S/**/_next; \
  48.     if(S) { \
  49.      while(*S == C) S++; \
  50.      S/**/_next = index(S,C); \
  51.      if(S/**/_next) *(S/**/_next++) = '\0'; \
  52.      if(!*S) S = NULL; \
  53.     }
  54.  
  55.  
  56.