Commit ae0409ff authored by Elliot Lee's avatar Elliot Lee

poptimization.



poptimization.
parent 8c13818d
This diff is collapsed.
......@@ -8,53 +8,27 @@
#include "number-match.h"
#include "dump.h"
/* If set, the file to load at startup time */
static GList *startup_files;
static char *dump_file_name = NULL;
static char *dump_file_name;
enum {
DUMP_FUNCS_KEY = -1
};
static struct argp_option argp_options [] = {
{ "dump-func-defs", DUMP_FUNCS_KEY, N_("FILE"), 0, N_("Dumps the functions definitions") },
{ NULL, 0, NULL, 0, NULL, 0 },
};
static error_t
parse_an_arg (int key, char *arg, struct argp_state *state)
{
switch (key){
case DUMP_FUNCS_KEY:
dump_file_name = arg;
break;
case ARGP_KEY_INIT:
case ARGP_KEY_FINI:
return 0;
default:
if (arg)
startup_files = g_list_prepend (startup_files, arg);
}
return 0;
}
static struct argp parser = {
argp_options, parse_an_arg, NULL, NULL, NULL, NULL, NULL
static const struct poptOption options[] = {
{"dump-func-defs", '\0', POPT_ARG_STRING, &dump_file_name, 0, N_("Dumps the function definitions"), N_("FILE")},
{NULL, '\0', 0, NULL, 0}
};
int
main (int argc, char *argv [])
{
GList *l;
poptContext ctx;
int i;
/* If set, the file to load at startup time */
char **startup_files = NULL;
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
gnome_init ("Gnumeric", &parser, argc, argv, 0, NULL);
gnome_init_with_popt_table ("gnumeric", VERSION, argc, argv,
options, 0, &ctx);
string_init ();
format_match_init ();
......@@ -71,15 +45,15 @@ main (int argc, char *argv [])
exit (1);
}
/* Load any specified files on the command line */
for (l = startup_files; l; l = l->next){
current_workbook = gnumericReadXmlWorkbook (l->data);
if (current_workbook)
gtk_widget_show (current_workbook->toplevel);
}
g_list_free (startup_files);
startup_files = poptGetArgs(ctx);
if(startup_files)
for(i = 0; startup_files[i]; i++) {
current_workbook = gnumericReadXmlWorkbook (startup_files[i]);
if (current_workbook)
gtk_widget_show (current_workbook->toplevel);
}
poptFreeContext(ctx);
if (current_workbook == NULL){
current_workbook = workbook_new_with_sheets (1);
......
......@@ -8,53 +8,27 @@
#include "number-match.h"
#include "dump.h"
/* If set, the file to load at startup time */
static GList *startup_files;
static char *dump_file_name = NULL;
static char *dump_file_name;
enum {
DUMP_FUNCS_KEY = -1
};
static struct argp_option argp_options [] = {
{ "dump-func-defs", DUMP_FUNCS_KEY, N_("FILE"), 0, N_("Dumps the functions definitions") },
{ NULL, 0, NULL, 0, NULL, 0 },
};
static error_t
parse_an_arg (int key, char *arg, struct argp_state *state)
{
switch (key){
case DUMP_FUNCS_KEY:
dump_file_name = arg;
break;
case ARGP_KEY_INIT:
case ARGP_KEY_FINI:
return 0;
default:
if (arg)
startup_files = g_list_prepend (startup_files, arg);
}
return 0;
}
static struct argp parser = {
argp_options, parse_an_arg, NULL, NULL, NULL, NULL, NULL
static const struct poptOption options[] = {
{"dump-func-defs", '\0', POPT_ARG_STRING, &dump_file_name, 0, N_("Dumps the function definitions"), N_("FILE")},
{NULL, '\0', 0, NULL, 0}
};
int
main (int argc, char *argv [])
{
GList *l;
poptContext ctx;
int i;
/* If set, the file to load at startup time */
char **startup_files = NULL;
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
gnome_init ("Gnumeric", &parser, argc, argv, 0, NULL);
gnome_init_with_popt_table ("gnumeric", VERSION, argc, argv,
options, 0, &ctx);
string_init ();
format_match_init ();
......@@ -71,15 +45,15 @@ main (int argc, char *argv [])
exit (1);
}
/* Load any specified files on the command line */
for (l = startup_files; l; l = l->next){
current_workbook = gnumericReadXmlWorkbook (l->data);
if (current_workbook)
gtk_widget_show (current_workbook->toplevel);
}
g_list_free (startup_files);
startup_files = poptGetArgs(ctx);
if(startup_files)
for(i = 0; startup_files[i]; i++) {
current_workbook = gnumericReadXmlWorkbook (startup_files[i]);
if (current_workbook)
gtk_widget_show (current_workbook->toplevel);
}
poptFreeContext(ctx);
if (current_workbook == NULL){
current_workbook = workbook_new_with_sheets (1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment