Make some functions public.

This commit is contained in:
2018-08-10 18:39:26 -07:00
parent b0c2eb5a5e
commit 4a058384c1
4 changed files with 32 additions and 13 deletions

View File

@@ -416,3 +416,15 @@ void* libab_unwrap_param(libab_ref_vec* vec, size_t index) {
libab_ref_free(&temp);
return data;
}
void libab_sanitize(char* to, const char* from, size_t buffer_size) {
size_t index = 0;
while (*from && index < (buffer_size - 2)) {
if (*from == '+' || *from == '*' || *from == '\\' ||
*from == '|' || *from == '[' || *from == ']' || *from == '(' ||
*from == ')')
to[index++] = '\\';
to[index++] = *(from++);
}
to[index] = '\0';
}