version 1.4 | | version 1.5 |
---|
| | |
return NULL; | | return NULL; |
} | | } |
| | |
int initPlugin(const char* iversion, f_plug_api gethooksptr) | | CF_PLUGIN int initPlugin(const char* iversion, f_plug_api gethooksptr) |
{ | | { |
gethook = gethooksptr; | | gethook = gethooksptr; |
| | |
| | |
return 0; | | return 0; |
} | | } |
| | |
void* getPluginProperty(int* type, ...) | | CF_PLUGIN void* getPluginProperty(int* type, ...) |
{ | | { |
va_list args; | | va_list args; |
char* propname; | | char* propname; |
| | |
va_start(args, type); | | va_start(args, type); |
propname = va_arg(args, char *); | | propname = va_arg(args, char *); |
printf("Property name: %s\n", propname); | | |
| | |
if (!strcmp(propname, "Identification")) | | if (!strcmp(propname, "Identification")) |
{ | | { |
| | |
return NULL; | | return NULL; |
} | | } |
| | |
int runPluginCommand(object* op, char* params) | | CF_PLUGIN int runPluginCommand(object* op, char* params) |
{ | | { |
return -1; | | return -1; |
} | | } |
| | |
int postInitPlugin() | | CF_PLUGIN int postInitPlugin() |
{ | | { |
int hooktype = 1; | | int hooktype = 1; |
int rtype = 0; | | int rtype = 0; |
| | |
printf("Template 2.0a post init\n"); | | printf("CFAnim 2.0a post init\n"); |
registerGlobalEvent = gethook(&rtype,hooktype,"cfapi_system_register_global_event"); | | registerGlobalEvent = gethook(&rtype,hooktype,"cfapi_system_register_global_event"); |
unregisterGlobalEvent = gethook(&rtype,hooktype,"cfapi_system_unregister_global_event"); | | unregisterGlobalEvent = gethook(&rtype,hooktype,"cfapi_system_unregister_global_event"); |
systemDirectory = gethook(&rtype,hooktype,"cfapi_system_directory"); | | systemDirectory = gethook(&rtype,hooktype,"cfapi_system_directory"); |
| | |
return 0; | | return 0; |
} | | } |
| | |
void* globalEventListener(int* type, ...) | | CF_PLUGIN void* globalEventListener(int* type, ...) |
{ | | { |
va_list args; | | va_list args; |
static int rv=0; | | static int rv=0; |
CFPContext* context; | | CFPContext* context; |
context = malloc(sizeof(CFPContext)); | | |
char* buf; | | char* buf; |
player* pl; | | player* pl; |
| | context = malloc(sizeof(CFPContext)); |
| | |
va_start(args, type); | | va_start(args, type); |
context->event_code = va_arg(args, int); | | context->event_code = va_arg(args, int); |
| | |
return &rv; | | return &rv; |
} | | } |
| | |
void* eventListener(int* type, ...) | | CF_PLUGIN void* eventListener(int* type, ...) |
{ | | { |
static int rv=0; | | static int rv=0; |
va_list args; | | va_list args; |
| | |
return &rv; | | return &rv; |
} | | } |
| | |
int closePlugin() | | CF_PLUGIN int closePlugin() |
{ | | { |
printf("CFAnim 2.0a closing\n"); | | printf("CFAnim 2.0a closing\n"); |
return 0; | | return 0; |