summaryrefslogtreecommitdiffstats
path: root/src/global/attr_override.h
blob: 9f061620b17895fdc01cc9359b0788102f42368f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef _ATTR_OVERRIDE_H_INCLUDED_
#define _ATTR_OVERRIDE_H_INCLUDED_

/*++
/* NAME
/*	attr_override 3h
/* SUMMARY
/*	apply name=value settings from string
/* SYNOPSIS
/*	#include <attr_override.h>
/* DESCRIPTION
/* .nf

 /*
  * External interface.
  */
#include <check_arg.h>

extern void attr_override(char *, const char *, const char *,...);

typedef struct {
    const char *name;
    CONST_CHAR_STAR *target;
    int     min;
    int     max;
} ATTR_OVER_STR;

typedef struct {
    const char *name;
    const char *defval;
    int    *target;
    int     min;
    int     max;
} ATTR_OVER_TIME;

typedef struct {
    const char *name;
    int    *target;
    int     min;
    int     max;
} ATTR_OVER_INT;

/* Type-unchecked API, internal use only. */
#define ATTR_OVER_END		0
#define ATTR_OVER_STR_TABLE	1
#define ATTR_OVER_TIME_TABLE	2
#define ATTR_OVER_INT_TABLE	3

/* Type-checked API, external use only. */
#define CA_ATTR_OVER_END		0
#define CA_ATTR_OVER_STR_TABLE(v)	ATTR_OVER_STR_TABLE, CHECK_CPTR(ATTR_OVER, ATTR_OVER_STR, (v))
#define CA_ATTR_OVER_TIME_TABLE(v)	ATTR_OVER_TIME_TABLE, CHECK_CPTR(ATTR_OVER, ATTR_OVER_TIME, (v))
#define CA_ATTR_OVER_INT_TABLE(v)	ATTR_OVER_INT_TABLE, CHECK_CPTR(ATTR_OVER, ATTR_OVER_INT, (v))

CHECK_CPTR_HELPER_DCL(ATTR_OVER, ATTR_OVER_TIME);
CHECK_CPTR_HELPER_DCL(ATTR_OVER, ATTR_OVER_STR);
CHECK_CPTR_HELPER_DCL(ATTR_OVER, ATTR_OVER_INT);

/* LICENSE
/* .ad
/* .fi
/*	The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/*	Wietse Venema
/*	IBM T.J. Watson Research
/*	P.O. Box 704
/*	Yorktown Heights, NY 10598, USA
/*--*/

#endif