Add new expand_number() function

Taken from FreeBSD.

[guillem@hadrons.org:
 - Include <stdint.h> in <bsd/libutil.h>. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
Robert Millan
2011-12-31 04:30:48 +01:00
committed by Guillem Jover
parent 943939d0e5
commit 6434858314
7 changed files with 220 additions and 0 deletions

View File

@@ -41,6 +41,7 @@
#include <features.h>
#include <sys/types.h>
#include <stdint.h>
/* for pidfile.c */
struct pidfh {
@@ -53,6 +54,7 @@ struct pidfh {
__BEGIN_DECLS
int humanize_number(char *buf, size_t len, int64_t bytes,
const char *suffix, int scale, int flags);
int expand_number(const char *_buf, uint64_t *_num);
int flopen(const char *_path, int _flags, ...);