getrrset.c revision ac3f9fa1ec1cc60906c362dcd8e534fffc991837
/*
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: getrrset.c,v 1.9 2001/03/06 23:02:01 bwelling Exp $ */
#include <config.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "assert_p.h"
static unsigned int
switch (lwresult) {
case LWRES_R_SUCCESS: return (ERRSET_SUCCESS);
case LWRES_R_NOMEMORY: return (ERRSET_NOMEMORY);
default: return (ERRSET_FAIL);
}
}
/*
* malloc / calloc functions that guarantee to only
* return NULL if there is an error, like they used
* to before the ANSI C committee broke them.
*/
static void *
if (size == 0)
size = 1;
}
static void *
return (mem);
}
int
{
unsigned int i;
unsigned int lwflags;
unsigned int result;
goto fail;
}
/*
* Don't allow queries of class or type ANY
*/
goto fail;
}
if (lwresult != LWRES_R_SUCCESS) {
goto fail;
}
/*
* If any input flags were defined, lwflags would be set here
* based on them
*/
lwflags = 0;
if (lwresult != LWRES_R_SUCCESS) {
goto fail;
}
goto fail;
}
rrset->rri_nrdatas = 0;
goto fail;
}
sizeof(struct rdatainfo));
goto fail;
}
for (i = 0; i < rrset->rri_nrdatas; i++) {
goto fail;
}
}
sizeof(struct rdatainfo));
goto fail;
}
goto fail;
}
}
return (ERRSET_SUCCESS);
fail:
return (result);
}
void
unsigned int i;
for (i = 0; i < rrset->rri_nrdatas; i++) {
break;
}
break;
}
}