]>
Commit | Line | Data |
---|---|---|
959ef981 | 1 | // SPDX-License-Identifier: GPL-2.0 |
e246ba5f | 2 | /* |
f302e9e4 NS |
3 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. |
4 | * All Rights Reserved. | |
e246ba5f | 5 | */ |
3d93ccb7 NS |
6 | #ifndef __INPUT_H__ |
7 | #define __INPUT_H__ | |
8 | ||
9 | #include <pwd.h> | |
10 | #include <grp.h> | |
11 | #include <sys/types.h> | |
6b803e5a | 12 | #include "project.h" |
b95410da | 13 | #include "convert.h" |
fd537fc5 | 14 | #include <stdbool.h> |
e246ba5f NS |
15 | |
16 | extern char **breakline(char *input, int *count); | |
17 | extern void doneline(char *input, char **vec); | |
18 | extern char *fetchline(void); | |
3d93ccb7 | 19 | |
fb2bfcdf | 20 | extern size_t numlen(uint64_t val, size_t base); |
3d93ccb7 NS |
21 | |
22 | extern struct timeval tadd(struct timeval t1, struct timeval t2); | |
92d9b902 NS |
23 | extern struct timeval tsub(struct timeval t1, struct timeval t2); |
24 | extern double tdiv(double value, struct timeval tv); | |
5c7bef67 NS |
25 | |
26 | enum { | |
27 | DEFAULT_TIME = 0x0, | |
28 | TERSE_FIXED_TIME = 0x1, | |
2a1888c5 | 29 | VERBOSE_FIXED_TIME = 0x2 |
5c7bef67 NS |
30 | }; |
31 | ||
32 | extern void timestr(struct timeval *tv, char *str, size_t sz, int flags); | |
638473d8 | 33 | |
fd537fc5 | 34 | extern bool isdigits_only(const char *str); |
8211d1b5 | 35 | extern int timespec_from_string(const char *sec, const char *nsec, struct timespec *ts); |
3d93ccb7 NS |
36 | |
37 | #define HAVE_FTW_H 1 /* TODO: configure me */ | |
38 | ||
39 | #ifdef HAVE_FTW_H | |
40 | #include <ftw.h> | |
41 | #else | |
42 | struct FTW; | |
43 | struct stat; | |
44 | extern int nftw( | |
45 | char *dir, | |
46 | int (*fn)(const char *, const struct stat *, int, struct FTW *), | |
47 | int depth, | |
48 | int flags); | |
49 | #endif | |
50 | ||
51 | #endif /* __INPUT_H__ */ |