hex.c revision 3398334b3acda24b086957286288ca9852662b12
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
8ed107eab48687887d45a1ceb18b712bc7209dbaTinderbox User * Copyright (C) 2000-2003 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
b7b76d6b855cd4c1152c26d34fb61af05f965c5eEvan Hunt * PERFORMANCE OF THIS SOFTWARE.
/* $Id: hex.c,v 1.20 2008/09/25 04:02:39 tbox Exp $ */
#include <config.h>
#include <ctype.h>
#define RETERR(x) do { \
return (_r); \
static isc_result_t
static isc_result_t
unsigned int loops = 0;
loops++;
loops = 0;
return (ISC_R_SUCCESS);
static inline isc_result_t
return (ISC_R_BADHEX);
unsigned char num;
return (ISC_R_BADHEX);
return (ISC_R_SUCCESS);
static inline isc_result_t
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_BADHEX);
return (ISC_R_SUCCESS);
if (length > 0)
return (ISC_R_SUCCESS);
int c = *cstr++;
return (ISC_R_SUCCESS);
static isc_result_t
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
static isc_result_t
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);