# build/misc.c

Go to the documentation of this file.

    00001
    00004 #include "system.h"
    00005
    00006 #include <rpmio.h>
    00007 #include <rpmiotypes.h>
    00008 #include "rpmbuild.h"
    00009 #include "debug.h"
    00010
    00011 int parseNum(const char * line, rpmuint32_t * res)
    00012 {
    00013     char * s1 = NULL;
    00014     unsigned long rc;
    00015
    00016     if (line == NULL) return 1;
    00017     rc = strtoul(line, &s1, 10);
    00018     if (res) *res = rc;
    00019     return (((*s1) || (s1 == line) || (rc == ULONG_MAX)) ? 1 : 0);
    00020 }