mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
The atonum() function is now provied by libite.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -39,30 +39,6 @@
|
||||
#include "private.h"
|
||||
#include "libite/lite.h"
|
||||
|
||||
|
||||
/**
|
||||
* atonum - Convert string to integer
|
||||
* @str: String value to convert.
|
||||
*
|
||||
* Returns:
|
||||
* The converted (positive) number, or -1 on error, with @errno set.
|
||||
*/
|
||||
int atonum(char *str)
|
||||
{
|
||||
int val;
|
||||
char *end;
|
||||
|
||||
if (!str)
|
||||
return -1;
|
||||
|
||||
errno = 0;
|
||||
val = strtol(str, &end, 10);
|
||||
if (errno || end == str)
|
||||
return -1;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static int encode(int lvl)
|
||||
{
|
||||
if (!lvl) return 0;
|
||||
|
||||
@@ -65,8 +65,6 @@ do { \
|
||||
#define SETBIT(a,i) (a |= (1 << (i)))
|
||||
#define CLRBIT(a,i) (a &= ~(1 << (i)))
|
||||
|
||||
int atonum (char *str);
|
||||
|
||||
void runlevel_set (int pre, int now);
|
||||
int runlevel_get (void);
|
||||
char *runlevel_string (int levels);
|
||||
|
||||
+1
-1
Submodule libite updated: 4005dd5e2c...1147e547dc
Reference in New Issue
Block a user