]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/input.h
Merge back recent changes from xfs kernel headers.
[thirdparty/xfsprogs-dev.git] / include / input.h
1 /*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
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
7 * published by the Free Software Foundation.
8 *
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.
13 *
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
17 */
18 #ifndef __INPUT_H__
19 #define __INPUT_H__
20
21 #include <pwd.h>
22 #include <grp.h>
23 #include <sys/types.h>
24 #include <xfs/project.h>
25
26 extern char **breakline(char *input, int *count);
27 extern void doneline(char *input, char **vec);
28 extern char *fetchline(void);
29
30 extern long long cvtnum(size_t blocksize, size_t sectorsize, char *s);
31 extern void cvtstr(double value, char *str, size_t sz);
32 extern unsigned long cvttime(char *s);
33
34 extern struct timeval tadd(struct timeval t1, struct timeval t2);
35 extern struct timeval tsub(struct timeval t1, struct timeval t2);
36 extern double tdiv(double value, struct timeval tv);
37
38 enum {
39 DEFAULT_TIME = 0x0,
40 TERSE_FIXED_TIME = 0x1,
41 VERBOSE_FIXED_TIME = 0x2,
42 };
43
44 extern void timestr(struct timeval *tv, char *str, size_t sz, int flags);
45
46 extern uid_t uid_from_string(char *user);
47 extern gid_t gid_from_string(char *group);
48 extern prid_t prid_from_string(char *project);
49
50 #define HAVE_FTW_H 1 /* TODO: configure me */
51
52 #ifdef HAVE_FTW_H
53 #include <ftw.h>
54 #else
55 struct FTW;
56 struct stat;
57 extern int nftw(
58 char *dir,
59 int (*fn)(const char *, const struct stat *, int, struct FTW *),
60 int depth,
61 int flags);
62 #endif
63
64 #endif /* __INPUT_H__ */