home *** CD-ROM | disk | FTP | other *** search
/ Informática Multimedia: Special Games (Alt) / INFESPGAMES.iso / os2 / backgam / source / macro.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-16  |  3.0 KB  |  79 lines

  1. /*************************************************************
  2.  *    ______                                                 *
  3.  *   /     /\  TinyFugue was derived from a client initially *
  4.  *  /   __/  \ written by Anton Rang (Tarrant) and later     *
  5.  *  |  / /\  | modified by Leo Plotkin (Grod).  The early    *
  6.  *  |  |/    | versions of TinyFugue written by Greg Hudson  *
  7.  *  |  X__/  | (Explorer_Bob).  The current version is       *
  8.  *  \ /      / written and maintained by Ken Keys (Hawkeye), *
  9.  *   \______/  who can be reached at kkeys@ucsd.edu.         *
  10.  *                                                           *
  11.  *             No copyright 1992, no rights reserved.        *
  12.  *             Fugue is in the public domain.                *
  13.  *************************************************************/
  14.  
  15. typedef struct Macro {
  16.     struct Macro *next, *prev;           /* list by number */
  17.     struct Macro *tnext, *tprev;         /* list by trigger priority */
  18.     struct Macro *hnext, *hprev;         /* list by hook */
  19.     struct Macro *pnext;                 /* temp ptr for collision list */
  20.     struct Macro *bnext, *bprev;         /* list in hash bucket */
  21.     char *name, *trig, *hargs, *bind, *body;
  22.     void NDECL((*func));                 /* ptr to func, saves lookup */
  23.     int hook;                            /* at least 32 bits anywhere TF runs */
  24.     struct World *world;                 /* only trigger on text from here */
  25.     int pri, num;
  26.     short attr, prob, shots, invis, temp;
  27. } Macro;
  28.  
  29. enum Hooks {
  30.   H_ACTIVITY,
  31.   H_BACKGROUND,
  32.   H_BAMF,
  33.   H_CONFAIL,
  34.   H_CONNECT,
  35.   H_DISCONNECT,
  36.   H_HISTORY,
  37.   H_KILL,
  38.   H_LOAD,
  39.   H_LOADFAIL,
  40.   H_LOGIN,
  41.   H_MAIL,
  42.   H_MORE,
  43.   H_PENDING,
  44.   H_PROCESS,
  45.   H_REDEF,
  46.   H_RESIZE,
  47.   H_RESUME,
  48.   H_SEND,
  49.   H_SHELL,
  50.   H_WORLD
  51. };
  52.  
  53. #define AnyHook 07777777                 /* all bits in hook bitfield */
  54.  
  55. extern void   NDECL(init_macros);
  56. extern short  FDECL(parse_attrs,(char *args));
  57. extern Macro *FDECL(macro_spec,(char *args));
  58. extern struct Macro *FDECL(new_macro,(char *name, char *trig, char *binding,
  59.     int hook, char *hargs, char *body, struct World *world, int pri, int prob,
  60.     int attr, int shots, int invis));
  61. extern void  FDECL(add_macro,(struct Macro *macro));
  62. extern int   FDECL(install_bind,(struct Macro *spec));
  63. extern void  FDECL(add_hook,(char *name, char *body));
  64. extern void  FDECL(do_add,(struct Macro *spec));
  65. extern void  FDECL(do_edit,(struct Macro *spec));
  66. extern void  FDECL(remove_macro,(char *args, int attr, int byhook));
  67. extern void  FDECL(nuke_macro,(struct Macro *macro));
  68. extern void  FDECL(purge_macro,(struct Macro *spec));
  69. extern void  FDECL(remove_by_number,(char *args));
  70. extern void  FDECL(save_macros,(char *args));
  71. extern void  FDECL(list_macros,(char *args));
  72. extern int   FDECL(world_subs,(char *src, Stringp dest));
  73. extern void  FDECL(do_macro,(char *name, char *args, 
  74.     Stringp dest, int toplevel));
  75. extern short VDECL(do_hook,(int index, char *fmt, char *argfmt, ...));
  76. extern void  FDECL(get_macro_body,(char *name, Stringp dest));
  77. extern short FDECL(check_trigger,(char *s));
  78.  
  79.