cmds.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _CMDS_H
  2. #define _CMDS_H
  3. #include "types.h"
  4. bool is_restricted_cmd(const char*);
  5. typedef struct {
  6. const char *name;
  7. const char *flags;
  8. Function func;
  9. const char *funcname;
  10. int type;
  11. } cmd_t;
  12. typedef struct {
  13. int type;
  14. const char *cmd;
  15. int garble;
  16. const char *desc;
  17. } help_t;
  18. typedef struct {
  19. const char *name;
  20. struct flag_record flags;
  21. } mycmds;
  22. typedef struct {
  23. const char *name;
  24. // Function func;
  25. void (*func) (int, char *);
  26. int type;
  27. } botcmd_t;
  28. const botcmd_t *search_botcmd_t(const botcmd_t *table, const char* key, size_t elements);
  29. typedef struct cmd_pass {
  30. struct cmd_pass *next;
  31. char *name;
  32. char pass[SHA1_SALTED_LEN + 1];
  33. } cmd_pass_t;
  34. extern mycmds cmdlist[];
  35. extern int cmdi;
  36. #define findhelp(x) findcmd(x, 1)
  37. help_t *findcmd(const char *lookup, bool care_about_type);
  38. int check_dcc_attrs(struct userrec *, flag_t);
  39. int check_dcc_chanattrs(struct userrec *, char *, flag_t, flag_t);
  40. int stripmodes(char *);
  41. char *stripmasktype(int);
  42. void gotremotecmd(char * forbot, char * frombot, char * fromhand, char * fromidx, char * cmd);
  43. void gotremotereply(char * frombot, char * tohand, char * toidx, char * ln);
  44. #endif /* !_CMDS_H */