Merge commit 'git-svn'
[anjuta-git-plugin.git] / tagmanager / args.h
blob606914656e1fcb84e590573761c6b585b0268cc6
1 /*
2 * $Id$
4 * Copyright (c) 1999-2002, Darren Hiebert
6 * This source code is released for free distribution under the terms of the
7 * GNU General Public License.
9 * Defines external interface to command line argument reading.
11 #ifndef _ARGS_H
12 #define _ARGS_H
15 * INCLUDE FILES
17 #include "general.h" /* must always come first */
19 #include <stdio.h>
22 * DATA DECLARATIONS
25 typedef enum { ARG_NONE, ARG_STRING, ARG_ARGV, ARG_FILE } argType;
27 typedef struct sArgs {
28 argType type;
29 union {
30 struct sStringArgs {
31 const char* string;
32 const char* next;
33 const char* item;
34 } stringArgs;
35 struct sArgvArgs {
36 char* const* argv;
37 char* const* item;
38 } argvArgs;
39 struct sFileArgs {
40 FILE* fp;
41 } fileArgs;
42 } u;
43 char* item;
44 boolean lineMode;
45 } Arguments;
48 * FUNCTION PROTOTYPES
50 extern Arguments* argNewFromString (const char* const string);
51 extern Arguments* argNewFromArgv (char* const* const argv);
52 extern Arguments* argNewFromFile (FILE* const fp);
53 extern Arguments* argNewFromLineFile (FILE* const fp);
54 extern char *argItem (const Arguments* const current);
55 extern boolean argOff (const Arguments* const current);
56 extern void argSetWordMode (Arguments* const current);
57 extern void argSetLineMode (Arguments* const current);
58 extern void argForth (Arguments* const current);
59 extern void argDelete (Arguments* const current);
61 #endif /* _ARGS_H */
63 /* vi:set tabstop=4 shiftwidth=4: */