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:
Johan Dahlin 2008-03-11 14:25:08 +00:00 committed by Philip Withnall
parent cff3cc7ad9
commit c7c1c96c2b

View File

@ -30,9 +30,8 @@
#include "girepository.h" #include "girepository.h"
#include "gmetadata.h" #include "gmetadata.h"
gboolean raw = FALSE; /* FIXME: Avoid global */
gchar **input = NULL; static gchar *output = NULL;
gchar *output = NULL;
static void static void
write_type_name (const gchar *namespace, write_type_name (const gchar *namespace,
@ -1104,14 +1103,6 @@ write_repository (GIRepository *repository,
g_strfreev (namespaces); g_strfreev (namespaces);
} }
static GOptionEntry options[] =
{
{ "raw", 0, 0, G_OPTION_ARG_NONE, &raw, "handle raw metadata", NULL },
{ "output", 'o', 0, G_OPTION_ARG_FILENAME, &output, "output file", "FILE" },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
{ NULL, }
};
static const guchar * static const guchar *
load_metadata (const gchar *filename, load_metadata (const gchar *filename,
GModule **dlhandle, GModule **dlhandle,
@ -1152,11 +1143,20 @@ load_metadata (const gchar *filename,
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gboolean raw = FALSE;
gchar **input = NULL;
GOptionContext *context; GOptionContext *context;
GError *error = NULL; GError *error = NULL;
gboolean needs_prefix; gboolean needs_prefix;
gint i; gint i;
GMetadata *data; GMetadata *data;
GOptionEntry options[] =
{
{ "raw", 0, 0, G_OPTION_ARG_NONE, &raw, "handle raw metadata", NULL },
{ "output", 'o', 0, G_OPTION_ARG_FILENAME, &output, "output file", "FILE" },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
{ NULL, }
};
g_type_init (); g_type_init ();