1816
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1816
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
1816
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
3505
|
28 #include "oct-getopt.h" |
1816
|
29 |
|
30 #include "prog-args.h" |
|
31 |
|
32 int |
|
33 prog_args::getopt (void) |
|
34 { |
|
35 if (long_opts) |
3505
|
36 return ::octave_getopt_long (xargc, xargv, short_opts, |
|
37 X_CAST (const struct option *, long_opts), 0); |
1816
|
38 else |
3505
|
39 return ::octave_getopt (xargc, xargv, short_opts); |
1816
|
40 } |
|
41 |
|
42 const char * |
|
43 prog_args::optarg (void) |
|
44 { |
|
45 return ::optarg; |
|
46 } |
|
47 |
|
48 int |
|
49 prog_args::optind (void) |
|
50 { |
|
51 return ::optind; |
|
52 } |
|
53 |
|
54 // This is intended to communicate to getopt that it is supposed to |
|
55 // start over on the next call, but it may not be portable. See the |
|
56 // comments in getopt.c for more information. |
|
57 |
|
58 void |
|
59 prog_args::init (void) |
|
60 { |
|
61 ::optind = 0; |
|
62 } |
|
63 |
|
64 /* |
|
65 ;;; Local Variables: *** |
|
66 ;;; mode: C++ *** |
|
67 ;;; End: *** |
|
68 */ |