fatal_handler( "Unable to bootstrap client for requests");
}
/* --------------------------------------------- */
+ load_history();
client = osrf_system_get_transport_client();
free(req_copy);
}
+ if(history_file != NULL )
+ write_history(history_file);
free(request);
client_disconnect( client );
client_free( client );
child_dead = 1;
}
+
+int load_history() {
+
+ char* home = getenv("HOME");
+ int l = strlen(home) + 24;
+ char fbuf[l];
+
+ memset(fbuf, 0, l);
+ sprintf(fbuf,"%s/.srfsh_history",home);
+ history_file = strdup(fbuf);
+
+ if(!access(history_file, F_OK)) {
+ //set_history_length(999);
+ history_length = 999;
+ read_history(history_file);
+ }
+ return 1;
+}
+
+
int parse_error( char* words[] ) {
if( ! words )
/* shell prompt */
char* prompt = "srfsh# ";
+char* history_file = NULL;
+
int child_dead = 0;
/* true if we're pretty printing json results */
char* tabs(int count);
void sig_child_handler( int s );
+int load_history();