eggdrop.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 SALT1LEN 32
  27. #define SALT2LEN 16
  28. #define MAXPASSLEN 15
  29. #define PACKNAMELEN 32
  30. #define UHOSTMAX 291 + NICKMAX /* 32 (ident) + 3 (\0, !, @) + NICKMAX */
  31. #define DIRMAX 512 /* paranoia */
  32. #define BADHANDCHARS "-,+*=:!.@#;$%&"
  33. #define MAX_BOTS 500
  34. #define SERVLEN 60
  35. /*
  36. * The 'configure' script should make this next part automatic,
  37. * so you shouldn't need to adjust anything below.
  38. */
  39. #define NICKLEN NICKMAX + 1
  40. #define UHOSTLEN UHOSTMAX + 1
  41. #define DIRLEN DIRMAX + 1
  42. #define NOTENAMELEN ((HANDLEN << 1) + 1)
  43. #define BADNICKCHARS "-,+*=:!.@#;$%&"
  44. #define LISTSEPERATORS ",=:; "
  45. #if (NICKMAX < 9) || (NICKMAX > 32)
  46. # include "invalid NICKMAX value"
  47. #endif
  48. #if (HANDLEN < 9) || (HANDLEN > 32)
  49. # include "invalid HANDLEN value"
  50. #endif
  51. #if HANDLEN > NICKMAX
  52. # include "HANDLEN MUST BE <= NICKMAX"
  53. #endif
  54. /* NAME_MAX is what POSIX defines, but BSD calls it MAXNAMLEN.
  55. * Use 255 if we can't find anything else.
  56. */
  57. #ifndef NAME_MAX
  58. # ifdef MAXNAMLEN
  59. # define NAME_MAX MAXNAMLEN
  60. # else
  61. # define NAME_MAX 255
  62. # endif
  63. #endif
  64. /* Almost every module needs some sort of time thingy, so... */
  65. #if TIME_WITH_SYS_TIME
  66. # include <sys/time.h>
  67. # include <time.h>
  68. #else
  69. # if HAVE_SYS_TIME_H
  70. # include <sys/time.h>
  71. # else
  72. # include <time.h>
  73. # endif
  74. #endif
  75. #if !HAVE_SRANDOM
  76. # define srandom(x) srand(x)
  77. #endif
  78. #if !HAVE_RANDOM
  79. # define random() (rand()/16)
  80. #endif
  81. /* Use high-order bits for getting the random integer. With random()
  82. * modulo would probably be sufficient but on systems lacking random(),
  83. * the function will be just renamed rand().
  84. */
  85. //#define randint(n) (unsigned long) (random() / (RANDOM_MAX + 1.0) * n)
  86. #define randint(n) (unsigned long) (random() / (RANDOM_MAX + 1.0) * ((signed) (n) < 0 ? (signed) (-(n)) : (signed) (n)))
  87. /***********************************************************************/
  88. enum { /* TAKE A GUESS */
  89. OK,
  90. ERROR
  91. };
  92. /* chan & global */
  93. #define FLOOD_PRIVMSG 0
  94. #define FLOOD_NOTICE 1
  95. #define FLOOD_CTCP 2
  96. #define FLOOD_NICK 3
  97. #define FLOOD_JOIN 4
  98. #define FLOOD_KICK 5
  99. #define FLOOD_DEOP 6
  100. #define FLOOD_CHAN_MAX 7
  101. #define FLOOD_GLOBAL_MAX 3
  102. #endif /* _EGG_EGGDROP_H */