int osrfAppInitialize() {
- osrfAppRegisterMethod(
- MODULENAME, /* which application has this method */
- "add", /* the name of the method */
- "osrfMathRun", /* the symbol that runs the method */
- "Adds two numbers", /* description of the method */
- 2, /* the minimum number of params required to run the method */
- 0 ); /* method options, 0 for not special options */
-
- osrfAppRegisterMethod(
- MODULENAME,
- "sub",
- "osrfMathRun",
+ osrfAppRegisterMethod(
+ MODULENAME, /* which application has this method */
+ "add", /* the name of the method */
+ "osrfMathRun", /* the symbol that runs the method */
+ "Adds two numbers", /* description of the method */
+ 2, /* the minimum number of params required to run the method */
+ 0 ); /* method options, 0 for not special options */
+
+ osrfAppRegisterMethod(
+ MODULENAME,
+ "sub",
+ "osrfMathRun",
"Subtracts two numbers", 2, 0 );
- osrfAppRegisterMethod(
- MODULENAME,
- "mult",
- "osrfMathRun",
+ osrfAppRegisterMethod(
+ MODULENAME,
+ "mult",
+ "osrfMathRun",
"Multiplies two numbers", 2, 0 );
- osrfAppRegisterMethod(
- MODULENAME,
- "div",
- "osrfMathRun",
+ osrfAppRegisterMethod(
+ MODULENAME,
+ "div",
+ "osrfMathRun",
"Divides two numbers", 2, 0 );
return 0;
/* called when this process is about to exit */
void osrfAppChildExit() {
- osrfLogDebug(OSRF_LOG_MARK, "Child is exiting...");
+ osrfLogDebug(OSRF_LOG_MARK, "Child is exiting...");
}
if( a && b ) {
- osrfLogActivity( OSRF_LOG_MARK, "Running opensrf.math %s [ %s : %s ]",
+ osrfLogActivity( OSRF_LOG_MARK, "Running opensrf.math %s [ %s : %s ]",
ctx->method->name, a, b );
/* construct a new params object to send to dbmath */
osrfAppSession* ses = osrfAppSessionClientInit("opensrf.dbmath");
/* forcing an explicit connect allows us to talk to one worker backend
- * regardless of "stateful" config settings for the server
+ * regardless of "stateful" config settings for the server
* This buys us nothing here since we're only sending one request...
* */
/*osrfAppSessionConnect(ses);*/
if(omsg) {
/* return dbmath's response to the user */
- osrfAppRespondComplete( ctx, osrfMessageGetResult(omsg) );
+ osrfAppRespondComplete( ctx, osrfMessageGetResult(omsg) );
osrfMessageFree(omsg);
osrfAppSessionFree(ses);
return 0;
osrfAppSessionFree(ses);
}
else {
- if(a) free(a);
- if(b) free(b);
+ if(a)
+ free(a);
+ if(b)
+ free(b);
}
}
return -1;
}
-
-
-