| 930 | } |
| 931 | |
| 932 | static const struct cmd * |
| 933 | cmd_lookup(const char *name, int iscreate) |
| 934 | { |
| 935 | const struct cmd *p; |
| 936 | |
| 937 | for (p = cmds; p != NULL; p = p->c_next) |
| 938 | if (strcmp(name, p->c_name) == 0) { |
| 939 | if (iscreate) { |
| 940 | if (p->c_iscloneop) |
| 941 | return p; |
| 942 | } else { |
| 943 | if (!p->c_iscloneop) |
| 944 | return p; |
| 945 | } |
| 946 | } |
| 947 | return NULL; |
| 948 | } |
| 949 | |
| 950 | struct callback { |
| 951 | callback_func *cb_func; |