summaryrefslogtreecommitdiff
path: root/include/dom/functypes.h
blob: 18b644a94ba842d9c24d3c8b60c5a92e85478553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * This file is part of libdom.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
 */

#ifndef dom_functypes_h_
#define dom_functypes_h_

#include <stddef.h>
#include <inttypes.h>

/**
 * Type of allocation function for DOM implementation
 */
typedef void *(*dom_alloc)(void *ptr, size_t size, void *pw);

/**
 * Severity levels for dom_msg function, based on syslog(3)
 */
enum {
	DOM_MSG_DEBUG,
	DOM_MSG_INFO,
	DOM_MSG_NOTICE,
	DOM_MSG_WARNING,
	DOM_MSG_ERROR,
	DOM_MSG_CRITICAL,
	DOM_MSG_ALERT,
	DOM_MSG_EMERGENCY
};

/**
 * Type of DOM message function
 */
typedef void (*dom_msg)(uint32_t severity, void *ctx, const char *msg, ...);

#endif