common.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * common.h
  3. * include file to include most other include files
  4. *
  5. */
  6. #ifndef _COMMON_H
  7. #define _COMMON_H
  8. /* These should be in a common.h, like it or not... */
  9. #ifdef HAVE_CONFIG_H
  10. # include "config.h"
  11. #endif
  12. #include "bits.h"
  13. #include "garble.h"
  14. #include "conf.h"
  15. #include "debug.h"
  16. #include "eggdrop.h"
  17. #include "flags.h"
  18. #include "log.h"
  19. #include "dccutil.h"
  20. #include "chan.h"
  21. #include "compat/compat.h"
  22. #ifdef CYGWIN_HACKS
  23. # include <windows.h>
  24. #endif /* CYGWIN_HACKS */
  25. #include <sys/param.h>
  26. #include <unistd.h>
  27. #include <stdio.h>
  28. #include <stdlib.h>
  29. #include <string.h>
  30. #include <errno.h>
  31. #ifdef HAVE_STRINGS_H
  32. # include <strings.h>
  33. #endif
  34. #include "lang.h"
  35. /* This macro copies (_len - 1) bytes from _source to _target. The
  36. * target string is NULL-terminated.
  37. */
  38. #define strncpyz(_target, _source, _len) do { \
  39. strncpy((_target), (_source), (_len) - 1); \
  40. (_target)[(_len) - 1] = 0; \
  41. } while (0)
  42. #ifdef WIN32
  43. # undef exit
  44. # define exit(x) ExitProcess(x)
  45. /*
  46. # undef system
  47. int my_system(const char *);
  48. # define system(_run) my_system(_run)
  49. */
  50. #endif /* WIN32 */
  51. #endif /* _COMMON_H */