d6d97b07d2964c9396791fb7c77b0bdb6c2b2479
[captive.git] / src / libcaptive / include / captive / options.h
1 /* $Id$
2  * Include file with captive_options definition of libcaptive
3  * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #ifndef _CAPTIVE_CLIENT_OPTIONS_H
21 #define _CAPTIVE_CLIENT_OPTIONS_H 1
22
23
24 #include <glib/gtypes.h>
25 #include <glib/giochannel.h>
26 #include <popt.h>
27 #include <glib/glist.h>
28 #include "captive/options-module.h"
29 #include "captive/captivemodid.h"
30
31
32 G_BEGIN_DECLS
33
34 extern const struct poptOption captive_popt[];
35 #define CAPTIVE_POPT_INCLUDE \
36                 { NULL,'\0',POPT_ARG_INCLUDE_TABLE,(struct poptOption *)&captive_popt,0,"Captive" }
37
38
39 enum captive_option_rwmode {
40         CAPTIVE_OPTION_RWMODE_RO,
41         CAPTIVE_OPTION_RWMODE_BLIND,
42         CAPTIVE_OPTION_RWMODE_RW,
43         };
44 typedef
45                 enum captive_option_rwmode captive_option_rwmode_t;
46
47 enum captive_option_media {
48         CAPTIVE_OPTION_MEDIA_UNKNOWN,
49         CAPTIVE_OPTION_MEDIA_CDROM,
50         CAPTIVE_OPTION_MEDIA_DISK,
51         };
52
53 struct captive_options {
54         struct captive_options_module filesystem;
55         enum captive_option_rwmode rwmode;
56         enum captive_option_media media;
57         gboolean debug_messages;
58         GIOChannel *image_iochannel;
59         GList *load_module;     /* of 'struct captive_options_module *' */
60         gboolean sandbox;
61         char **sandbox_server_argv;
62         gchar *sandbox_server_ior;
63         gchar *bug_pathname;
64         int syslog_facility;    /* LOG_*; -1 if not used */
65         CaptiveCaptivemodidObject *captivemodid;
66         gboolean load_untested;
67         };
68
69 /**
70  * captive_options:
71  *
72  * Current options set in one CORBA sandboxed child.
73  * It is also set when run in non-CORBA debugging mode.
74  * Set to %NULL in the CORBA master process.
75  */
76 extern struct captive_options *captive_options;
77
78 /* Functions handle just the fields, not the structure itself. */
79 void captive_options_init(struct captive_options *options);
80 void captive_options_copy(struct captive_options *dest,const struct captive_options *src);
81 void captive_options_free(struct captive_options *options);
82 gboolean captive_options_parse(struct captive_options *options,const gchar *captive_args);
83
84 G_END_DECLS
85
86
87 #endif /* _CAPTIVE_CLIENT_OPTIONS_H */