PageRenderTime 25ms CodeModel.GetById 18ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Doc/Devel/cmdopt.html

#
HTML | 79 lines | 55 code | 24 blank | 0 comment | 0 complexity | 1cb6be66a7722521871f49e15201b045 MD5 | raw file
 1<html>
 2<head>
 3<title>SWIG Command Line Handling</title>
 4</head>
 5
 6<body>
 7<center>
 8<h1>SWIG Command Line Handling</h1>
 9
10<p>
11David M. Beazley <br>
12dave-swig@dabeaz.com<br>
13December, 2006<br>
14
15</b>
16</center>
17
18<h2>Introduction</h2>
19
20This document describes the functions related to the handling of
21command line options passed to SWIG. These functions are defined in
22the header file <tt>Source/Swig/swigopt.h</tt>.  This API is
23considered to be stable.
24
25<h2>Initialization</h2>
26
27Upon SWIG startup, the following function is called:
28
29<p>
30<b><tt>void Swig_init_args(int argc, char **argv_)</tt></b>
31
32<blockquote>
33Registers command line options with the SWIG core.  This creates an internal array that is used by other
34functions to mark whether or not a particular command line option was used.  This is ultimately used to issue error messages about unused or unknown command line options.   This function is currently invoked in the SWIG main() function that is found in <tt>Source/Modules/swigmain.cxx</tt>.
35</blockquote>
36
37<h2>Argument Marking</h2>
38
39As command line options are processed by language modules, the following functions are used
40to mark the arguments as used:
41
42<p>
43<b><tt>void Swig_mark_arg(int n)</tt></b>
44<blockquote>
45Mark argument number <tt>n</tt> as used. 
46</blockquote>
47
48<p>
49<b><tt>int Swig_check_marked(int n)</tt></b>
50<blockquote>
51Check to see if argument <tt>n</tt> has been marked.  Returns 0 or 1.
52</blockquote>
53
54<h2>Argument Checking</h2>
55
56The following function is used to check all of the command line options after parsing.  It looks at the marked list
57and issues an error message if any unconsumed arguments are found.
58
59<p>
60<b><tt>void Swig_check_options()</tt></b>
61<blockquote>
62Checks all command line options to see if they have all been processed.  If not, an error message is generated and
63execution terminates with a call to <tt>exit()</tt>.   This function is currently invoked in <tt>Source/Modules/main.cxx</tt> just before SWIG starts any processing of input files.
64</blockquote>
65
66<h2>Utility Function</h2>
67<p>
68<b><tt>void Swig_arg_error())</tt></b>
69
70<blockquote>
71A generic function that issues an error message about being unable to parse command line options.  SWIG is terminated by a call to <tt>exit()</tt>.
72
73</body>
74</html>
75
76
77
78
79