Changeset eb6cedc for cmd.c


Ignore:
Timestamp:
Jul 17, 2009, 11:52:30 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
96f7b07
Parents:
b4ef908
git-author:
Nelson Elhage <nelhage@mit.edu> (07/17/09 23:31:14)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/17/09 23:52:30)
Message:
Push commands into BarnOwl:: instead of AUTOLOAD'ing them
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    rc4ba74d reb6cedc  
    2727int owl_cmddict_add_from_list(owl_cmddict *cd, owl_cmd *cmds) {
    2828  owl_cmd *cur, *cmd;
    29   for (cur = cmds; cur->name != NULL; cur++) { 
    30     cmd = owl_malloc(sizeof(owl_cmd));
    31     owl_cmd_create_from_template(cmd, cur);
    32     owl_dict_insert_element(cd, cmd->name, (void*)cmd, NULL);
    33   }
    34   return 0;
     29  int ret = 0;
     30  for (cur = cmds; cur->name != NULL; cur++) {
     31    ret = owl_cmddict_add_cmd(cd, cur);
     32    if (ret < 0) break;
     33  }
     34  return ret;
    3535}
    3636
     
    6363    return -1;
    6464  }
    65   owl_function_debugmsg("Add cmd %s", cmd->name);
     65  owl_perlconfig_new_command(cmd->name);
    6666  return owl_dict_insert_element(cd, newcmd->name, (void*)newcmd, (void(*)(void*))owl_cmd_free);
    6767}
Note: See TracChangeset for help on using the changeset viewer.