summaryrefslogtreecommitdiff
path: root/source3/utils/net_util.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-06-07 02:25:08 +0200
committerKai Blin <kai@samba.org>2008-06-10 09:48:21 +0200
commit255bdb26025a5025bc60637dd924f6ec71c49ee5 (patch)
tree4e2301ae2fb17a37c45b2f9d87c685ea764c74de /source3/utils/net_util.c
parentcd06703a3f382bd114ae7634cdd7c630947cf785 (diff)
downloadsamba-255bdb26025a5025bc60637dd924f6ec71c49ee5.tar.gz
samba-255bdb26025a5025bc60637dd924f6ec71c49ee5.tar.bz2
samba-255bdb26025a5025bc60637dd924f6ec71c49ee5.zip
net: Rename functable3 to functable, get rid of old functables
(This used to be commit bb7c5fc4ec77db4073d3beccf12af12910b6bd07)
Diffstat (limited to 'source3/utils/net_util.c')
-rw-r--r--source3/utils/net_util.c53
1 files changed, 2 insertions, 51 deletions
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index 695d285390..6029231d74 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -546,57 +546,8 @@ const char *net_prompt_pass(struct net_context *c, const char *user)
return pass;
}
-/*
- run a function from a function table. If not found then
- call the specified usage function
-*/
int net_run_function(struct net_context *c, int argc, const char **argv,
- struct functable *table,
- int (*usage_fn)(struct net_context *c,
- int argc, const char **argv))
-{
- int i;
-
- if (argc < 1) {
- d_printf("\nUsage: \n");
- return usage_fn(c, argc, argv);
- }
- for (i=0; table[i].funcname; i++) {
- if (StrCaseCmp(argv[0], table[i].funcname) == 0)
- return table[i].fn(c, argc-1, argv+1);
- }
- d_fprintf(stderr, "No command: %s\n", argv[0]);
- return usage_fn(c, argc, argv);
-}
-
-/*
- * run a function from a function table.
- */
-int net_run_function2(struct net_context *c, int argc, const char **argv,
- const char *whoami, struct functable2 *table)
-{
- int i;
-
- if (argc != 0) {
- for (i=0; table[i].funcname; i++) {
- if (StrCaseCmp(argv[0], table[i].funcname) == 0)
- return table[i].fn(c, argc-1, argv+1);
- }
- }
-
- d_fprintf(stderr, "Invalid command: %s %s\n", whoami,
- (argc > 0)?argv[0]:"");
- d_printf("Usage:\n");
- for (i=0; table[i].funcname != NULL; i++) {
- d_printf("%s %-15s %s\n", whoami, table[i].funcname,
- table[i].helptext);
- }
-
- return -1;
-}
-
-int net_run_function3(struct net_context *c, int argc, const char **argv,
- const char *whoami, struct functable3 *table)
+ const char *whoami, struct functable *table)
{
int i;
if (argc != 0) {
@@ -622,7 +573,7 @@ int net_run_function3(struct net_context *c, int argc, const char **argv,
return c->display_usage?0:-1;
}
-void net_display_usage_from_functable(struct functable3 *table)
+void net_display_usage_from_functable(struct functable *table)
{
int i;
for (i=0; table[i].funcname != NULL; i++) {