2013-08-06 07:16:27 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include "arg.h"
|
|
|
|
|
|
|
|
#define UTF8_POINT(c) (((c) & 0xc0) != 0x80)
|
2015-09-10 18:27:29 -04:00
|
|
|
|
|
|
|
#undef MIN
|
|
|
|
#define MIN(x,y) ((x) < (y) ? (x) : (y))
|
|
|
|
#undef MAX
|
|
|
|
#define MAX(x,y) ((x) > (y) ? (x) : (y))
|
|
|
|
#undef LIMIT
|
|
|
|
#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
|
|
|
|
|
2013-08-06 07:16:27 -04:00
|
|
|
#define LEN(x) (sizeof (x) / sizeof *(x))
|
|
|
|
|
2014-04-30 08:01:56 -04:00
|
|
|
/* eprintf.c */
|
2013-08-06 07:16:27 -04:00
|
|
|
extern char *argv0;
|
|
|
|
|
2014-04-30 08:01:56 -04:00
|
|
|
/* agetcwd.c */
|
2013-08-14 10:38:43 -04:00
|
|
|
char *agetcwd(void);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
|
|
|
/* apathmax.c */
|
2013-08-14 10:38:43 -04:00
|
|
|
void apathmax(char **, long *);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
|
|
|
/* ealloc.c */
|
|
|
|
void *ecalloc(size_t, size_t);
|
|
|
|
void *emalloc(size_t size);
|
|
|
|
void *erealloc(void *, size_t);
|
|
|
|
char *estrdup(const char *);
|
|
|
|
|
2014-06-30 13:42:08 -04:00
|
|
|
/* eprintf.c */
|
|
|
|
void enprintf(int, const char *, ...);
|
|
|
|
void eprintf(const char *, ...);
|
|
|
|
void weprintf(const char *, ...);
|
|
|
|
|
2014-04-30 08:01:56 -04:00
|
|
|
/* estrtol.c */
|
2013-08-06 07:16:27 -04:00
|
|
|
long estrtol(const char *, int);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
2014-06-04 08:07:34 -04:00
|
|
|
/* estrtoul.c */
|
|
|
|
unsigned long estrtoul(const char *, int);
|
|
|
|
|
2014-04-30 08:01:56 -04:00
|
|
|
/* explicit_bzero.c */
|
2014-04-30 07:25:29 -04:00
|
|
|
#undef explicit_bzero
|
|
|
|
void explicit_bzero(void *, size_t);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
|
|
|
/* putword.c */
|
2013-08-29 06:11:26 -04:00
|
|
|
void putword(const char *);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
|
|
|
/* recurse.c */
|
2013-08-14 10:38:43 -04:00
|
|
|
void recurse(const char *, void (*)(const char *));
|
2014-04-30 08:01:56 -04:00
|
|
|
|
2015-05-10 07:49:15 -04:00
|
|
|
/* strlcat.c */
|
2014-02-10 08:14:12 -05:00
|
|
|
#undef strlcat
|
2013-09-04 06:27:29 -04:00
|
|
|
size_t strlcat(char *, const char *, size_t);
|
2015-05-10 07:49:15 -04:00
|
|
|
size_t estrlcat(char *, const char *, size_t);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
2015-05-10 07:49:15 -04:00
|
|
|
/* strlcpy.c */
|
2014-02-10 08:14:12 -05:00
|
|
|
#undef strlcpy
|
2013-09-04 06:27:29 -04:00
|
|
|
size_t strlcpy(char *, const char *, size_t);
|
2015-05-10 07:49:15 -04:00
|
|
|
size_t estrlcpy(char *, const char *, size_t);
|
2014-04-30 08:01:56 -04:00
|
|
|
|
2015-09-07 06:21:26 -04:00
|
|
|
/* strtonum.c */
|
|
|
|
#undef strtonum
|
|
|
|
long long strtonum(const char *, long long, long long, const char **);
|
|
|
|
long long enstrtonum(int, const char *, long long, long long);
|
|
|
|
long long estrtonum(const char *, long long, long long);
|
|
|
|
|
2014-04-30 08:01:56 -04:00
|
|
|
/* tty.c */
|
|
|
|
void devtotty(int, int *, int *);
|
2015-01-16 10:32:55 -05:00
|
|
|
int ttytostr(int, int, char *, size_t);
|