mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -13,9 +13,9 @@
|
|||
static void* s_libregex;
|
||||
static pthread_mutex_t s_libregex_lock;
|
||||
|
||||
static int (*s_regcomp)(regex_t*, const char*, int);
|
||||
static int (*s_regexec)(const regex_t*, const char*, size_t, regmatch_t[], int);
|
||||
static size_t (*s_regerror)(int, const regex_t*, char*, size_t);
|
||||
static int (*s_regcomp)(regex_t*, char const*, int);
|
||||
static int (*s_regexec)(regex_t const*, char const*, size_t, regmatch_t[], int);
|
||||
static size_t (*s_regerror)(int, regex_t const*, char*, size_t);
|
||||
static void (*s_regfree)(regex_t*);
|
||||
|
||||
static void ensure_libregex()
|
||||
|
@ -24,9 +24,9 @@ static void ensure_libregex()
|
|||
if (!s_libregex) {
|
||||
s_libregex = __dlopen("libregex.so", RTLD_NOW).value();
|
||||
|
||||
s_regcomp = reinterpret_cast<int (*)(regex_t*, const char*, int)>(__dlsym(s_libregex, "regcomp").value());
|
||||
s_regexec = reinterpret_cast<int (*)(const regex_t*, const char*, size_t, regmatch_t[], int)>(__dlsym(s_libregex, "regexec").value());
|
||||
s_regerror = reinterpret_cast<size_t (*)(int, const regex_t*, char*, size_t)>(__dlsym(s_libregex, "regerror").value());
|
||||
s_regcomp = reinterpret_cast<int (*)(regex_t*, char const*, int)>(__dlsym(s_libregex, "regcomp").value());
|
||||
s_regexec = reinterpret_cast<int (*)(regex_t const*, char const*, size_t, regmatch_t[], int)>(__dlsym(s_libregex, "regexec").value());
|
||||
s_regerror = reinterpret_cast<size_t (*)(int, regex_t const*, char*, size_t)>(__dlsym(s_libregex, "regerror").value());
|
||||
s_regfree = reinterpret_cast<void (*)(regex_t*)>(__dlsym(s_libregex, "regfree").value());
|
||||
}
|
||||
pthread_mutex_unlock(&s_libregex_lock);
|
||||
|
@ -34,19 +34,19 @@ static void ensure_libregex()
|
|||
|
||||
extern "C" {
|
||||
|
||||
int __attribute__((weak)) regcomp(regex_t* reg, const char* pattern, int cflags)
|
||||
int __attribute__((weak)) regcomp(regex_t* reg, char const* pattern, int cflags)
|
||||
{
|
||||
ensure_libregex();
|
||||
return s_regcomp(reg, pattern, cflags);
|
||||
}
|
||||
|
||||
int __attribute__((weak)) regexec(const regex_t* reg, const char* string, size_t nmatch, regmatch_t pmatch[], int eflags)
|
||||
int __attribute__((weak)) regexec(regex_t const* reg, char const* string, size_t nmatch, regmatch_t pmatch[], int eflags)
|
||||
{
|
||||
ensure_libregex();
|
||||
return s_regexec(reg, string, nmatch, pmatch, eflags);
|
||||
}
|
||||
|
||||
size_t __attribute__((weak)) regerror(int errcode, const regex_t* reg, char* errbuf, size_t errbuf_size)
|
||||
size_t __attribute__((weak)) regerror(int errcode, regex_t const* reg, char* errbuf, size_t errbuf_size)
|
||||
{
|
||||
ensure_libregex();
|
||||
return s_regerror(errcode, reg, errbuf, errbuf_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue