cpp

Coverage Report

Created: 2023-03-07 20:24

/home/andy/git/oilshell/oil/cpp/libc.h
Line
Count
Source
1
// 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
// TODO: SHARE with pyext
13
1
inline void print_time(double real, double user, double sys) {
14
1
  fprintf(stderr, "real\t%.3f\n", real);
15
1
  fprintf(stderr, "user\t%.3f\n", user);
16
1
  fprintf(stderr, "sys\t%.3f\n", sys);
17
1
}
18
19
Str* realpath(Str* path);
20
21
Str* gethostname();
22
23
int fnmatch(Str* pat, Str* str);
24
25
List<Str*>* glob(Str* pat);
26
27
Tuple2<int, int>* regex_first_group_match(Str* pattern, Str* str, int pos);
28
29
List<Str*>* regex_match(Str* pattern, Str* str);
30
31
int wcswidth(Str* str);
32
int get_terminal_width();
33
34
}  // namespace libc
35
36
#endif  // LIBC_H