--- /dev/null
+# $Id$
+# automake source for sandbox filesystem sandbox server
+# Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+include $(top_srcdir)/Makefile-head.am
+
+captive_sandbox_server_SOURCES= \
+ main.c
+captive_sandbox_server_LDADD=$(captive_library) $(INTLLIBS)
+sbin_PROGRAMS+=captive-sandbox-server
--- /dev/null
+/* $Id$
+ * filesystem sandbox server stub for libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include "config.h"
+
+#include <glib/gmessages.h>
+#include <stdlib.h>
+#include <glib/giochannel.h>
+#include <glib/gerror.h>
+#include <popt.h>
+#include <string.h>
+#include <stdio.h>
+#include <locale.h>
+#include "captive/options.h"
+#include <glib-object.h>
+
+
+GQuark sandbox_server_main_error_quark(void)
+{
+GQuark r=0;
+
+ if (!r)
+ r=g_quark_from_static_string("sandbox-server");
+
+ return r;
+}
+
+
+static const struct poptOption popt_table[]={
+ CAPTIVE_POPT_INCLUDE,
+ POPT_AUTOHELP
+ POPT_TABLEEND
+ };
+
+
+int main(int argc,char **argv)
+{
+poptContext context;
+int errint;
+const char *cmd_arg;
+struct captive_options options;
+
+ /* Initialize the i18n stuff */
+ setlocale(LC_ALL,"");
+ bindtextdomain(PACKAGE,LOCALEDIR);
+ textdomain(PACKAGE);
+
+ /* Initialize GObject subsystem of GLib. */
+ g_type_init();
+
+ captive_options_init(&options);
+ captive_options=&options; /* for parsing by 'CAPTIVE_POPT_INCLUDE' */
+
+ context=poptGetContext(
+ PACKAGE, /* name */
+ argc,(/*en-const*/const char **)argv, /* argc,argv */
+ popt_table, /* options */
+ POPT_CONTEXT_POSIXMEHARDER); /* flags; && !POPT_CONTEXT_KEEP_FIRST */
+ if (context==NULL) {
+ g_assert_not_reached(); /* argument recognization args_error */
+ return EXIT_FAILURE;
+ }
+ errint=poptReadDefaultConfig(context,
+ TRUE); /* useEnv */
+ if (errint!=0) {
+ g_assert_not_reached(); /* argument recognization args_error */
+ return EXIT_FAILURE;
+ }
+ errint=poptGetNextOpt(context);
+ if (errint!=-1) {
+ g_assert_not_reached(); /* some non-callbacked argument reached */
+ return EXIT_FAILURE;
+ }
+ cmd_arg=poptPeekArg(context);
+ if (cmd_arg) {
+ g_assert_not_reached(); /* some non-option argument reached */
+ return EXIT_FAILURE;
+ }
+ /* 'cmd_arg'-style args gets cleared by 'poptFreeContext(context);' below */
+ poptFreeContext(context);
+
+ captive_options=NULL; /* already parsed by 'CAPTIVE_POPT_INCLUDE' */
+
+ captive_corba_sandbox_child();
+
+ g_assert_not_reached();
+ return EXIT_SUCCESS;
+}