Diff for /libaitcli/src/aitcli.c between versions 1.2.2.7 and 1.2.2.8

version 1.2.2.7, 2010/06/07 11:54:00 version 1.2.2.8, 2010/06/07 12:30:28
Line 384  bufDEL(int idx, void * __restrict buffer) Line 384  bufDEL(int idx, void * __restrict buffer)
         return RETCODE_OK;          return RETCODE_OK;
 }  }
   
   static int
   bufComp(int idx, void * __restrict buffer)
   {
           linebuffer_t *buf = buffer;
   
           if (!buffer || idx < 0 || idx > MAX_BINDKEY)
                   return RETCODE_ERR;
   
           return RETCODE_OK;
   }
   
   static int
   bufHelp(int idx, void * __restrict buffer)
   {
           linebuffer_t *buf = buffer;
   
           if (!buffer || idx < 0 || idx > MAX_BINDKEY)
                   return RETCODE_ERR;
   
           cli_Cmd_Help(buf, -1, NULL);
           printfCR(buf, 1);
           return RETCODE_OK;
   }
   
 // ---------------------------------------------------------------  // ---------------------------------------------------------------
   
 /*  /*
Line 856  cliInit(int fin, int fout, const char *prompt) Line 880  cliInit(int fin, int fout, const char *prompt)
   
         /* add helper functions */          /* add helper functions */
         cli_addCommand(buffer, "exit", 0, cli_Cmd_Exit, "exit <cr>", "Exit from console");          cli_addCommand(buffer, "exit", 0, cli_Cmd_Exit, "exit <cr>", "Exit from console");
           cli_addCommand(buffer, "help", 0, cli_Cmd_Help, "help [command] <cr>", "Help screen");
   
         /* fill key bindings */          /* fill key bindings */
         // ascii chars & ctrl+chars          // ascii chars & ctrl+chars
Line 875  cliInit(int fin, int fout, const char *prompt) Line 900  cliInit(int fin, int fout, const char *prompt)
                         keys[i].key_func = bufBEGIN;                          keys[i].key_func = bufBEGIN;
                 if (i == *K_CTRL_E)                  if (i == *K_CTRL_E)
                         keys[i].key_func = bufEND;                          keys[i].key_func = bufEND;
                   if (i == *K_TAB)
                           keys[i].key_func = bufComp;
                 if (i >= *K_SPACE && i < *K_BACKSPACE)                  if (i >= *K_SPACE && i < *K_BACKSPACE)
                         keys[i].key_func = bufCHAR;                          keys[i].key_func = bufCHAR;
                 if (i > *K_BACKSPACE && i < 0xff)                  if (i > *K_BACKSPACE && i < 0xff)
                         keys[i].key_func = bufCHAR;                          keys[i].key_func = bufCHAR;
                   if (i == '?')
                           keys[i].key_func = bufHelp;
         }          }
         // alt+chars          // alt+chars
         for (i = 256; i < 512; i++) {          for (i = 256; i < 512; i++) {
Line 1152  cliNetLoop(linebuffer_t * __restrict buffer, const cha Line 1181  cliNetLoop(linebuffer_t * __restrict buffer, const cha
                 case 0:                  case 0:
                         close(sock);                          close(sock);
   
//                      buffer = cliInit(STDIN_FILENO, STDOUT_FILENO, csPrompt);                        if (buffer) {
//                        if (!buffer)                                ret = cliLoop(buffer, csHistFile) < 0 ? 1 : 0;
//                              return RETCODE_ERR;                                cliEnd(buffer);
                         } else
                                 cli_SetErr(EINVAL, "Error:: invalid input parameters ...");
   
                         ret = cliLoop(buffer, csHistFile) < 0 ? 1 : 0;  
   
 //                      cliEnd(buffer);  
   
                         /* spawn Shell mode */                          /* spawn Shell mode */
                         /*                          /*
                         execl("/bin/tcsh", "tcsh", NULL);                          execl("/bin/tcsh", "tcsh", NULL);
Line 1254  cliLoop(linebuffer_t * __restrict buffer, const char * Line 1281  cliLoop(linebuffer_t * __restrict buffer, const char *
         struct tagCommand *cmd;          struct tagCommand *cmd;
   
         /*          /*
         inline int inline_help()  
         {  
                 cli_Cmd_Help(cmdList ? cmdList : cli_stdCmds, -1, out, NULL);  
                 rl_on_new_line();  
                 return 0;  
         }  
   
         char **cli_stdCompletion(const char *text, int start, int end)          char **cli_stdCompletion(const char *text, int start, int end)
         {          {

Removed from v.1.2.2.7  
changed lines
  Added in v.1.2.2.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>