/*
* Copyright (C) 2004, 2005, 2007, 2008, 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* 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 ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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: hex.c,v 1.20 2008/09/25 04:02:39 tbox Exp $ */
/*! \file */
#include <config.h>
#include <ctype.h>
#define RETERR(x) do { \
isc_result_t _r = (x); \
if (_r != ISC_R_SUCCESS) \
return (_r); \
} while (0)
/*
*/
static isc_result_t
static isc_result_t
{
unsigned int loops = 0;
if (wordlength < 2)
wordlength = 2;
loops++;
{
loops = 0;
}
}
return (ISC_R_SUCCESS);
}
/*%
* State of a hex decoding process in progress.
*/
typedef struct {
static inline void
{
}
static inline isc_result_t
char *s;
return (ISC_R_BADHEX);
unsigned char num;
return (ISC_R_BADHEX);
else
}
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_BADHEX);
return (ISC_R_SUCCESS);
}
unsigned int i;
if (length > 0)
else
break;
}
return (ISC_R_SUCCESS);
}
for (;;) {
int c = *cstr++;
if (c == '\0')
break;
if (c == ' ' || c == '\t' || c == '\n' || c== '\r')
continue;
}
return (ISC_R_SUCCESS);
}
static isc_result_t
unsigned int l;
return (ISC_R_NOSPACE);
isc_buffer_add(target, l);
return (ISC_R_SUCCESS);
}
static isc_result_t
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
}