4 * Copyright 2010 Martin Quinson, Mehdi Fekari
7 * This program is free software; you can redistribute
8 * it and/or modify it under the terms of the license
9 *(GNU LGPL) which comes with this package.
11 #include "rb_application_handler.h"
12 #include "surf/surfxml_parse.h"
22 rb_require("ApplicationHandler.rb");
26 static void application_handler_on_start_document(void)
31 current = rb_funcall3(rb_const_get(rb_cObject, rb_intern("ApplicationHandler")), rb_intern("new"), 0, 0);
32 rb_funcall(current,rb_intern("onStartDocument"),0);
34 printf ("application_handler_on_start_document ...Done\n" );
39 static void application_handler_on_end_document(void)
42 rb_funcall(current,rb_intern("onEndDocument"),0);
46 static void application_handler_on_begin_process(void)
49 VALUE hostName = rb_str_new2(A_surfxml_process_host);
50 VALUE function = rb_str_new2(A_surfxml_process_function);
52 printf ("On_Begin_Process: %s : %s \n",RSTRING(hostName)->ptr,RSTRING(function)->ptr);
54 rb_funcall(current,rb_intern("onBeginProcess"),2,hostName,function);
57 static void application_handler_on_process_arg(void)
60 VALUE arg = rb_str_new2(A_surfxml_argument_value);
62 printf ("On_Process_Args >> Sufxml argument value : %s\n",RSTRING(arg)->ptr);
64 rb_funcall(current,rb_intern("onProcessArg"),1,arg);
67 static void application_handler_on_property(void)
71 VALUE id = rb_str_new2(A_surfxml_prop_id);
72 VALUE val = rb_str_new2(A_surfxml_prop_value);
73 rb_funcall(current,rb_intern("onProperty"),2,id,val);
78 static void application_handler_on_end_process(void)
82 rb_funcall(current,rb_intern("onEndProcess"),0);