forked from Cpp2Rust/cpp2rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsrc.cpp
More file actions
30 lines (20 loc) · 866 Bytes
/
Copy pathsrc.cpp
File metadata and controls
30 lines (20 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2022-present INESC-ID.
// Distributed under the MIT license that can be found in the LICENSE file.
#include <cstdlib>
void f1() { return std::abort(); }
void f2(void *a0) { return free(a0); }
void *f3(size_t a0) { return malloc(a0); }
void *f4(void *a0, size_t a1) { return realloc(a0, a1); }
void *f5(size_t nmemb, size_t size) { return calloc(nmemb, size); }
char *f6(const char *name) { return getenv(name); }
int f7(const char *name, const char *value, int overwrite) {
return setenv(name, value, overwrite);
}
void *f8(const void *key, const void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *)) {
return bsearch(key, base, nmemb, size, compar);
}
void f9(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *)) {
return qsort(base, nmemb, size, compar);
}