gpe-expenses  0.1.9
qof-main.h
Go to the documentation of this file.
1 /***************************************************************************
2  * qof-main.h
3  *
4  * This is an auto-generated file. Patches are available from
5  * http://qof-gen.sourceforge.net/
6  * For QOF 0.7.0, using QofTime.
7  *
8  * Thu Jan 13 12:15:41 2005
9  * Copyright 2005-2009 Neil Williams
10  * linux@codehelp.co.uk
11  ****************************************************************************/
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  */
51 #ifndef _QOF_MAIN_H
52 #define _QOF_MAIN_H
53 
70 void qof_main_wrap_line (FILE * fp, gint indent,
71  const gchar * template_str, ...)
72  __attribute__ ((format (printf, 3, 4)));
73 
75 #define ERR_INDENT strlen(PACKAGE) + 2
76 
93 GSList*
94 qof_main_get_param_list(QofIdTypeConst object_type, QofType param_type);
95 
100 #define QOF_DATE_STRING_LENGTH MAX_DATE_LENGTH
101 
103 #define QOF_MAIN_CLI "QOF-mod-command-line"
104 
118 #define CATEGORY_NAME "category"
119 
127 #define QSF_COMPRESS "compression_level"
128 
130 #define QSF_ENCODING "encoding_string"
131 
133 #define QSF_DATE_CONVERT "convert_date_to_time"
134 
159 #define QOF_SQL_SUPPORTED "^SELECT|INSERT"
160 
178 glong
180 
191 void qof_main_show_error (QofSession * session);
192 
198 typedef struct QofMain_s
199 {
201  gchar *filename;
203  gchar *write_file;
205  gchar *input_file;
207  gchar *sql_file;
210  gchar *sql_str;
212  gchar *database;
214  gchar *exclude;
216  gchar *category;
219  QofTime *min_qt;
222  QofTime *max_qt;
224  QofSession *input_session;
226  QofSession *export_session;
228  gboolean error;
230  QofQuery *query;
234  gint64 gz_level;
236  const gchar *encoding;
239  gint64 convert;
241  QofType param_type;
243 
245 void qof_main_free (QofMainContext * context);
246 
248 void qof_cmd_xmlfile (QofMainContext * context);
249 
255 void qof_cmd_list (void);
256 
263 void
264 qof_mod_category (const gchar * category, QofMainContext * data);
265 
272 void
273 qof_mod_database (const gchar * database, QofMainContext * data);
274 
302 void
303 qof_mod_time (const gchar * date_time, QofMainContext * data);
304 
309 void
310 qof_mod_exclude (const gchar * exclude, QofMainContext * data);
311 
351 void
352 qof_mod_sql (const gchar * sql_query, QofMainContext * data);
353 
362 void
363 qof_mod_sql_file (const gchar * sql_file, QofMainContext * data);
364 
369 void
370 qof_mod_write (const gchar * write_file, QofMainContext * data);
371 
378 void
379 qof_mod_compression (gint64 gz_level, QofMainContext * context);
380 
382 void
383 qof_mod_encoding (const gchar * encoding, QofMainContext * context);
384 
386 void
387 qof_mod_convert_deprecated (gint64 convert, QofMainContext * context);
388 
398 void qof_main_moderate_query (QofMainContext * context);
399 
405 void qof_cmd_explain (QofMainContext * context);
406 
407 void qof_main_select (QofMainContext * context);
408 
418 /* Translators: ignore the above comment - gettext is just being greedy. */
419 #define QOF_CLI_OPTIONS POPT_AUTOHELP \
420  {"list", 'l', POPT_ARG_NONE, NULL, qof_op_list, \
421  _("List all databases supported by the current QOF framework " \
422  "and exit."), NULL}, \
423  {"explain", 0, POPT_ARG_NONE, NULL, qof_op_explain, \
424  _("List the fields within the specified database and " \
425  "exit, requires -d."), NULL}, \
426  {"xml-file", 'x', POPT_ARG_STRING, &filename, qof_op_offline, \
427  _("Query the QSF XML data in <filename>"), \
428  "filename"}, \
429  {"date", 't', POPT_ARG_STRING, &date_time, qof_op_time, \
430  _("Shorthand to only query objects that contain the " \
431  "specified date."), "string"}, \
432  {"database", 'd', POPT_ARG_STRING, &database, qof_op_database, \
433  _("Shorthand to only query objects within a specific " \
434  "supported database. "), "string"}, \
435  {"exclude", 'e', POPT_ARG_STRING, &exclude, qof_op_exclude, \
436  _("Shorthand to exclude a supported database from the query."), \
437  "string"}, \
438  {"sql", 's', POPT_ARG_STRING, &sql_query, qof_op_sql, \
439  _("Specify a SQL query on the command line."), "string"}, \
440  {"sql-file", 'f', POPT_ARG_STRING, &sql_file, qof_op_sql_file, \
441  _("Specify one or more SQL queries contained in a file."), \
442  "filename"}, \
443  {"write", 'w', POPT_ARG_STRING, &write_file, qof_op_write, \
444  _("Write the results of any query to the file"), "filename"}, \
445  {"compress", 0, POPT_ARG_INT, &gz_level, qof_op_compress, \
446  _("Compress output files, 0 for none, 9 for maximum"), "integer"}, \
447  {"debug", 0, POPT_ARG_NONE, NULL, qof_op_debug, \
448  _("Print debugging information to a temporary file."), NULL}, \
449  {"version", 0, POPT_ARG_NONE, NULL, qof_op_vers, \
450  _("Display version information"), NULL}, \
451  {"category", 'c', POPT_ARG_STRING, &category, qof_op_category, \
452  _("Shorthand to only query objects that are set to the specified category."), \
453  "string"},
454 
456 #define QOF_MAIN_OP \
457  _(qof_op_noop, = 0) \
458  _(qof_op_list,) \
459  _(qof_op_xmlfile,) \
460  _(qof_op_category,) \
461  _(qof_op_database,) \
462  _(qof_op_time,) \
463  _(qof_op_exclude,) \
464  _(qof_op_sql,) \
465  _(qof_op_sql_file,) \
466  _(qof_op_write, ) \
467  _(qof_op_explain,) \
468  _(qof_op_vers,) \
469  _(qof_op_compress,) \
470  _(qof_op_debug,)
471 
477 #define QOF_OP_VARS \
478  const gchar *date_time, *category, *database; \
479  const gchar *sql_file, *write_file, *sql_query, *filename;
480 
485 #define QOF_OP_INIT \
486  category = NULL; \
487  database = NULL; \
488  sql_file = NULL; \
489  write_file = NULL; \
490  sql_query = NULL; \
491  filename = NULL;
492 
496 #endif /* _QOF_MAIN_H */