ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/plugins/cfperl/cfperl.xs
(Generate patch)

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.4 by root, Fri Feb 3 17:19:13 2006 UTC vs.
Revision 1.5 by root, Fri Feb 3 19:49:32 2006 UTC

51 51
52static f_plug_api gethook; 52static f_plug_api gethook;
53static f_plug_api registerGlobalEvent; 53static f_plug_api registerGlobalEvent;
54static f_plug_api unregisterGlobalEvent; 54static f_plug_api unregisterGlobalEvent;
55static f_plug_api systemDirectory; 55static f_plug_api systemDirectory;
56static f_plug_api reCmp;
57 56
58typedef struct 57typedef struct
59{ 58{
60 object* who; 59 object* who;
61 object* activator; 60 object* activator;
332 printf (PLUGIN_VERSION " post init\n"); 331 printf (PLUGIN_VERSION " post init\n");
333 332
334 registerGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_register_global_event"); 333 registerGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_register_global_event");
335 unregisterGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_unregister_global_event"); 334 unregisterGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_unregister_global_event");
336 systemDirectory = gethook (&rtype, hooktype, "cfapi_system_directory"); 335 systemDirectory = gethook (&rtype, hooktype, "cfapi_system_directory");
337 reCmp = gethook (&rtype, hooktype, "cfapi_system_re_cmp");
338 cf_init_plugin (gethook); 336 cf_init_plugin (gethook);
339 337
340 /* Pick the global events you want to monitor from this plugin */ 338 /* Pick the global events you want to monitor from this plugin */
341 registerGlobalEvent (NULL, EVENT_BORN, PLUGIN_NAME, globalEventListener); 339 registerGlobalEvent (NULL, EVENT_BORN, PLUGIN_NAME, globalEventListener);
342 registerGlobalEvent (NULL, EVENT_CLOCK, PLUGIN_NAME, globalEventListener); 340 registerGlobalEvent (NULL, EVENT_CLOCK, PLUGIN_NAME, globalEventListener);
357 char *argv[] = { 355 char *argv[] = {
358 "", 356 "",
359 "-e" 357 "-e"
360 "BEGIN {" 358 "BEGIN {"
361 " cf->bootstrap;" 359 " cf->bootstrap;"
362 " unshift @INC, cf::maps_directory ('perl');" 360 " unshift @INC, cf::datadir ();"
363 "}" 361 "}"
364 "" 362 ""
365 "use cf;" 363 "use cf;"
366 }; 364 };
367 365
368 perl = perl_alloc (); 366 perl = perl_alloc ();
369 perl_construct (perl); 367 perl_construct (perl);
370 368
371 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) 369 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl))
372 || perl_run (perl))
373 { 370 {
374 printf ("unable to initialize perl-interpreter, continuing without.\n"); 371 printf ("unable to initialize perl-interpreter, continuing without.\n");
375 372
376 perl_destruct (perl); 373 perl_destruct (perl);
377 perl_free (perl); 374 perl_free (perl);
999 996
1000char * 997char *
1001cf_get_maps_directory (char *path) 998cf_get_maps_directory (char *path)
1002 ALIAS: maps_directory = 0 999 ALIAS: maps_directory = 0
1003 1000
1001char *
1002mapdir ()
1003 ALIAS:
1004 mapdir = 0
1005 uniquedir = 1
1006 tmpdir = 2
1007 confdir = 3
1008 localdir = 4
1009 playerdir = 5
1010 datadir = 6
1011 CODE:
1012{
1013 int unused_type;
1014 RETVAL = (char *)systemDirectory (&unused_type, ix);
1015}
1016 OUTPUT:
1017 RETVAL
1018
1004int 1019int
1005cf_find_animation (char *text) 1020cf_find_animation (char *text)
1006 1021
1007MODULE = cf PACKAGE = cf::object PREFIX = cf_object_ 1022MODULE = cf PACKAGE = cf::object PREFIX = cf_object_
1008 1023

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines