2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

add cfg_obj_asboolean()

This commit is contained in:
Brian Wellington
2001-02-22 01:40:53 +00:00
parent 035cd7b5bd
commit f0751a815e
2 changed files with 20 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.12 2001/02/22 00:36:24 gson Exp $ */
/* $Id: parser.c,v 1.13 2001/02/22 01:40:51 bwelling Exp $ */
#include <config.h>
@@ -1568,6 +1568,12 @@ cfg_obj_asstring(cfg_obj_t *obj) {
return (obj->value.string.base);
}
isc_boolean_t
cfg_obj_asboolean(cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_boolean);
return (obj->value.boolean);
}
/* Quoted string only */
static cfg_type_t cfg_type_qstring = {
"qstring", parse_qstring, print_qstring, &cfg_rep_string, NULL };