make install.sh slightly smarter
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 21 Aug 2005 20:11:28 +0000 (20:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 21 Aug 2005 20:11:28 +0000 (20:11 +0000)
removed compiler error for 'osrf_stack_process' by making it a global variable
set by the stack (osrf_app_session no longer needs to know about the stack directly)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1685 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/src/libstack/osrf_app_session.c
OpenSRF/src/libstack/osrf_app_session.h
OpenSRF/src/libstack/osrf_stack.c
OpenSRF/src/libstack/osrf_stack.h
install.sh

index 5ccbcf0..f9dee7a 100644 (file)
@@ -634,7 +634,7 @@ int osrf_app_session_queue_wait( osrf_app_session* session, int timeout ){
        if(session == NULL) return 0;
        int ret_val = 0;
        debug_handler( "AppSession in queue_wait with timeout %d", timeout );
-       ret_val = osrf_stack_process(session->transport_handle, timeout);
+       ret_val = osrf_stack_entry_point(session->transport_handle, timeout);
        return ret_val;
 }
 
index 5d4a91f..01b6dc5 100644 (file)
@@ -17,6 +17,9 @@
 enum OSRF_SESSION_STATE { OSRF_SESSION_CONNECTING, OSRF_SESSION_CONNECTED, OSRF_SESSION_DISCONNECTED };
 enum OSRF_SESSION_TYPE { OSRF_SESSION_SERVER, OSRF_SESSION_CLIENT };
 
+/* entry point for data into the stack.  gets set in osrf_stack.c */
+int (*osrf_stack_entry_point) (transport_client* client, int timeout );
+
 struct osrf_app_request_struct {
        /** Our controlling session */
        struct osrf_app_session_struct* session;
index 09f46d5..c11cfc6 100644 (file)
@@ -3,6 +3,9 @@
 osrf_message* _do_client( osrf_app_session*, osrf_message* );
 osrf_message* _do_server( osrf_app_session*, osrf_message* );
 
+/* tell osrf_app_session where the stack entry is */
+int (*osrf_stack_entry_point) (transport_client*, int)  = &osrf_stack_process;
+
 int osrf_stack_process( transport_client* client, int timeout ) {
        transport_message* msg = client_recv( client, timeout );
        if(msg == NULL) return 0;
index 805f0c7..aaac111 100644 (file)
@@ -16,4 +16,5 @@ int osrf_stack_message_handler( osrf_app_session* session, osrf_message* msg );
 int osrf_stack_application_handler( osrf_app_session* session, osrf_message* msg );
 
 
+
 #endif
index 49ba355..6633bf5 100755 (executable)
@@ -228,7 +228,7 @@ function runInstall {
 # --------------------------------------------------------------------
 function checkParams {
 
-       if [ -z "$1" ]; then return; fi;
+       if [ -z "$1" ]; then usage; fi;
 
        for arg in "$@"; do
 
@@ -245,7 +245,7 @@ function checkParams {
                        "install")
                                INSTALLING="1";;
 
-                       *) fail "Unknown command line argument: $arg";;
+                       *) fail "Unknown option => $arg";
                esac
        done
 
@@ -260,8 +260,12 @@ function cleanMe {
        make -s -C "$EVERGREENDIR" clean;
 }
 
-checkParams "$@";
+function usage {
+       echo "usage: $0 [ build | install | clean ]";
+       exit;
+}
 
+checkParams "$@";
 
 if building; then echo "Building..."; fi;
 if installing; then echo "Installing..."; fi;