Index: trunk/Ohana/src/opihi/cmd.basic/init.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 16211)
+++ trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 16426)
@@ -13,22 +13,22 @@
 int file            PROTO((int, char **));
 int getchr_func     PROTO((int, char **));
-int help       	    PROTO((int, char **));
-int input      	    PROTO((int, char **));
-int list       	    PROTO((int, char **));
-int list_help  	    PROTO((int, char **));
-int list_vars  	    PROTO((int, char **));
+int help            PROTO((int, char **));
+int input           PROTO((int, char **));
+int list            PROTO((int, char **));
+int list_help       PROTO((int, char **));
+int list_vars       PROTO((int, char **));
 int local           PROTO((int, char **)); /* data? */
-int macro      	    PROTO((int, char **));
+int macro           PROTO((int, char **));
 int memory          PROTO((int, char **));
-int mkdir_opihi	    PROTO((int, char **));
-int module    	    PROTO((int, char **));
-int output     	    PROTO((int, char **));
-int pwd        	    PROTO((int, char **));
-int quit       	    PROTO((int, char **));
-int run_for    	    PROTO((int, char **));
-int run_if     	    PROTO((int, char **));
-int run_while  	    PROTO((int, char **));
-int scan       	    PROTO((int, char **));
-int shell      	    PROTO((int, char **));
+int mkdir_opihi     PROTO((int, char **));
+int module          PROTO((int, char **));
+int output          PROTO((int, char **));
+int pwd             PROTO((int, char **));
+int quit            PROTO((int, char **));
+int run_for         PROTO((int, char **));
+int run_if          PROTO((int, char **));
+int run_while       PROTO((int, char **));
+int scan            PROTO((int, char **));
+int shell           PROTO((int, char **));
 int sprintf_opihi   PROTO((int, char **));
 int fprintf_opihi   PROTO((int, char **));
@@ -37,51 +37,51 @@
 int strpop          PROTO((int, char **));
 int strsub          PROTO((int, char **));
-int wait_func  	    PROTO((int, char **));
-int which      	    PROTO((int, char **));
+int wait_func       PROTO((int, char **));
+int which           PROTO((int, char **));
 
 /** mapping of the command names to command functions **/
 static Command cmds[] = {  
-  {"config",        config,             "(re)load config file?"},
-  {"sleep",         exec_sleep,         "sleep for N seconds"},
-  {"usleep",        exec_usleep,        "sleep for N microseconds"},
-  {"cd",      	    cd,                 "change directory"},
-  {"date",    	    date,               "get current date"},
-  {"dirname",       dirname_opihi,      "built-in dirname function"},
-  {"echo",    	    echo,               "type this line *"},
-  {"break",   	    exec_break,         "escape from function *"},
-  {"continue",	    exec_next,          "next loop iteration"},
-  {"next",	    exec_next,          "next loop iteration"},
-  {"last",	    exec_last,          "last loop iteration"},
-  {"return",	    exec_last,          "exit from macro"},
-  {"file",          file,               "test file existence"},
-  {"getchr",        getchr_func,        "find character in string"},
-  {"help",    	    help,               "get help on a function *"},
-  {"input",   	    input,              "read command lines from a file *"},
-  {"list",    	    list,               "get variable list"},
-  {"?",       	    list_help,          "list commands *"},
-  {"??",      	    list_vars,          "list variables *"},
-  {"local",  	    local,              "define local variables"},
-  {"macro",   	    macro,              "deal with the macros *"}, 
-  {"memory",        memory,             "long listing of the allocated memory"},
-  {"mkdir",         mkdir_opihi,        "built-in mkdir command"},
-  {"module",        module,             "load script file from the modules directories"},
-  {"output",  	    output,             "redirect output to file"},
-  {"pwd",     	    pwd,                "print current working directory"},
-  {"exit",    	    quit,               "exit program *"}, 
-  {"quit",    	    quit,               "exit program *"},
-  {"for",     	    run_for,            "for loop"}, 
-  {"if",      	    run_if,             "logical cases *"}, 
-  {"while",   	    run_while,          "while loop"}, 
-  {"scan",    	    scan,               "scan line from keyboard or file to variable *"},
-  {"!",       	    shell,              "system call"},
-  {"exec",    	    shell,              "system call"},
-  {"sprintf",       sprintf_opihi,      "formatted print to a variable"},
-  {"fprintf",       fprintf_opihi,      "formatted print to standard output"},
-  {"strlen",        strlen_func,        "string length"},
-  {"substr",        substr_func,        "substring"},
-  {"strpop",        strpop,             "pop a string"},
-  {"strsub",        strsub,             "replace instances of a key in a string"},
-  {"wait",    	    wait_func,          "wait until return is typed"},
-  {"which",   	    which,              "show command *"}
+  {1, "config",        config,             "(re)load config file?"},
+  {1, "sleep",         exec_sleep,         "sleep for N seconds"},
+  {1, "usleep",        exec_usleep,        "sleep for N microseconds"},
+  {1, "cd",            cd,                 "change directory"},
+  {1, "date",          date,               "get current date"},
+  {1, "dirname",       dirname_opihi,      "built-in dirname function"},
+  {1, "echo",          echo,               "type this line *"},
+  {1, "break",         exec_break,         "escape from function *"},
+  {1, "continue",      exec_next,          "next loop iteration"},
+  {1, "next",          exec_next,          "next loop iteration"},
+  {1, "last",          exec_last,          "last loop iteration"},
+  {1, "return",        exec_last,          "exit from macro"},
+  {1, "file",          file,               "test file existence"},
+  {1, "getchr",        getchr_func,        "find character in string"},
+  {1, "help",          help,               "get help on a function *"},
+  {1, "input",         input,              "read command lines from a file *"},
+  {1, "list",          list,               "get variable list"},
+  {1, "?",             list_help,          "list commands *"},
+  {1, "??",            list_vars,          "list variables *"},
+  {1, "local",         local,              "define local variables"},
+  {1, "macro",         macro,              "deal with the macros *"}, 
+  {1, "memory",        memory,             "long listing of the allocated memory"},
+  {1, "mkdir",         mkdir_opihi,        "built-in mkdir command"},
+  {1, "module",        module,             "load script file from the modules directories"},
+  {1, "output",        output,             "redirect output to file"},
+  {1, "pwd",           pwd,                "print current working directory"},
+  {1, "exit",          quit,               "exit program *"}, 
+  {1, "quit",          quit,               "exit program *"},
+  {1, "for",           run_for,            "for loop"}, 
+  {1, "if",            run_if,             "logical cases *"}, 
+  {1, "while",         run_while,          "while loop"}, 
+  {1, "scan",          scan,               "scan line from keyboard or file to variable *"},
+  {1, "!",             shell,              "system call"},
+  {1, "exec",          shell,              "system call"},
+  {1, "sprintf",       sprintf_opihi,      "formatted print to a variable"},
+  {1, "fprintf",       fprintf_opihi,      "formatted print to standard output"},
+  {1, "strlen",        strlen_func,        "string length"},
+  {1, "substr",        substr_func,        "substring"},
+  {1, "strpop",        strpop,             "pop a string"},
+  {1, "strsub",        strsub,             "replace instances of a key in a string"},
+  {1, "wait",          wait_func,          "wait until return is typed"},
+  {1, "which",         which,              "show command *"}
 };
 
@@ -125,2 +125,12 @@
   }
 }
+
+void FreeBasic () {
+
+  FreeCommands ();
+  FreeMacros ();
+  FreeBuffers ();
+  FreeVectors ();
+  FreeVariables ();
+  FreeLists ();
+}
