2 * Copyright (c) 1995, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1995-09-27 15:03:03 quinn
8 * Modified function heads & prototypes.
10 * Revision 1.2 1995/05/16 08:51:13 quinn
11 * License, documentation, and memory fixes
13 * Revision 1.1 1995/03/27 08:35:18 quinn
14 * Created util library
15 * Added memory debugging module. Imported options-manager
17 * Revision 1.2 1994/10/04 17:47:10 adam
18 * Function options now returns arg with error option.
20 * Revision 1.1 1994/08/16 15:57:22 adam
21 * The first utility modules.
28 static int arg_no = 1;
29 static int arg_off = 0;
31 int MDF options (const char *desc, char **argv, int argc, char **arg)
39 if (argv[arg_no][0] != '-')
41 *arg = argv[arg_no++];
46 ch = argv[arg_no][arg_off++];
49 int desc_char = desc[i++];
52 { /* string argument */
56 { /* option with argument */
59 if (argv[arg_no][arg_off])
61 *arg = argv[arg_no]+arg_off;
70 *arg = argv[arg_no++];
75 else /* option with no argument */
77 if (argv[arg_no][arg_off])
88 *arg = argv[arg_no]+arg_off-1;