1 #include "rb_application_handler.h"
2 #include "surf/surfxml_parse.h"
12 rb_require("ApplicationHandler.rb");
16 static void application_handler_on_start_document(void)
22 current = rb_funcall3(rb_const_get(rb_cObject, rb_intern("ApplicationHandler")), rb_intern("new"), 0, 0);
23 rb_funcall(current,rb_intern("onStartDocument"),0);
25 printf ("application_handler_on_start_document ...Done\n" );
30 static void application_handler_on_end_document(void)
34 rb_funcall(current,rb_intern("onEndDocument"),0);
38 static void application_handler_on_begin_process(void)
41 VALUE hostName = rb_str_new2(A_surfxml_process_host);
42 VALUE function = rb_str_new2(A_surfxml_process_function);
44 printf ("On_Begin_Process: %s : %s \n",RSTRING(hostName)->ptr,RSTRING(function)->ptr);
46 rb_funcall(current,rb_intern("onBeginProcess"),2,hostName,function);
49 static void application_handler_on_process_arg(void)
52 VALUE arg = rb_str_new2(A_surfxml_argument_value);
54 printf ("On_Process_Args >> Sufxml argument value : %s\n",RSTRING(arg)->ptr);
56 rb_funcall(current,rb_intern("onProcessArg"),1,arg);
59 static void application_handler_on_property(void)
64 VALUE id = rb_str_new2(A_surfxml_prop_id);
65 VALUE val = rb_str_new2(A_surfxml_prop_value);
67 rb_funcall(current,rb_intern("onProperty"),2,id,val);
73 static void application_handler_on_end_process(void)
78 rb_funcall(current,rb_intern("onEndProcess"),0);