string.c revision 499b34cea04a46823d003d4c0520c8b03e8513cb
/*
* Copyright (C) 1999-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: string.c,v 1.6 2001/01/09 21:56:30 bwelling Exp $ */
#include <config.h>
#include <ctype.h>
static char digits[] = "0123456789abcdefghijklmnoprstuvwxyz";
char *s = source;
char *o;
char c;
return (0);
}
s++;
if (*s == '+' /* || *s == '-' */)
s++;
if (base == 0) {
if (*s == '0' && (*(s+1) == 'X' || *(s+1) == 'x')) {
s += 2;
base = 16;
} else if (*s == '0')
base = 8;
else
base = 10;
}
if (*s == 0) {
return (0);
}
overflow = ~0;
tmp = 0;
while ((c = *s) != 0) {
c = tolower(c);
/* end ? */
*end = s;
return (tmp);
}
/* end ? */
*end = s;
return (tmp);
}
/* overflow ? */
return (0);
}
/* overflow ? */
return (0);
}
s++;
}
*end = s;
return (tmp);
}
char *
char *s;
const char *d;
return (NULL);
*s++ = '\0';
*stringp = s;
return (string);
}
return (string);
}