contrib/dlz/example/dlz_example.c
/*
  delete a record from a list
 */
delete a record from a list
delete a record from a list
static isc_result_t del_name(struct dlz_example_data *state,
			     struct record *list, const char *name, const char *type, 
			     uint32_t ttl, const char *data)
{
	int i;
	for (i=0; i<MAX_RECORDS; i++) {
		if (strcasecmp(name, list[i].name) == 0 &&
		    strcasecmp(type, list[i].type) == 0 &&
		    strcasecmp(data, list[i].data) == 0 &&
		    ttl == list[i].ttl) {
			break;
		}
	}
	if (i == MAX_RECORDS) {
		return ISC_R_NOTFOUND;
	}
	memset(&list[i], 0, sizeof(struct record));
	return ISC_R_SUCCESS;
}
static isc_result_t del_name ( struct dlz_example_data * state , struct record * list , const char * name , const char * type , uint32_t ttl , const char * data ) { int i ; for ( i = 0 ; i < MAX_RECORDS ; i ++ ) { if ( strcasecmp ( name , list [ i ] . name ) == 0 && strcasecmp ( type , list [ i ] . type ) == 0 && strcasecmp ( data , list [ i ] . data ) == 0 && ttl == list [ i ] . ttl ) { break ; } } if ( i == MAX_RECORDS ) { return ISC_R_NOTFOUND ; } memset ( & list [ i ] , 0 , sizeof ( struct record ) ) ; return ISC_R_SUCCESS ; }
delete a record from a list
delete a record from a list