adding new open-ils.cstore app; moving new IDL generator to a better home; added...
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 9 May 2006 05:30:57 +0000 (05:30 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 9 May 2006 05:30:57 +0000 (05:30 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@712 9efc2488-bf62-4759-914b-345cdb29e865

src/libstack/osrf_application.c
src/libstack/osrf_application.h

index 713a19d..5722214 100644 (file)
@@ -85,6 +85,21 @@ int osrfAppRunChildInit(char* appname) {
 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);
@@ -96,7 +111,7 @@ int osrfAppRegisterMethod( char* appName, char* methodName,
        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 */
@@ -105,7 +120,7 @@ int osrfAppRegisterMethod( char* appName, char* methodName,
        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 );
        }
 
@@ -115,13 +130,14 @@ int osrfAppRegisterMethod( char* appName, char* methodName,
 
 
 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;
index dd5a958..c62aebb 100644 (file)
@@ -88,6 +88,7 @@ struct _osrfMethodStruct {
        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;                          
@@ -133,8 +134,11 @@ int osrfAppRegisterMethod( char* appName, char* methodName,
                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