#include "opensrf/osrf_application.h"
#include "objson/object.h"
-int initialize();
-int childInit();
+int osrfAppInitialize();
+int osrfAppChildInit();
int osrfMathRun( osrfMethodContext* );
-int initialize() {
+int osrfAppInitialize() {
osrfAppRegisterMethod( "opensrf.dbmath", "add", "osrfMathRun", "send 2 numbers and I'll add them", 2 );
osrfAppRegisterMethod( "opensrf.dbmath", "sub", "osrfMathRun", "send 2 numbers and I'll divide them", 2 );
osrfAppRegisterMethod( "opensrf.dbmath", "mult", "osrfMathRun", "send 2 numbers and I'll multiply them", 2 );
return 0;
}
-int childInit() {
+int osrfAppChildInit() {
return 0;
}
#include "opensrf/osrf_application.h"
#include "objson/object.h"
-int initialize();
-int childInit();
+int osrfAppInitialize();
+int osrfAppChildInit();
int osrfMathRun( osrfMethodContext* );
-int initialize() {
+int osrfAppInitialize() {
/* tell the server about the methods we handle */
osrfAppRegisterMethod( "opensrf.math", "add", "osrfMathRun", "send 2 numbers and I'll add them", 2 );
return 0;
}
-int childInit() {
+int osrfAppChildInit() {
return 0;
}
/* see if we can run the initialize method */
int (*init) (void);
- *(void **) (&init) = dlsym(app->handle, "initialize");
+ *(void **) (&init) = dlsym(app->handle, "osrfAppInitialize");
if( (error = dlerror()) != NULL ) {
- warning_handler("! Unable to locate method symbol [initialize] for app %s: %s", appName, error );
+ warning_handler("! Unable to locate method symbol [osrfAppInitialize] for app %s: %s", appName, error );
} else {
int ret;
if( (ret = (*init)()) ) {
warning_handler("Application %s returned non-zero value from "
- "'initialize', not registering...", appName );
+ "'osrfAppInitialize', not registering...", appName );
//free(app->name); /* need a method to remove an application from the list */
//free(app);
return ret;