home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD: Millenium / STCMILLENIUM.iso / vollvers / draconis / drtomint / global.h < prev    next >
C/C++ Source or Header  |  1999-08-22  |  3KB  |  99 lines

  1.  /*
  2.  * Filename:     
  3.  * Version:      
  4.  * Author:       Jens Heitmann, Frank Naumann
  5.  * Started:      1999-05
  6.  * Last Updated: 1999-08-18
  7.  * Target O/S:   MiNT
  8.  * Description:  
  9.  * 
  10.  * Note:         Please send suggestions, patches or bug reports to me
  11.  *               or the MiNT mailing list <mint@fishpool.com>.
  12.  * 
  13.  * Copying:      Copyright 1999 Frank Naumann <fnaumann@cs.uni-magdeburg.de>
  14.  *               Copyright 1999 Jens Heitmann
  15.  * 
  16.  * This program is free software; you can redistribute it and/or modify
  17.  * it under the terms of the GNU General Public License as published by
  18.  * the Free Software Foundation; either version 2, or (at your option)
  19.  * any later version.
  20.  * 
  21.  * This program is distributed in the hope that it will be useful,
  22.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  * GNU General Public License for more details.
  25.  * 
  26.  * You should have received a copy of the GNU General Public License
  27.  * along with this program; if not, write to the Free Software
  28.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  * 
  30.  */
  31.  
  32. # ifndef _global_h
  33. # define _global_h
  34.  
  35. # include <stdio.h>
  36. # include <stdlib.h>
  37. # include <string.h>
  38. # include <time.h>
  39. # include <unistd.h>
  40. # include <fcntl.h>
  41. # include <netdb.h>
  42. # include <sys/socket.h>
  43. # include <sys/time.h>
  44. # include <sys/types.h>
  45. # include <netinet/in.h>
  46. # include <errno.h>
  47.  
  48. # include <mintbind.h>
  49. # include "mintsock.h"
  50.  
  51.  
  52. # ifndef _cdecl
  53. # define _cdecl        __CDECL
  54. # endif
  55.  
  56. # define str(x)        _stringify (x)
  57. # define _stringify(x)    #x
  58.  
  59.  
  60. # define SOCKDEV    "u:\\dev\\socket"
  61. # define TCPCOOKIE    0x49434950L    /* ICIP */
  62. # define FREECOOKIE    0x46524545L    /* FREE */
  63. # define JAR        0x5A0
  64.  
  65. /* struct for Pmsg() */
  66. typedef struct
  67. {
  68.     long msg1;
  69.     long msg2;
  70.     short pid;
  71. } PMSG;
  72.  
  73. # define MGW_GETHOSTBYNAME    0x6d676d01UL
  74.     
  75.  
  76. /*
  77.  * Adapted part of STSOCKET.H
  78.  */
  79. # define ST_FDSET_LONGS 8
  80.  
  81. typedef struct st_fd_set st_fd_set;
  82. struct st_fd_set 
  83. {
  84.     ulong fds_bits [ST_FDSET_LONGS];
  85. };
  86.  
  87. # define ST_NFDBITS        (8 * sizeof(unsigned long))
  88. # define ST_FD_SETSIZE        (ST_FDSET_LONGS * ST_NFDBITS)
  89.  
  90. # define ST_FDELT(d)        (d / ST_NFDBITS)
  91. # define ST_FDMASK(d)        (1L << (d % ST_NFDBITS))
  92. # define ST_FD_SET(d, set)    ((set)->fds_bits[ST_FDELT(d)] |= ST_FDMASK(d))
  93. # define ST_FD_CLR(d, set)    ((set)->fds_bits[ST_FDELT(d)] &= ~ST_FDMASK(d))
  94. # define ST_FD_ISSET(d, set)    ((set)->fds_bits[ST_FDELT(d)] & ST_FDMASK(d))
  95. # define ST_FD_ZERO(set)     memset(set, 0, sizeof(st_fd_set))
  96.  
  97.  
  98. # endif /* _global_h */
  99.