]>
Commit | Line | Data |
---|---|---|
e246ba5f | 1 | /* |
f302e9e4 NS |
2 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
dfc130f3 | 4 | * |
f302e9e4 NS |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as | |
e246ba5f | 7 | * published by the Free Software Foundation. |
dfc130f3 | 8 | * |
f302e9e4 NS |
9 | * This program is distributed in the hope that it would be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
dfc130f3 | 13 | * |
f302e9e4 NS |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
e246ba5f | 17 | */ |
3d93ccb7 NS |
18 | #ifndef __INPUT_H__ |
19 | #define __INPUT_H__ | |
20 | ||
21 | #include <pwd.h> | |
22 | #include <grp.h> | |
23 | #include <sys/types.h> | |
6b803e5a | 24 | #include "project.h" |
fd537fc5 | 25 | #include <stdbool.h> |
e246ba5f NS |
26 | |
27 | extern char **breakline(char *input, int *count); | |
28 | extern void doneline(char *input, char **vec); | |
29 | extern char *fetchline(void); | |
3d93ccb7 | 30 | |
2c2f6d79 | 31 | extern long long cvtnum(size_t blocksize, size_t sectorsize, char *s); |
92d9b902 | 32 | extern void cvtstr(double value, char *str, size_t sz); |
3d93ccb7 NS |
33 | extern unsigned long cvttime(char *s); |
34 | ||
35 | extern struct timeval tadd(struct timeval t1, struct timeval t2); | |
92d9b902 NS |
36 | extern struct timeval tsub(struct timeval t1, struct timeval t2); |
37 | extern double tdiv(double value, struct timeval tv); | |
5c7bef67 NS |
38 | |
39 | enum { | |
40 | DEFAULT_TIME = 0x0, | |
41 | TERSE_FIXED_TIME = 0x1, | |
2a1888c5 | 42 | VERBOSE_FIXED_TIME = 0x2 |
5c7bef67 NS |
43 | }; |
44 | ||
45 | extern void timestr(struct timeval *tv, char *str, size_t sz, int flags); | |
638473d8 | 46 | |
3d93ccb7 NS |
47 | extern uid_t uid_from_string(char *user); |
48 | extern gid_t gid_from_string(char *group); | |
49 | extern prid_t prid_from_string(char *project); | |
fd537fc5 | 50 | extern bool isdigits_only(const char *str); |
8211d1b5 | 51 | extern int timespec_from_string(const char *sec, const char *nsec, struct timespec *ts); |
3d93ccb7 NS |
52 | |
53 | #define HAVE_FTW_H 1 /* TODO: configure me */ | |
54 | ||
55 | #ifdef HAVE_FTW_H | |
56 | #include <ftw.h> | |
57 | #else | |
58 | struct FTW; | |
59 | struct stat; | |
60 | extern int nftw( | |
61 | char *dir, | |
62 | int (*fn)(const char *, const struct stat *, int, struct FTW *), | |
63 | int depth, | |
64 | int flags); | |
65 | #endif | |
66 | ||
67 | #endif /* __INPUT_H__ */ |