123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #include <regex.h>
- #include <shlib-compat.h>
- #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
- char *loc1 __attribute__ ((nocommon));
- char *loc2 __attribute__ ((nocommon));
- compat_symbol (libc, loc1, loc1, GLIBC_2_0);
- compat_symbol (libc, loc2, loc2, GLIBC_2_0);
- char *locs __attribute__ ((nocommon));
- compat_symbol (libc, locs, locs, GLIBC_2_0);
- int
- weak_function attribute_compat_text_section
- step (const char *string, const char *expbuf)
- {
- regmatch_t match;
- expbuf += __alignof (regex_t *);
- expbuf -= (expbuf - ((const char *) 0)) % __alignof__ (regex_t *);
- if (__regexec ((const regex_t *) expbuf, string, 1, &match, REG_NOTEOL)
- == REG_NOMATCH)
- return 0;
- loc1 = (char *) string + match.rm_so;
- loc2 = (char *) string + match.rm_eo;
- return 1;
- }
- compat_symbol (libc, step, step, GLIBC_2_0);
- int
- weak_function attribute_compat_text_section
- advance (const char *string, const char *expbuf)
- {
- regmatch_t match;
- expbuf += __alignof__ (regex_t *);
- expbuf -= (expbuf - ((const char *) 0)) % __alignof__ (regex_t *);
- if (__regexec ((const regex_t *) expbuf, string, 1, &match, REG_NOTEOL)
- == REG_NOMATCH
-
- || match.rm_so != 0)
- return 0;
- loc2 = (char *) string + match.rm_eo;
- return 1;
- }
- compat_symbol (libc, advance, advance, GLIBC_2_0);
- #endif
|