libdom
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/*
2 * This file is part of libdom test suite.
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
6 */
7
8#ifndef utils_h_
9#define utils_h_
10
11#include <stddef.h>
12#include <inttypes.h>
13
14#ifndef max
15#define max(a,b) ((a)>(b)?(a):(b))
16#endif
17
18#ifndef min
19#define min(a,b) ((a)<(b)?(a):(b))
20#endif
21
22#ifndef SLEN
23/* Calculate length of a string constant */
24#define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */
25#endif
26
27#ifndef UNUSED
28#define UNUSED(x) ((x) = (x))
29#endif
30
31void *myrealloc(void *ptr, size_t len, void *pw);
32void mymsg(uint32_t severity, void *ctx, const char *msg, ...);
33
34char *domts_strndup(const char *s, size_t len);
35
36#endif
37
void * myrealloc(void *ptr, size_t len, void *pw)
Definition utils.c:15
char * domts_strndup(const char *s, size_t len)
Definition utils.c:35
void mymsg(uint32_t severity, void *ctx, const char *msg,...)
Definition utils.c:22