Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
5c7f6758
Commit
5c7f6758
authored
Feb 22, 2001
by
Andreas Gustafsson
Browse files
new function cfg_tuple_get()
parent
80a1cac8
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/isccfg/include/isccfg/cfg.h
View file @
5c7f6758
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cfg.h,v 1.
8
2001/02/22 0
1:40:53 bwelling
Exp $ */
/* $Id: cfg.h,v 1.
9
2001/02/22 0
4:17:37 gson
Exp $ */
#ifndef DNS_CFG_H
#define DNS_CFG_H 1
...
...
@@ -167,6 +167,18 @@ cfg_map_getname(cfg_obj_t *mapobj);
* or NULL if the map object does not have a name.
*/
cfg_obj_t
*
cfg_tuple_get
(
cfg_obj_t
*
tupleobj
,
const
char
*
name
);
/*
* Extract an element from a configuration object, which
* must be of a tuple type.
*
* Requires:
* 'tupleobj' ponts to a valid configuraration object of a tuple type.
* 'name' points to a null-terminated string naming one of the
* fields of said tuple type.
*/
isc_uint32_t
cfg_obj_asuint32
(
cfg_obj_t
*
obj
);
/*
...
...
lib/isccfg/parser.c
View file @
5c7f6758
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.1
5
2001/02/22 0
3
:1
3:08
gson Exp $ */
/* $Id: parser.c,v 1.1
6
2001/02/22 0
4
:1
7:36
gson Exp $ */
#include
<config.h>
...
...
@@ -1133,6 +1133,26 @@ free_tuple(cfg_parser_t *pctx, cfg_obj_t *obj) {
nfields
*
sizeof
(
cfg_obj_t
*
));
}
cfg_obj_t
*
cfg_tuple_get
(
cfg_obj_t
*
tupleobj
,
const
char
*
name
)
{
unsigned
int
i
;
cfg_tuplefielddef_t
*
fields
;
cfg_tuplefielddef_t
*
f
;
REQUIRE
(
tupleobj
!=
NULL
&&
tupleobj
->
type
->
rep
==
&
cfg_rep_tuple
);
fields
=
tupleobj
->
type
->
of
;
for
(
f
=
fields
,
i
=
0
;
f
->
name
!=
NULL
;
f
++
,
i
++
)
{
if
(
strcmp
(
f
->
name
,
name
)
==
0
)
return
(
tupleobj
->
value
.
tuple
[
i
]);
}
INSIST
(
0
);
return
(
NULL
);
}
/*
* Parse a required special character.
*/
static
isc_result_t
parse_special
(
cfg_parser_t
*
pctx
,
int
special
)
{
isc_result_t
result
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment