mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
Remove most global variables
2008-03-11 Johan Dahlin <johan@gnome.org> * tools/compiler.c: * tools/generate.c: Remove most global variables svn path=/trunk/; revision=153
This commit is contained in:
@@ -30,15 +30,7 @@
|
|||||||
#include "gmetadata.h"
|
#include "gmetadata.h"
|
||||||
#include "gidlcompilercontext.h"
|
#include "gidlcompilercontext.h"
|
||||||
|
|
||||||
gboolean no_init = FALSE;
|
static GLogLevelFlags logged_levels;
|
||||||
gchar **input = NULL;
|
|
||||||
gchar *output = NULL;
|
|
||||||
gchar *mname = NULL;
|
|
||||||
gchar *shlib = NULL;
|
|
||||||
gboolean debug = FALSE;
|
|
||||||
gboolean verbose = FALSE;
|
|
||||||
|
|
||||||
GLogLevelFlags logged_levels;
|
|
||||||
|
|
||||||
static void log_handler (const gchar *log_domain,
|
static void log_handler (const gchar *log_domain,
|
||||||
GLogLevelFlags log_level,
|
GLogLevelFlags log_level,
|
||||||
@@ -50,30 +42,43 @@ static void log_handler (const gchar *log_domain,
|
|||||||
g_log_default_handler (log_domain, log_level, message, user_data);
|
g_log_default_handler (log_domain, log_level, message, user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GOptionEntry options[] =
|
|
||||||
{
|
|
||||||
{ "no-init", 0, 0, G_OPTION_ARG_NONE, &no_init, "do not create _init() function", NULL },
|
|
||||||
{ "output", 'o', 0, G_OPTION_ARG_FILENAME, &output, "output file", "FILE" },
|
|
||||||
{ "module", 'm', 0, G_OPTION_ARG_STRING, &mname, "module to compile", "NAME" },
|
|
||||||
{ "shared-library", 'l', 0, G_OPTION_ARG_FILENAME, &shlib, "shared library", "FILE" },
|
|
||||||
{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "show debug messages", NULL },
|
|
||||||
{ "verbose", 0, 0, G_OPTION_ARG_NONE, &verbose, "show verbose messages", NULL },
|
|
||||||
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
|
|
||||||
{ NULL, }
|
|
||||||
};
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char ** argv)
|
main (int argc, char ** argv)
|
||||||
{
|
{
|
||||||
|
gboolean no_init = FALSE;
|
||||||
|
gchar **input = NULL;
|
||||||
|
gchar *output = NULL;
|
||||||
|
gchar *mname = NULL;
|
||||||
|
gchar *shlib = NULL;
|
||||||
|
gboolean debug = FALSE;
|
||||||
|
gboolean verbose = FALSE;
|
||||||
|
|
||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GList *m, *modules;
|
GList *m, *modules;
|
||||||
gint i;
|
gint i;
|
||||||
GList *c;
|
GList *c;
|
||||||
gint entry_id;
|
gint entry_id;
|
||||||
|
|
||||||
FILE *file;
|
FILE *file;
|
||||||
GIdlCompilerContext *ctx;
|
GIdlCompilerContext *ctx;
|
||||||
|
GOptionEntry options[] =
|
||||||
|
{
|
||||||
|
{ "no-init", 0, 0, G_OPTION_ARG_NONE, &no_init,
|
||||||
|
"do not create _init() function", NULL },
|
||||||
|
{ "output", 'o', 0, G_OPTION_ARG_FILENAME, &output,
|
||||||
|
"output file", "FILE" },
|
||||||
|
{ "module", 'm', 0, G_OPTION_ARG_STRING, &mname,
|
||||||
|
"module to compile", "NAME" },
|
||||||
|
{ "shared-library", 'l', 0, G_OPTION_ARG_FILENAME, &shlib,
|
||||||
|
"shared library", "FILE" },
|
||||||
|
{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug,
|
||||||
|
"show debug messages", NULL },
|
||||||
|
{ "verbose", 0, 0, G_OPTION_ARG_NONE, &verbose,
|
||||||
|
"show verbose messages", NULL },
|
||||||
|
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input,
|
||||||
|
NULL, NULL },
|
||||||
|
{ NULL, }
|
||||||
|
};
|
||||||
|
|
||||||
context = g_option_context_new ("");
|
context = g_option_context_new ("");
|
||||||
g_option_context_add_main_entries (context, options, NULL);
|
g_option_context_add_main_entries (context, options, NULL);
|
||||||
|
Reference in New Issue
Block a user