[svn-upgrade] Integrating new upstream version, shadow (4.0.1)

This commit is contained in:
nekral-guest
2007-10-07 11:44:59 +00:00
parent 3bc4996775
commit 9db6abfa42
194 changed files with 20217 additions and 14460 deletions

View File

@@ -30,7 +30,7 @@
#include <config.h>
#include "rcsid.h"
RCSID("$Id: getdef.c,v 1.14 2000/08/26 18:27:17 marekm Exp $")
RCSID("$Id: getdef.c,v 1.15 2002/01/06 14:08:00 kloczek Exp $")
#include "prototypes.h"
#include "defines.h"
@@ -201,6 +201,29 @@ getdef_num(const char *item, int dflt)
}
/*
* getdef_unum - get unsigned numerical value from table of definitions
*
* Returns numeric value of specified item, else the "dflt" value if
* the item is not defined. Octal (leading "0") and hex (leading "0x")
* values are handled.
*/
unsigned int
getdef_unum(const char *item, unsigned int dflt)
{
struct itemdef *d;
if (!def_loaded)
def_load();
if ((d = def_find(item)) == NULL || d->value == NULL)
return dflt;
return (unsigned int) strtoul(d->value, (char **)NULL, 0);
}
/*
* getdef_long - get long integer value from table of definitions
*