types.h 646 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 <stdint.h>
  8. #include <netinet/in.h>
  9. /* For local console: */
  10. #define STDIN 0
  11. #define STDOUT 1
  12. #define STDERR 2
  13. /* It's used in so many places, let's put it here */
  14. typedef int (*Function) ();
  15. typedef intptr_t (*FunctionPtr) ();
  16. #if !HAVE_SOCKLEN_T
  17. typedef int socklen_t;
  18. #endif
  19. // Signed so that it can play nice with time_t
  20. typedef int interval_t;
  21. typedef struct {
  22. int family;
  23. union {
  24. struct in_addr addr;
  25. #ifdef USE_IPV6
  26. struct in6_addr addr6;
  27. #endif
  28. } u;
  29. } my_addr_t;
  30. #endif /* !_TYPES_H */