59int strtok_ri(
const char *restrict str,
char delim, Py_ssize_t *restrict strLen,
80uint32_t
strncount(
const char *restrict str,
char c,
size_t len);
89#define UNUSED(x) (void)(x)
91#define STR_HELPER(x) #x
97#define STR(x) STR_HELPER(x)
109void *
memchr2(
const void *buf,
int c1,
int c2,
size_t len);
int strtok_ri(const char *restrict str, char delim, Py_ssize_t *restrict strLen, occurrence_t *restrict lastoccurrence)
Version of strtok_r that doesn't modify the original string.
Definition common.c:17
uint32_t strncount(const char *restrict str, char c, size_t len)
Counts the number of occurrences of c in str.
Definition common.c:48
void percent_encode_char(char *restrict out, char c)
Writes a percent encoded character to a buffer.
Definition common.c:42
void * memchr2(const void *buf, int c1, int c2, size_t len)
Finds the first occurrence of either c1 or c2 in buf.
Definition common.c:59
An occurrence of a token in a string.
Definition common.h:30
size_t len
The length of the token.
Definition common.h:40
const char * token
The token that was found.
Definition common.h:35