Combine XAlloc.[ch] into XUtils.[ch]

This commit is contained in:
Benny Baumann
2020-10-15 00:56:22 +02:00
parent 872e542f4e
commit 5e4b182616
10 changed files with 46 additions and 72 deletions

View File

@ -7,11 +7,22 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
#include <assert.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include "Macros.h"
void fail(void) ATTR_NORETURN;
void* xMalloc(size_t size);
void* xCalloc(size_t nmemb, size_t size);
void* xRealloc(void* ptr, size_t size);
#define String_startsWith(s, match) (strncmp((s),(match),strlen(match)) == 0)
#define String_contains_i(s1, s2) (strcasestr(s1, s2) != NULL)