Use libffi for library calls

Use libffi to portably call arbitrary functions at runtime, rather than
forcing library functions to use a standard prototype.
This commit is contained in:
Nunuhara Cabbage
2020-01-07 22:48:29 -08:00
parent f1cc9082b3
commit 6a4d11f3de
30 changed files with 1425 additions and 1522 deletions
+6
View File
@@ -235,6 +235,12 @@ void string_erase(struct string **s, int index)
(*s)->text[(*s)->size] = '\0';
}
void string_clear(struct string *s)
{
s->size = 0;
s->text[0] = '\0';
}
int string_find(const struct string *haystack, const struct string *needle)
{
int c = 0;