common.h 1005 B

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