Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
c80b10de
...
c80b10dedaeda2399f48179000718f30327bddec
authored
2002-12-04 13:22:52 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_print_options, mu_check_option): New functions.
1 parent
780ecc97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
include/mailutils/argp.h
mailbox/mu_argp.c
include/mailutils/argp.h
View file @
c80b10d
...
...
@@ -54,5 +54,8 @@ extern error_t mu_argp_parse __P ((const struct argp * argp,
int
*
arg_index
,
void
*
input
));
extern
int
mu_register_capa
__P
((
const
char
*
name
,
struct
argp_child
*
child
));
extern
void
mu_print_options
__P
((
void
));
extern
const
char
*
mu_check_option
__P
((
char
*
name
));
#endif
...
...
mailbox/mu_argp.c
View file @
c80b10d
...
...
@@ -307,8 +307,8 @@ static char *mu_conf_option[] = {
NULL
};
static
void
show_options
()
void
mu_print_options
()
{
int
i
;
...
...
@@ -316,6 +316,29 @@ show_options()
printf
(
"%s
\n
"
,
mu_conf_option
[
i
]);
}
const
char
*
mu_check_option
(
char
*
name
)
{
int
i
;
for
(
i
=
0
;
mu_conf_option
[
i
];
i
++
)
{
int
len
;
char
*
q
,
*
p
=
strchr
(
mu_conf_option
[
i
],
'='
);
if
(
p
)
len
=
p
-
mu_conf_option
[
i
];
else
len
=
strlen
(
mu_conf_option
[
i
]);
if
(
strncasecmp
(
mu_conf_option
[
i
],
name
,
len
)
==
0
)
return
mu_conf_option
[
i
];
else
if
((
q
=
strchr
(
mu_conf_option
[
i
],
'_'
))
!=
NULL
&&
strncasecmp
(
q
+
1
,
name
,
len
-
(
q
-
mu_conf_option
[
i
])
-
1
)
==
0
)
return
mu_conf_option
[
i
];
}
return
NULL
;
}
static
error_t
mu_common_argp_parser
(
int
key
,
char
*
arg
,
struct
argp_state
*
state
)
{
...
...
@@ -331,7 +354,7 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
exit
(
0
);
case
ARG_SHOW_OPTIONS
:
show
_options
();
mu_print
_options
();
exit
(
0
);
/* mailbox */
...
...
@@ -349,15 +372,19 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
case
'E'
:
flags
|=
MU_LOCKER_EXTERNAL
;
break
;
case
'R'
:
flags
|=
MU_LOCKER_RETRY
;
break
;
case
'T'
:
flags
|=
MU_LOCKER_TIME
;
break
;
case
'P'
:
flags
|=
MU_LOCKER_PID
;
break
;
default:
argp_error
(
state
,
"invalid lock flag '%c'"
,
*
arg
);
}
...
...
@@ -392,7 +419,6 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
}
break
;
/* log */
case
ARG_LOG_FACILITY
:
log_facility
=
parse_log_facility
(
arg
);
...
...
Please
register
or
sign in
to post a comment