/home/andy/git/oilshell/oil/cpp/leaky_libc.h
Line | Count | Source (jump to first uncovered line) |
1 | | // leaky_libc.h: Replacement for native/libc.c |
2 | | |
3 | | #ifndef LIBC_H |
4 | | #define LIBC_H |
5 | | |
6 | | #include <stdlib.h> |
7 | | |
8 | | #include "mycpp/runtime.h" |
9 | | |
10 | | namespace libc { |
11 | | |
12 | 0 | inline void print_time(double real_time, double user_time, double system_time) { |
13 | 0 | fprintf(stderr, "%1.2fs user\n%1.2fs system\n%1.3fs total\n", user_time, |
14 | 0 | system_time, real_time); // 0.05s user 0.03s system 3.186s total |
15 | 0 | } |
16 | | |
17 | 0 | inline Str* realpath(Str* path) { |
18 | 0 | char* rp = ::realpath(path->data_, 0); |
19 | 0 | return StrFromC(rp); |
20 | 0 | } |
21 | | |
22 | | Str* gethostname(); |
23 | | |
24 | | int fnmatch(Str* pat, Str* str); |
25 | | |
26 | | List<Str*>* glob(Str* pat); |
27 | | |
28 | | Tuple2<int, int>* regex_first_group_match(Str* pattern, Str* str, int pos); |
29 | | |
30 | | List<Str*>* regex_match(Str* pattern, Str* str); |
31 | | |
32 | | } // namespace libc |
33 | | |
34 | | #endif // LIBC_H |