Fix one-off leak by allocating PropertyDialogElements on the stack
[geany-mirror.git] / tagmanager / args.h
blob49e56fb3c9c955cce2efb348cd33dd628de1c8d6
1 /*
3 * Copyright (c) 1999-2001, Darren Hiebert
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 * Defines external interface to command line argument reading.
9 */
10 #ifndef _ARGS_H
11 #define _ARGS_H
14 * INCLUDE FILES
16 #include "general.h" /* must always come first */
19 * DATA DECLARATIONS
22 typedef struct sArgs {
23 enum { ARG_NONE, ARG_STRING, ARG_ARGV, ARG_FILE } type;
24 union {
25 struct sStringArgs {
26 const char* string;
27 const char* next;
28 const char* item;
29 } stringArgs;
30 struct sArgvArgs {
31 char* const* argv;
32 char* const* item;
33 } argvArgs;
34 struct sFileArgs {
35 FILE* fp;
36 } fileArgs;
37 } u;
38 char* item;
39 boolean lineMode;
40 } Arguments;
43 * FUNCTION PROTOTYPES
45 extern Arguments* argNewFromString (const char* const string);
46 extern Arguments* argNewFromArgv (char* const* const argv);
47 extern Arguments* argNewFromFile (FILE* const fp);
48 extern Arguments* argNewFromLineFile (FILE* const fp);
49 extern char *argItem (const Arguments* const current);
50 extern boolean argOff (const Arguments* const current);
51 extern void argSetWordMode (Arguments* const current);
52 extern void argSetLineMode (Arguments* const current);
53 extern void argForth (Arguments* const current);
54 extern void argDelete (Arguments* const current);
56 #endif /* _ARGS_H */
58 /* vi:set tabstop=8 shiftwidth=4: */