types.h 787 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _TYPES_H
  2. #define _TYPES_H
  3. #ifdef HAVE_CONFIG_H
  4. # include "config.h"
  5. #endif
  6. #include <sys/types.h>
  7. #include <netinet/in.h>
  8. /* For local console: */
  9. #define STDIN 0
  10. #define STDOUT 1
  11. #define STDERR 2
  12. /* It's used in so many places, let's put it here */
  13. typedef int (*Function) ();
  14. #if !HAVE_SOCKLEN_T
  15. typedef int socklen_t;
  16. #endif
  17. /* 32 bit type */
  18. #if (SIZEOF_INT == 4)
  19. typedef unsigned int u_32bit_t;
  20. #else
  21. # if (SIZEOF_LONG == 4)
  22. typedef unsigned long u_32bit_t;
  23. # else
  24. # include "cant/find/32bit/type"
  25. # endif
  26. #endif
  27. typedef unsigned short int u_16bit_t;
  28. typedef unsigned char u_8bit_t;
  29. /* IP type */
  30. typedef in_addr_t IP;
  31. typedef u_int32_t dword;
  32. /* port */
  33. typedef in_port_t port_t;
  34. #endif /* !_TYPES_H */