[BACK]Return to funmap.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/funmap.c between version 1.10 and 1.11

version 1.10, 2005/03/09 16:20:48 version 1.11, 2005/04/03 02:09:28
Line 43 
Line 43 
 #ifndef NO_HELP  #ifndef NO_HELP
         {apropos_command, "apropos",},          {apropos_command, "apropos",},
 #endif /* !NO_HELP */  #endif /* !NO_HELP */
         { auto_execute, "auto-execute", },          {auto_execute, "auto-execute", },
         {fillmode, "auto-fill-mode",},          {fillmode, "auto-fill-mode",},
         {indentmode, "auto-indent-mode",},          {indentmode, "auto-indent-mode",},
         {backchar, "backward-char",},          {backchar, "backward-char",},
Line 220 
Line 220 
         {poptobuffer, "switch-to-buffer-other-window",},          {poptobuffer, "switch-to-buffer-other-window",},
         {togglereadonly, "toggle-read-only" },          {togglereadonly, "toggle-read-only" },
         {twiddle, "transpose-chars",},          {twiddle, "transpose-chars",},
         { undo, "undo", },          {undo, "undo", },
         { undo_dump, "undo-list", },          {undo_dump, "undo-list", },
         {universal_argument, "universal-argument",},          {universal_argument, "universal-argument",},
         {upperregion, "upcase-region",},          {upperregion, "upcase-region",},
         {upperword, "upcase-word",},          {upperword, "upcase-word",},
         {showcpos, "what-cursor-position",},          {showcpos, "what-cursor-position",},
         {filewrite, "write-file",},          {filewrite, "write-file",},
         {yank, "yank",},          {yank, "yank",},
         {NULL, NULL,},          {NULL, NULL,}
 };  };
   
 void  void
Line 248 
Line 248 
         struct funmap *fn;          struct funmap *fn;
   
         if ((fn = malloc(sizeof(*fn))) == NULL)          if ((fn = malloc(sizeof(*fn))) == NULL)
                 return FALSE;                  return (FALSE);
   
         fn->fn_funct = fun;          fn->fn_funct = fun;
         fn->fn_name = fname;          fn->fn_name = fname;
         fn->fn_next = funs;          fn->fn_next = funs;
   
         funs = fn;          funs = fn;
         return TRUE;          return (TRUE);
 }  }
   
 /*  /*
Line 268 
Line 268 
   
         for (fn = funs; fn != NULL; fn = fn->fn_next) {          for (fn = funs; fn != NULL; fn = fn->fn_next) {
                 if (strcmp(fn->fn_name, fname) == 0)                  if (strcmp(fn->fn_name, fname) == 0)
                         return fn->fn_funct;                          return (fn->fn_funct);
         }          }
         return NULL;          return (NULL);
 }  }
   
 const char *  const char *
Line 280 
Line 280 
   
         for (fn = funs; fn != NULL; fn = fn->fn_next) {          for (fn = funs; fn != NULL; fn = fn->fn_next) {
                 if (fn->fn_funct == fun)                  if (fn->fn_funct == fun)
                         return fn->fn_name;                          return (fn->fn_name);
         }          }
         return NULL;          return (NULL);
 }  }
   
 /*  /*
  * list possible function name completions.   * List possible function name completions.
  */   */
 LIST *  LIST *
 complete_function_list(const char *fname, int c)  complete_function_list(const char *fname, int c)
 {  {
         struct funmap *fn;          struct funmap   *fn;
         LIST *head, *el;          LIST            *head, *el;
         int len;          int              len;
   
         len = strlen(fname);          len = strlen(fname);
         head = NULL;          head = NULL;
Line 301 
Line 301 
                 if (memcmp(fname, fn->fn_name, len) == 0) {                  if (memcmp(fname, fn->fn_name, len) == 0) {
                         if ((el = malloc(sizeof(*el))) == NULL) {                          if ((el = malloc(sizeof(*el))) == NULL) {
                                 free_file_list(head);                                  free_file_list(head);
                                 return NULL;                                  return (NULL);
                         }                          }
                         el->l_name = fn->fn_name;                          el->l_name = fn->fn_name;
                         el->l_next = head;                          el->l_next = head;
                         head = el;                          head = el;
                 }                  }
         }          }
           return (head);
         return head;  
 }  }
   
   
   

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11