2 * Include file for client cmdline interface control functions for libcaptive
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
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
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.
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
20 #ifndef _CAPTIVE_CLIENT_CMDLINE_MAIN_H
21 #define _CAPTIVE_CLIENT_CMDLINE_MAIN_H 1
24 #include <glib/gtypes.h>
25 #include <libgnomevfs/gnome-vfs-result.h>
26 #include <captive/client-vfs.h>
29 #define CMDLINE_MAIN_ERROR (cmdline_main_error_quark())
30 GQuark cmdline_main_error_quark(void);
33 CMDLINE_MAIN_ERROR_UNKNOWN_COMMAND,
34 CMDLINE_MAIN_ERROR_INVALID_COMMAND_ARGUMENTS,
35 CMDLINE_MAIN_ERROR_READING_COMMAND_CONFIG,
36 CMDLINE_MAIN_ERROR_EXCEEDING_COMMAND_OPTION,
37 CMDLINE_MAIN_ERROR_INVALID_COMMAND_ARGUMENT_COUNT,
38 CMDLINE_MAIN_ERROR_GENERIC_ERROR
42 struct cmdline_command {
43 const gchar *name,*description;
44 const struct poptOption *table;
45 void (*func)(const char **cmd_argv,GError **errp);
46 gint argsn_min,argsn_max;
49 extern const struct cmdline_command cmdline_command_table[];
52 extern CaptiveVfsObject *cmdline_captive_vfs_object;
55 void invoke_cmd(int cmd_argc,const char **cmd_argv);
56 void err_cleanup(GError **errp);
57 gboolean errvfsresult_to_gerr(GError **errp,GnomeVFSResult errvfsresult);
61 #endif /* _CAPTIVE_CLIENT_CMDLINE_MAIN_H */