1 /* source: xioparam.c */
2 /* Copyright Gerhard Rieger 2001-2006 */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 /* this file contains the source for xio options handling */
7 #include "xiosysincludes.h"
10 /*#include "xioparam.h" are all in xio.h */
12 /* options that can be applied to this module */
14 false, /* strictopts */
23 '4' /* preferred_ip */
27 /* allow application to set xioopen options */
28 int xiosetopt(char what
, const char *arg
) {
30 case 's': xioopts
.strictopts
= true; break;
31 case 'p': if ((xioopts
.pipesep
= strdup(arg
)) == NULL
) {
32 Error1("strdup("F_Zu
"): out of memory", strlen(arg
)+1);
36 case 'o': xioopts
.ip4portsep
= arg
[0];
38 Error2("xiosetopt('%c', \"%s\"): port separator must be single character",
43 case 'l': xioopts
.logopt
= *arg
; break;
44 case 'y': xioopts
.syslogfac
= arg
; break;
46 Error2("xiosetopt('%c', \"%s\"): unknown option",
47 what
, arg
?arg
:"NULL");
54 int xioinqopt(char what
, char *arg
, size_t n
) {
56 case 's': return xioopts
.strictopts
;
57 case 'p': strncpy(arg
, xioopts
.pipesep
, n
);
59 case 'o': return xioopts
.ip4portsep
;
60 case 'l': return xioopts
.logopt
;
62 Error3("xioinqopt('%c', \"%s\", "F_Zu
"): unknown option",