eggdrop.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * eggdrop.h
  3. * Eggdrop compile-time settings
  4. *
  5. * IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  6. *
  7. */
  8. #ifndef _EGG_EGGDROP_H
  9. #define _EGG_EGGDROP_H
  10. /*
  11. * HANDLEN note:
  12. * HANDLEN defines the maximum length a handle on the bot can be.
  13. * Standard (and minimum) is 9 characters long.
  14. *
  15. * Beware that using lengths over 9 chars is 'non-standard' and if
  16. * you wish to link to other bots, they _must_ both have the same
  17. * maximum handle length.
  18. *
  19. * NICKMAX note:
  20. * You should leave this at 32 characters and modify nick-len in the
  21. * configuration file instead.
  22. */
  23. #define HANDLEN 9 /* valid values 9->NICKMAX */
  24. #define NICKMAX 32 /* valid values HANDLEN->32 */
  25. /* Handy string lengths */
  26. #define UHOSTMAX 291 + NICKMAX /* 32 (ident) + 3 (\0, !, @) + NICKMAX */
  27. #define DIRMAX 512 /* paranoia */
  28. #define BADHANDCHARS "-,+*=:!.@#;$%&"
  29. #define MAX_BOTS 500
  30. #define SERVLEN 60
  31. /*
  32. * The 'configure' script should make this next part automatic,
  33. * so you shouldn't need to adjust anything below.
  34. */
  35. #define NICKLEN NICKMAX + 1
  36. #define UHOSTLEN UHOSTMAX + 1
  37. #define DIRLEN DIRMAX + 1
  38. #define NOTENAMELEN ((HANDLEN * 2) + 1)
  39. #define BADNICKCHARS "-,+*=:!.@#;$%&"
  40. #if (NICKMAX < 9) || (NICKMAX > 32)
  41. # include "invalid NICKMAX value"
  42. #endif
  43. #if (HANDLEN < 9) || (HANDLEN > 32)
  44. # include "invalid HANDLEN value"
  45. #endif
  46. #if HANDLEN > NICKMAX
  47. # include "HANDLEN MUST BE <= NICKMAX"
  48. #endif
  49. /* NAME_MAX is what POSIX defines, but BSD calls it MAXNAMLEN.
  50. * Use 255 if we can't find anything else.
  51. */
  52. #ifndef NAME_MAX
  53. # ifdef MAXNAMLEN
  54. # define NAME_MAX MAXNAMLEN
  55. # else
  56. # define NAME_MAX 255
  57. # endif
  58. #endif
  59. /* Almost every module needs some sort of time thingy, so... */
  60. #if TIME_WITH_SYS_TIME
  61. # include <sys/time.h>
  62. # include <time.h>
  63. #else
  64. # if HAVE_SYS_TIME_H
  65. # include <sys/time.h>
  66. # else
  67. # include <time.h>
  68. # endif
  69. #endif
  70. #if !HAVE_SRANDOM
  71. # define srandom(x) srand(x)
  72. #endif
  73. #if !HAVE_RANDOM
  74. # define random() (rand()/16)
  75. #endif
  76. /* Use high-order bits for getting the random integer. With random()
  77. * modulo would probably be sufficient but on systems lacking random(),
  78. * the function will be just renamed rand().
  79. */
  80. #define randint(n) (unsigned long) (random() / (RAND_MAX + 1.0) * ((n) < 0 ? (-(n)) : (n)))
  81. /***********************************************************************/
  82. enum { /* TAKE A GUESS */
  83. OK,
  84. ERROR
  85. };
  86. /* chan & global */
  87. #define FLOOD_PRIVMSG 0
  88. #define FLOOD_NOTICE 1
  89. #define FLOOD_CTCP 2
  90. #define FLOOD_NICK 3
  91. #define FLOOD_JOIN 4
  92. #define FLOOD_KICK 5
  93. #define FLOOD_DEOP 6
  94. #define FLOOD_CHAN_MAX 7
  95. #define FLOOD_GLOBAL_MAX 3
  96. #endif /* _EGG_EGGDROP_H */