* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cfg.h,v 1.16 2001/02/26 22:37:34 gson Exp $ */
+/* $Id: cfg.h,v 1.17 2001/02/27 01:49:46 bwelling Exp $ */
#ifndef DNS_CFG_H
#define DNS_CFG_H 1
* Returns the first list element in a configuration object of a list type.
*
* Requires:
- * 'obj' points to a valid configuration object of a list type.
+ * 'obj' points to a valid configuration object of a list type or NULL.
*
* Returns:
* A pointer to a cfg_listelt_t representing the first list element,
- * or NULL if the list is empty.
+ * or NULL if the list is empty or nonexistent.
*/
cfg_listelt_t *
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: parser.c,v 1.27 2001/02/27 01:31:56 gson Exp $ */
+/* $Id: parser.c,v 1.28 2001/02/27 01:49:44 bwelling Exp $ */
#include <config.h>
cfg_listelt_t *
cfg_list_first(cfg_obj_t *obj) {
- REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_list);
+ REQUIRE(obj == NULL || obj->type->rep == &cfg_rep_list);
+ if (obj == NULL)
+ return (NULL);
return (ISC_LIST_HEAD(obj->value.list));
}