home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / nn.tar / nn-6.5.1 / conf / m-template.h < prev    next >
C/C++ Source or Header  |  1995-04-29  |  2KB  |  90 lines

  1.  
  2. /************** Machine (and compiler) dependent definitions. **************
  3.  *
  4.  *    Define appropriate types for the following ranges of integer
  5.  *    variables.  These are processor & compiler dependent, but the
  6.  *    distributed definitions will probably work on most systems.
  7.  */
  8.  
  9.  
  10.  
  11. /*      MACHINE TYPE    DEFINED TYPE        VALUE RANGE    */
  12.  
  13. typedef unsigned char    int8;        /*        0 ..     255 */
  14. typedef short        int16;        /*  -10,000 ..  10,000 */
  15. typedef long        int32;        /* -100,000 .. 100,000 */
  16. typedef unsigned long    uint32;        /*       0 ..  2^31-1 */
  17.  
  18.  
  19. /*
  20.  *     Define NO_VARARGS if the varargs feature is not available.
  21.  *
  22.  *    Also define NO_VARARGS if the vprintf/vsprintf routines are not
  23.  *    available (however, this will only by safe on some machines, like
  24.  *    the VAX).
  25.  *
  26.  *    Defining NO_VARARGS in the m- file should only be done for
  27.  *    architectures which does not support it in general, or where
  28.  *    a majority of the systems available on that architecture
  29.  *    doesn't have it.  Otherwise, it should be defined in the
  30.  *    s- file, because this is primarily OS dependent.
  31.  *
  32.  *    NO_VARARGS can be overruled by defining HAVE_VARARGS in the s-
  33.  *    file.
  34.  */
  35.  
  36. /* #define NO_VARARGS /* unless HAVE_VARARGS */
  37.  
  38. /*
  39.  *    Define STRCSPN if the strcspn() function is not available.
  40.  */
  41.  
  42. /* #define STRCSPN     /* */
  43.  
  44. /*
  45.  *    Define NO_SIGINTERRUPT on BSD based systems which don't have
  46.  *    a siginterrupt() function, but provides an SV_INTERRUPT flag
  47.  *    in <signal.h>.
  48.  */
  49.  
  50. /* #define NO_SIGINTERRUPT    /* */
  51.  
  52.  
  53. #ifdef NETWORK_DATABASE
  54.  
  55. /*
  56.  *    Define NETWORK_BYTE_ORDER if the machine's int32's are
  57.  *    already in network byte order, i.e. m68k based.
  58.  */
  59.  
  60. #define NETWORK_BYTE_ORDER    /* */
  61.  
  62. /*
  63.  *    OTHERWISE provide the functions/macros ntohl/htonl to
  64.  *    convert longs from and to network byte order
  65.  */
  66.  
  67. #ifndef NETWORK_BYTE_ORDER
  68.  
  69. /*
  70.  * Include appropriate files or define macroes or functions (include them
  71.  * in data.c) to convert longs and shorts to and from network byte order.
  72.  */
  73.  
  74. /*
  75.  * This will work on most BSD based systems...
  76.  */
  77.  
  78. #include <netinet/in.h>
  79.  
  80. /*
  81.  * Otherwise, define something appropriate below
  82.  */
  83.  
  84. #define htonl(l)    ...    /* host long to network long */
  85. #define ntohl(l)    ...    /* network long to host long */
  86.  
  87. #endif    /* not NETWORK BYTE ORDER */
  88.  
  89. #endif    /* NETWORK DATABASE */
  90.