| 1 |
/* |
| 2 |
* Copyright (c) 2003-2005 RIKEN Japan, All rights reserved. |
| 3 |
* |
| 4 |
* Redistribution and use in source and binary forms, with or without |
| 5 |
* modification, are permitted provided that the following conditions |
| 6 |
* are met: |
| 7 |
* |
| 8 |
* 1. Redistributions of source code must retain the above copyright |
| 9 |
* notice, this list of conditions and the following disclaimer. |
| 10 |
* |
| 11 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 12 |
* notice, this list of conditions and the following disclaimer in the |
| 13 |
* documentation and/or other materials provided with the distribution. |
| 14 |
* |
| 15 |
* THIS SOFTWARE IS PROVIDED BY RIKEN AND CONTRIBUTORS ``AS IS'' AND ANY |
| 16 |
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 18 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RIKEN OR CONTRIBUTORS BE |
| 19 |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 |
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 25 |
* THE POSSIBILITY OF SUCH DAMAGE. |
| 26 |
*/ |
| 27 |
|
| 28 |
/* $Id: main.cpp,v 1.1.1.1 2004/03/31 08:15:07 orrisroot Exp $ */ |
| 29 |
|
| 30 |
#ifdef HAVE_CONFIG_H |
| 31 |
# include "config.h" |
| 32 |
#endif |
| 33 |
|
| 34 |
#include <stdio.h> |
| 35 |
#ifdef HAVE_UNISTD_H |
| 36 |
# include <unistd.h> |
| 37 |
#endif |
| 38 |
#ifdef HAVE_SIGNAL_H |
| 39 |
# include <signal.h> |
| 40 |
#endif |
| 41 |
|
| 42 |
#include "shell/satellite4.h" |
| 43 |
#include "termios_console.h" |
| 44 |
|
| 45 |
/* test code for symbol list event callback */ |
| 46 |
/* void symlist_var_event_callback(int event, symbol_t *sym){ */ |
| 47 |
/* switch(event){ */ |
| 48 |
/* case SYMLIST_EVENT_ADD: */ |
| 49 |
/* printf("symbol list add -> %s\n", sym->name); */ |
| 50 |
/* break; */ |
| 51 |
/* case SYMLIST_EVENT_DELETE: */ |
| 52 |
/* printf("symbol list delete -> %s\n", sym->name); */ |
| 53 |
/* break; */ |
| 54 |
/* } */ |
| 55 |
/* } */ |
| 56 |
|
| 57 |
/* test code for module event callback */ |
| 58 |
/* void module_event_callback(int event, module_t *mod){ */ |
| 59 |
/* switch(event){ */ |
| 60 |
/* case MODULE_EVENT_NEW: */ |
| 61 |
/* printf("module new\n"); */ |
| 62 |
/* break; */ |
| 63 |
/* case MODULE_EVENT_LOAD: */ |
| 64 |
/* printf("module load -> %s (%d:commands)\n", */ |
| 65 |
/* mod->module_name, mod->commands->nkeys); */ |
| 66 |
/* break; */ |
| 67 |
/* case MODULE_EVENT_UNLOAD: */ |
| 68 |
/* printf("module unload -> %s (%d:commands)\n", */ |
| 69 |
/* mod->module_name,mod->commands->nkeys); */ |
| 70 |
/* break; */ |
| 71 |
/* case MODULE_EVENT_DELETE: */ |
| 72 |
/* printf("module delete -> %s\n", mod->module_name); */ |
| 73 |
/* break; */ |
| 74 |
/* } */ |
| 75 |
/* } */ |
| 76 |
|
| 77 |
// void print_object_num(); |
| 78 |
// void print_series_buffer_num(); |
| 79 |
// void print_scalar_buffer_num(); |
| 80 |
// void print_string_buffer_num(); |
| 81 |
// void print_builtin_buffer_num(); |
| 82 |
// void print_buffer_num(); |
| 83 |
|
| 84 |
int main(int argc,char *argv[]){ |
| 85 |
sl_shell *pshell; |
| 86 |
tty_console *console; |
| 87 |
console = new termios_console; |
| 88 |
pshell = new sl_shell(console); |
| 89 |
if(pshell->initialize(argc,argv)) { |
| 90 |
/***** test code for symbol event callback *****/ |
| 91 |
/* symlist_set_var_callback(symlist_var_event_callback); */ |
| 92 |
/***** test code for module event callback *****/ |
| 93 |
/* module_set_callback(module_event_callback); */ |
| 94 |
/* Main loop */ |
| 95 |
pshell->shell_main(); |
| 96 |
} else { |
| 97 |
console->tty_printf("%s : fatal error - %s\n", argv[0], |
| 98 |
pshell->get_last_error()); |
| 99 |
} |
| 100 |
delete pshell; |
| 101 |
delete console; |
| 102 |
// print_object_num(); |
| 103 |
// print_buffer_num(); |
| 104 |
// print_series_buffer_num(); |
| 105 |
// print_scalar_buffer_num(); |
| 106 |
// print_string_buffer_num(); |
| 107 |
// print_builtin_buffer_num(); |
| 108 |
return 0; |
| 109 |
} |