mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
The atonum() function is now provied by libite.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
b30678bbe9
commit
0fd9aa6497
3 files changed
+1
-27
No files matched your search
@@ -39,30 +39,6 @@
|
|||||||
#include "private.h"
|
#include "private.h"
|
||||||
#include "libite/lite.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)
|
static int encode(int lvl)
|
||||||
{
|
{
|
||||||
if (!lvl) return 0;
|
if (!lvl) return 0;
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ do { \
|
|||||||
#define SETBIT(a,i) (a |= (1 << (i)))
|
#define SETBIT(a,i) (a |= (1 << (i)))
|
||||||
#define CLRBIT(a,i) (a &= ~(1 << (i)))
|
#define CLRBIT(a,i) (a &= ~(1 << (i)))
|
||||||
|
|
||||||
int atonum (char *str);
|
|
||||||
|
|
||||||
void runlevel_set (int pre, int now);
|
void runlevel_set (int pre, int now);
|
||||||
int runlevel_get (void);
|
int runlevel_get (void);
|
||||||
char *runlevel_string (int levels);
|
char *runlevel_string (int levels);
|
||||||
|
|||||||
+1
-1
Submodule libite updated: 4005dd5e2c...1147e547dc.
Reference in new issue
Block a user