[misc] Add small function to swap pointers

This commit is contained in:
ejurgensen 2017-01-22 23:06:13 +01:00
parent ee32b9cb70
commit 40d50d693b
2 changed files with 11 additions and 0 deletions

View File

@ -569,6 +569,14 @@ trimwhitespace(const char *str)
return out;
}
void
swap_pointers(char **a, char **b)
{
char *t = *a;
*a = *b;
*b = t;
}
uint32_t
djb_hash(const void *data, size_t len)
{

View File

@ -82,6 +82,9 @@ unicode_fixup_string(char *str, const char *fromcode);
char *
trimwhitespace(const char *str);
void
swap_pointers(char **a, char **b);
uint32_t
djb_hash(const void *data, size_t len);