cmd: Split up dispatch function
[openafs.git] / src / cmd / cmd.p.h
index d850032..ab81211 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -51,8 +51,8 @@ struct cmd_syndesc {
     char *name;                        /* subcommand name */
     char *a0name;              /* command name from argv[0] */
     char *help;                        /* help description */
-    int (*proc) (struct cmd_syndesc * ts, char *arock);
-    char *rock;
+    int (*proc) (struct cmd_syndesc * ts, void *arock);
+    void *rock;
     int nParms;                        /* number of parms */
     afs_int32 flags;           /* random flags */
     struct cmd_parmdesc parms[CMD_MAXPARMS];   /* parms themselves */
@@ -60,14 +60,14 @@ struct cmd_syndesc {
 
 extern struct cmd_syndesc *cmd_CreateSyntax(char *namep,
                                            int (*aprocp) (struct cmd_syndesc
-                                                          * ts, char *arock),
-                                           char *rockp, char *helpp);
+                                                          * ts, void *arock),
+                                           void *rockp, char *helpp);
 extern int
-  cmd_SetBeforeProc(int (*aproc) (struct cmd_syndesc * ts, char *beforeRock),
-                   char *arock);
+  cmd_SetBeforeProc(int (*aproc) (struct cmd_syndesc * ts, void *beforeRock),
+                   void *arock);
 extern int
-  cmd_SetAfterProc(int (*aproc) (struct cmd_syndesc * ts, char *afterRock),
-                  char *arock);
+  cmd_SetAfterProc(int (*aproc) (struct cmd_syndesc * ts, void *afterRock),
+                  void *arock);
 extern int cmd_CreateAlias(struct cmd_syndesc *as, char *aname);
 extern int cmd_Seek(struct cmd_syndesc *as, int apos);
 extern int cmd_AddParm(struct cmd_syndesc *as, char *aname, int atype,
@@ -76,8 +76,13 @@ extern int cmd_Dispatch(int argc, char **argv);
 extern int cmd_FreeArgv(char **argv);
 extern int cmd_ParseLine(char *aline, char **argv, afs_int32 * an,
                         afs_int32 amaxn);
-extern int cmd_IsAdministratorCommand(register struct cmd_syndesc *as);
-extern void PrintSyntax(register struct cmd_syndesc *as);
-extern void PrintFlagHelp(register struct cmd_syndesc *as);
+extern int cmd_IsAdministratorCommand(struct cmd_syndesc *as);
+extern void cmd_DisablePositionalCommands(void);
+extern void cmd_DisableAbbreviations(void);
+extern void PrintSyntax(struct cmd_syndesc *as);
+extern void PrintFlagHelp(struct cmd_syndesc *as);
+
+extern int cmd_Parse(int argc, char **argv, struct cmd_syndesc **outsyntax);
+extern void cmd_FreeOptions(struct cmd_syndesc **ts);
 
 #endif /* __CMD_INCL__ */