]> git.evergreen-ils.org Git - Evergreen.git/blob - OpenSRF/src/srfsh/srfsh.h
added history file so history is saved across sessions
[Evergreen.git] / OpenSRF / src / srfsh / srfsh.h
1 #include "opensrf/transport_client.h"
2 #include "opensrf/generic_utils.h"
3 #include "opensrf/osrf_message.h"
4 #include "opensrf/osrf_app_session.h"
5 #include <time.h>
6
7 #include <signal.h>
8
9 #include <stdio.h>
10 #include <readline/readline.h>
11 #include <readline/history.h>
12
13
14 #define SRFSH_PORT 5222
15 #define COMMAND_BUFSIZE 12
16
17
18 /* shell prompt */
19 char* prompt = "srfsh# "; 
20
21 char* history_file = NULL;
22
23 int child_dead = 0;
24
25 /* true if we're pretty printing json results */
26 int pretty_print = 0;
27
28 /* our jabber connection */
29 transport_client* client = NULL; 
30
31 /* the last result we received */
32 osrf_message* last_result = NULL;
33
34 /* functions */
35 int parse_request( char* request );
36 int handle_router( char* words[] );
37 int handle_time( char* words[] );
38 int handle_request( char* words[], int relay );
39 int handle_exec(char* words[]);
40 int handle_set( char* words[]);
41 int handle_print( char* words[]);
42 int send_request( char* server, 
43                 char* method, growing_buffer* buffer, int relay );
44 int parse_error( char* words[] );
45 int router_query_servers( char* server );
46 int srfsh_client_connect();
47 int print_help();
48 char* json_printer( json* object );
49 char* tabs(int count);
50 void sig_child_handler( int s );
51
52 int load_history();
53
54
55
56