0.8.10claws50
* src/main.c * src/common/sylpheed.c add command line parameter parsing to common code
This commit is contained in:
parent
5cf5c194b2
commit
1f4e67992b
4 changed files with 55 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2003-02-25 [christoph] 0.8.10claws50
|
||||||
|
|
||||||
|
* src/main.c
|
||||||
|
* src/common/sylpheed.c
|
||||||
|
add command line parameter parsing to common code
|
||||||
|
|
||||||
2003-02-24 [christoph]
|
2003-02-24 [christoph]
|
||||||
|
|
||||||
* Makefile.am
|
* Makefile.am
|
||||||
|
@ -6,6 +12,9 @@
|
||||||
`gnome-config --prefix` from `gnome-config --datadir`
|
`gnome-config --prefix` from `gnome-config --datadir`
|
||||||
and adds $(prefix} instead
|
and adds $(prefix} instead
|
||||||
|
|
||||||
|
(closes Bug 24 Makefile does not respect prefix when installing
|
||||||
|
GNOME data)
|
||||||
|
|
||||||
2003-02-24 [christoph] 0.8.10claws49
|
2003-02-24 [christoph] 0.8.10claws49
|
||||||
|
|
||||||
* src/news.c
|
* src/news.c
|
||||||
|
|
|
@ -11,7 +11,7 @@ MINOR_VERSION=8
|
||||||
MICRO_VERSION=10
|
MICRO_VERSION=10
|
||||||
INTERFACE_AGE=0
|
INTERFACE_AGE=0
|
||||||
BINARY_AGE=0
|
BINARY_AGE=0
|
||||||
EXTRA_VERSION=claws49
|
EXTRA_VERSION=claws50
|
||||||
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
|
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
|
||||||
|
|
||||||
dnl set $target
|
dnl set $target
|
||||||
|
|
|
@ -37,11 +37,55 @@
|
||||||
|
|
||||||
static gboolean sylpheed_initialized = FALSE;
|
static gboolean sylpheed_initialized = FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse program parameters and remove all parameters
|
||||||
|
* that have been processed. Arguments are pointers to
|
||||||
|
* original passed programm arguments and these will
|
||||||
|
* be modified leaving only unknown parameters for
|
||||||
|
* further processing
|
||||||
|
*
|
||||||
|
* \param argc pointer to number of parameters
|
||||||
|
* \param argv pointer to array of parameter strings
|
||||||
|
*/
|
||||||
|
static void parse_parameter(int *argc, char ***argv)
|
||||||
|
{
|
||||||
|
gint i, j, k;
|
||||||
|
|
||||||
|
g_return_if_fail(argc != NULL);
|
||||||
|
g_return_if_fail(argv != NULL);
|
||||||
|
|
||||||
|
for (i = 1; i < *argc;) {
|
||||||
|
if (strcmp("--debug", (*argv)[i]) == 0) {
|
||||||
|
debug_set_mode(TRUE);
|
||||||
|
|
||||||
|
(*argv)[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove NULL args from argv[] for further processing */
|
||||||
|
for (i = 1; i < *argc; i++) {
|
||||||
|
for (k = i; k < *argc; k++)
|
||||||
|
if ((*argv)[k] != NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (k > i) {
|
||||||
|
k -= i;
|
||||||
|
for (j = i + k; j < *argc; j++)
|
||||||
|
(*argv)[j - k] = (*argv)[j];
|
||||||
|
*argc -= k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gboolean sylpheed_init(int *argc, char ***argv)
|
gboolean sylpheed_init(int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
if (sylpheed_initialized)
|
if (sylpheed_initialized)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
parse_parameter(argc, argv);
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
|
|
@ -375,9 +375,7 @@ static void parse_cmd_opt(int argc, char *argv[])
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
if (!strncmp(argv[i], "--debug", 7))
|
if (!strncmp(argv[i], "--receive-all", 13))
|
||||||
debug_set_mode(TRUE);
|
|
||||||
else if (!strncmp(argv[i], "--receive-all", 13))
|
|
||||||
cmd.receive_all = TRUE;
|
cmd.receive_all = TRUE;
|
||||||
else if (!strncmp(argv[i], "--receive", 9))
|
else if (!strncmp(argv[i], "--receive", 9))
|
||||||
cmd.receive = TRUE;
|
cmd.receive = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue