34 #include <plugin_template_proto.h>
44 current_context = NULL;
51 if (current_context == NULL) {
52 context_stack = context;
57 current_context = context;
63 if (current_context != NULL) {
65 current_context = current_context->
down;
88 propname = va_arg(args,
const char *);
90 if (!strcmp(propname,
"command?")) {
92 cmdname = va_arg(args,
const char *);
98 }
else if (!strcmp(propname,
"Identification")) {
99 buf = va_arg(args,
char *);
100 size = va_arg(args,
int);
104 }
else if (!strcmp(propname,
"FullName")) {
105 buf = va_arg(args,
char *);
106 size = va_arg(args,
int);
152 va_start(args, type);
154 printf(
"****** Global event listener called ***********\n");
155 printf(
"- Event code: %d\n", context->
event_code);
161 context->
third = NULL;
162 context->
event = NULL;
166 printf(
"Unimplemented for now\n");
170 context->
activator = va_arg(args,
object *);
174 context->
who = va_arg(args,
object *);
178 context->
who = va_arg(args,
object *);
179 context->
activator = va_arg(args,
object *);
183 pl = va_arg(args,
player *);
185 buf = va_arg(args,
char *);
191 pl = va_arg(args,
player *);
193 buf = va_arg(args,
char *);
199 context->
activator = va_arg(args,
object *);
203 context->
activator = va_arg(args,
object *);
204 buf = va_arg(args,
char *);
210 context->
activator = va_arg(args,
object *);
211 buf = va_arg(args,
char *);
217 context->
activator = va_arg(args,
object *);
218 buf = va_arg(args,
char *);
224 context->
activator = va_arg(args,
object *);
228 context->
activator = va_arg(args,
object *);
235 buf = va_arg(args,
char *);
241 context->
activator = va_arg(args,
object *);
242 buf = va_arg(args,
char *);
245 context->
third = va_arg(args,
object *);
256 cf_log(
llevDebug,
"*********** Execution complete ****************\n");
271 va_start(args, type);
273 context->
who = va_arg(args,
object *);
274 context->
activator = va_arg(args,
object *);
275 context->
third = va_arg(args,
object *);
276 buf = va_arg(args,
char *);
279 context->
fix = va_arg(args,
int);
280 context->
event = va_arg(args,
object *);
CF_PLUGIN void * eventListener(int *type,...)
CFPContext * current_context
void *(* f_plug_api)(int *type,...)
CF_PLUGIN int postInitPlugin(void)
CF_PLUGIN int initPlugin(const char *iversion, f_plug_api gethooksptr)
CF_PLUGIN int runPluginCommand(object *op, char *params)
void cf_log(LogLevel logLevel, const char *format,...)
int cf_init_plugin(f_plug_api getHooks)
CFPContext * context_stack
CF_PLUGIN int closePlugin(void)
static int current_command
void pushContext(CFPContext *context)
CF_PLUGIN void * globalEventListener(int *type,...)
int snprintf(char *dest, int max, const char *format,...)
CFPContext * popContext(void)
void initContextStack(void)
CF_PLUGIN void * getPluginProperty(int *type,...)
struct _cfpcontext * down
#define EVENT_PLAYER_DEATH