misc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _MISC_H
  2. #define _MISC_H
  3. #include "common.h"
  4. /*
  5. * Set the following to the timestamp for the logfile entries.
  6. * Popular times might be "[%H:%M]" (hour, min), or "[%H:%M:%S]" (hour, min, sec)
  7. * Read `man strftime' for more formatting options. Keep it below 32 chars.
  8. */
  9. #define LOG_TS "[%H:%M:%S]"
  10. // Define this to be the length of the entire timestamp after replacing vars
  11. #define LOG_TS_LEN 10
  12. void restart(int);
  13. int coloridx(int);
  14. const char *color(int, int, int);
  15. void shuffle(char *, char *, size_t);
  16. void shuffleArray(char **, size_t);
  17. void showhelp(int, struct flag_record *, const char *);
  18. char *replace(const char *, const char *, const char *);
  19. char *replace_vars(char*);
  20. int goodpass(const char *, int, char *);
  21. int bot_aggressive_to(struct userrec *);
  22. void readsocks(const char *);
  23. int updatebin(int, char *, int);
  24. size_t my_strcpy(char *, const char *);
  25. void maskaddr(const char *, char *, int);
  26. #define maskhost(a,b) maskaddr((a),(b),3)
  27. #define maskban(a,b) maskaddr((a),(b),3)
  28. char *stristr(char *, char *);
  29. void splitc(char *, char *, char);
  30. void splitcn(char *, char *, char, size_t);
  31. int remove_crlf(char *);
  32. int remove_crlf_r(char *);
  33. char *newsplit(char **, char delim = ' ', bool trim = 1);
  34. char *splitnick(char **);
  35. void stridx(char *, char *, int);
  36. void daysago(time_t, time_t, char *, size_t);
  37. void days(time_t, time_t, char *, size_t);
  38. void daysdur(time_t, time_t, char *, size_t, bool = true);
  39. void show_motd(int);
  40. void show_channels(int, char *);
  41. void show_banner(int);
  42. void make_rand_str(char *, size_t, bool = 1);
  43. char *str_escape(const char *, const char, const char);
  44. char *strchr_unescape(char *, const char, register const char);
  45. void str_unescape(char *, register const char);
  46. int str_isdigit(const char *);
  47. void kill_bot(char *, char *);
  48. char *strtolower(char *);
  49. char *strtoupper(char *);
  50. char *step_thru_file(FILE *);
  51. char *trim(char *);
  52. int skipline(char *, int *);
  53. extern int server_lag;
  54. extern bool use_invites, use_exempts;
  55. #endif /* !_MISC_H_ */