int osrfAppRegisterMethod( char* appName, char* methodName,
char* symbolName, char* notes, int argc, int options ) {
+ return osrfAppRegisterExtendedMethod(
+ appName,
+ methodName,
+ symbolName,
+ notes,
+ argc,
+ options,
+ NULL
+ );
+
+}
+
+int osrfAppRegisterExtendedMethod( char* appName, char* methodName,
+ char* symbolName, char* notes, int argc, int options, void * user_data ) {
+
if( !appName || ! methodName ) return -1;
osrfApplication* app = _osrfAppFindApplication(appName);
osrfLogDebug( OSRF_LOG_MARK, "Registering method %s for app %s", methodName, appName );
osrfMethod* method = _osrfAppBuildMethod(
- methodName, symbolName, notes, argc, options );
+ methodName, symbolName, notes, argc, options, user_data );
method->options = options;
/* plug the method into the list of methods */
if( options & OSRF_METHOD_STREAMING ) { /* build the atomic counterpart */
int newops = options | OSRF_METHOD_ATOMIC;
osrfMethod* atomicMethod = _osrfAppBuildMethod(
- methodName, symbolName, notes, argc, newops );
+ methodName, symbolName, notes, argc, newops, NULL );
osrfHashSet( app->methods, atomicMethod, atomicMethod->name );
}
osrfMethod* _osrfAppBuildMethod( char* methodName,
- char* symbolName, char* notes, int argc, int options ) {
+ char* symbolName, char* notes, int argc, int options, void* user_data ) {
osrfMethod* method = safe_malloc(sizeof(osrfMethod));
if(methodName) method->name = strdup(methodName);
if(symbolName) method->symbol = strdup(symbolName);
if(notes) method->notes = strdup(notes);
+ if(user_data) method->userData = user_data;
method->argc = argc;
method->options = options;
int argc; /* how many args this method expects */
//char* paramNotes; /* Description of the params expected for this method */
int options; /* describes the various options for this method */
+ void* userData; /* You can put your weeeeeeed in it ... */
/*
int sysmethod;
char* symbolName, char* notes, int argc, int options );
+int osrfAppRegisterExtendedMethod( char* appName, char* methodName,
+ char* symbolName, char* notes, int argc, int options, void* );
+
osrfMethod* _osrfAppBuildMethod( char* methodName,
- char* symbolName, char* notes, int argc, int options );
+ char* symbolName, char* notes, int argc, int options, void* );
/**
Finds the given app in the list of apps