common.h 895 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 "garble.h"
  13. #include "debug.h"
  14. #include "eggdrop.h"
  15. #include "flags.h"
  16. #include "log.h" /* putlog() */
  17. #include "dccutil.h" /* dprintf() */
  18. #include "chan.h"
  19. #include "compat/compat.h"
  20. #ifdef HAVE_UNISTD_H
  21. # include <unistd.h>
  22. #endif
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26. #ifdef HAVE_STRINGS_H
  27. # include <strings.h>
  28. #endif
  29. #include "lang.h"
  30. #include "tclegg.h"
  31. /* This macro copies (_len - 1) bytes from _source to _target. The
  32. * target string is NULL-terminated.
  33. */
  34. #define strncpyz(_target, _source, _len) do { \
  35. strncpy((_target), (_source), (_len) - 1); \
  36. (_target)[(_len) - 1] = 0; \
  37. } while (0)
  38. #endif /* _COMMON_H */