common.h 1.0 KB

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