From ae9f9d49f6bab855d4fb9437d3c921a3584f78f7 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 21 Aug 2005 20:11:28 +0000 Subject: [PATCH] make install.sh slightly smarter 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 | 2 +- OpenSRF/src/libstack/osrf_app_session.h | 3 +++ OpenSRF/src/libstack/osrf_stack.c | 3 +++ OpenSRF/src/libstack/osrf_stack.h | 1 + install.sh | 10 +++++++--- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/OpenSRF/src/libstack/osrf_app_session.c b/OpenSRF/src/libstack/osrf_app_session.c index 5ccbcf060f..f9dee7a0dd 100644 --- a/OpenSRF/src/libstack/osrf_app_session.c +++ b/OpenSRF/src/libstack/osrf_app_session.c @@ -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; } diff --git a/OpenSRF/src/libstack/osrf_app_session.h b/OpenSRF/src/libstack/osrf_app_session.h index 5d4a91f2cf..01b6dc5c0f 100644 --- a/OpenSRF/src/libstack/osrf_app_session.h +++ b/OpenSRF/src/libstack/osrf_app_session.h @@ -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; diff --git a/OpenSRF/src/libstack/osrf_stack.c b/OpenSRF/src/libstack/osrf_stack.c index 09f46d5cb2..c11cfc6e46 100644 --- a/OpenSRF/src/libstack/osrf_stack.c +++ b/OpenSRF/src/libstack/osrf_stack.c @@ -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; diff --git a/OpenSRF/src/libstack/osrf_stack.h b/OpenSRF/src/libstack/osrf_stack.h index 805f0c79e4..aaac1116bd 100644 --- a/OpenSRF/src/libstack/osrf_stack.h +++ b/OpenSRF/src/libstack/osrf_stack.h @@ -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 diff --git a/install.sh b/install.sh index 49ba3552e9..6633bf5772 100755 --- a/install.sh +++ b/install.sh @@ -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; -- 2.43.2