humanize_number was the only function in <util.h> that is not in libutil.

Move it to stdlib.h and add dehumanize_number.
This commit is contained in:
christos 2007-12-14 16:36:19 +00:00
parent 486b2ff085
commit 03dcf031ab
2 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdlib.h,v 1.78 2007/11/19 14:48:41 ad Exp $ */ /* $NetBSD: stdlib.h,v 1.79 2007/12/14 16:36:19 christos Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -260,6 +260,18 @@ int cgetustr(char *, const char *, char **);
int daemon(int, int); int daemon(int, int);
__aconst char *devname(dev_t, mode_t); __aconst char *devname(dev_t, mode_t);
#define HN_DECIMAL 0x01
#define HN_NOSPACE 0x02
#define HN_B 0x04
#define HN_DIVISOR_1000 0x08
#define HN_GETSCALE 0x10
#define HN_AUTOSCALE 0x20
int humanize_number(char *, size_t, int64_t, const char *, int, int);
int dehumanize_number(const char *, int64_t *);
dev_t getdevmajor(const char *, mode_t); dev_t getdevmajor(const char *, mode_t);
int getloadavg(double [], int); int getloadavg(double [], int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.h,v 1.48 2007/10/30 20:02:48 christos Exp $ */ /* $NetBSD: util.h,v 1.49 2007/12/14 16:36:19 christos Exp $ */
/*- /*-
* Copyright (c) 1995 * Copyright (c) 1995
@ -50,14 +50,6 @@ typedef _BSD_TIME_T_ time_t;
#define PIDLOCK_NONBLOCK 1 #define PIDLOCK_NONBLOCK 1
#define PIDLOCK_USEHOSTNAME 2 #define PIDLOCK_USEHOSTNAME 2
#define HN_DECIMAL 0x01
#define HN_NOSPACE 0x02
#define HN_B 0x04
#define HN_DIVISOR_1000 0x08
#define HN_GETSCALE 0x10
#define HN_AUTOSCALE 0x20
#define PW_POLICY_BYSTRING 0 #define PW_POLICY_BYSTRING 0
#define PW_POLICY_BYPASSWD 1 #define PW_POLICY_BYPASSWD 1
#define PW_POLICY_BYGROUP 2 #define PW_POLICY_BYGROUP 2
@ -80,8 +72,6 @@ off_t getlabeloffset(void);
int getlabelsector(void); int getlabelsector(void);
int getmaxpartitions(void); int getmaxpartitions(void);
int getrawpartition(void); int getrawpartition(void);
int humanize_number(char *, size_t, int64_t, const char *, int,
int);
void login(const struct utmp *); void login(const struct utmp *);
void loginx(const struct utmpx *); void loginx(const struct utmpx *);
int login_tty(int); int login_tty(int);