cmds.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. int type;
  22. } mycmds;
  23. typedef struct {
  24. const char *name;
  25. // Function func;
  26. void (*func) (int, char *);
  27. int type;
  28. } botcmd_t;
  29. const botcmd_t *search_botcmd_t(const botcmd_t *table, const char* key, size_t elements);
  30. typedef struct cmd_pass {
  31. struct cmd_pass *next;
  32. char *name;
  33. char pass[SHA1_SALTED_LEN + 1];
  34. } cmd_pass_t;
  35. extern mycmds cmdlist[];
  36. extern int cmdi;
  37. #define findhelp(x) findcmd(x, 1)
  38. help_t *findcmd(const char *lookup, bool care_about_type);
  39. int check_dcc_attrs(struct userrec *, flag_t);
  40. int check_dcc_chanattrs(struct userrec *, char *, flag_t, flag_t);
  41. int stripmodes(char *);
  42. char *stripmasktype(int);
  43. void gotremotecmd(char * forbot, char * frombot, char * fromhand, char * fromidx, char * cmd);
  44. void gotremotereply(char * frombot, char * tohand, char * toidx, char * ln);
  45. #endif /* !_CMDS_H */