home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / pcmail / part07 / kp.h < prev    next >
C/C++ Source or Header  |  1989-02-03  |  2KB  |  85 lines

  1. /*++
  2. /* NAME
  3. /*    kp 5
  4. /* SUMMARY
  5. /*    definitions file for k protocol
  6. /* PACKAGE
  7. /*    uucp across the thenet
  8. /* SYNOPSIS
  9. /*    #include "kp.h"
  10. /* DESCRIPTION
  11. /*    The following definitions are made in the file kp.h:
  12. /* .nf
  13.  
  14. /* /* Need stderr definition from stdio.h */
  15.  
  16. #include "stdio.h"
  17.  
  18. /* /* Symbol Definitions */
  19.  
  20. #define    PACKSIZ     256     /* Packet size sent by this uucico */
  21. #define MAXPACKSIZ  1024    /* Maximum packet size I can receive */
  22. #define SOH         16      /* Start of header */
  23. #define CR          13      /* ASCII Carriage Return */
  24. #define    SP          32      /* ASCII Blank */
  25.  
  26. #define MAXTRY      10      /* Times to retry a packet */
  27.  
  28. /* /* 5 secs timeout interval turns out to be too short, when THEnet is busy */
  29.  
  30. #define TIMEOUT     10      /* Seconds after which I should be timed out */
  31.  
  32. #define TRUE         1      /* Boolean constants */
  33. #define FALSE        0
  34.  
  35. #define    NULLP (char*)0      /* NULL pointer */
  36. #define    FAIL        -1      /* Read/write return value in case of error */
  37. #define    TIME        -2      /* Receive packet return status if timed out */
  38.  
  39. #define    OUT          6      /* Nr. of data bits per char in packet */
  40. #define    IN           8      /* Nr. of data bits per byte */
  41. #define    STEP         2      /* Difference between previous two */
  42. #define    MASK       077      /* Mask for number of data bits in packet */
  43.  
  44. /* /* Macro Definitions */
  45.  
  46. #define tosix(ch)  (((ch) & MASK) + SP)
  47. #define unsix(ch)  (((ch) - SP) & MASK)
  48.  
  49. #define tochar(ch)  ((ch) + SP)
  50. #define unchar(ch)  ((ch) - SP)
  51.  
  52. /* /* intercept system calls in case of non-unix operating systems */
  53.  
  54. #ifndef    unix
  55.  
  56. #define    read        xread
  57. #define    write        xwrite
  58. #define    alarm(x)    /* nothing */
  59. #define    signal(x,y)    /* nothing */
  60. #define    DEBUG(x,y,z)    if (dflag >= x) printf(y,z)
  61.  
  62. extern int dflag;
  63.  
  64. #else
  65.  
  66. #define DEBUG(l,f,s) if (Debug >= l) fprintf(stderr,f,s)
  67.  
  68. /* /* Declarations */
  69.  
  70. extern int Debug;           /* Debugging level */
  71.  
  72. #endif
  73. /* AUTHOR(S)
  74. /*    Wietse Venema
  75. /*    Eindhoven University of Technology
  76. /*    Department of Mathematics and Computer Science
  77. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  78. /* CREATION DATE
  79. /*    Mon Feb  3 22:14:23 MET 1986
  80. /* LAST MODIFICATION
  81. /*    Mon Apr  4 23:43:00 MET 1988
  82. /* VERSION/RELEASE
  83. /*    2.4
  84. /*--*/
  85.