File: sfdo-common.h

package info (click to toggle)
libsfdo 0.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 736 kB
  • sloc: ansic: 6,491; python: 111; makefile: 4
file content (33 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (2)
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
#ifndef SFDO_COMMON_H
#define SFDO_COMMON_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdarg.h>
#include <stddef.h>

// Used to specify that a sequence of characters is null-terminated.
#define SFDO_NT ((size_t)(-1))

struct sfdo_string {
	const char *data; // UTF-8, null-terminated
	size_t len; // In octets, excluding the null terminator
};

enum sfdo_log_level {
	SFDO_LOG_LEVEL_SILENT,
	SFDO_LOG_LEVEL_ERROR,
	SFDO_LOG_LEVEL_INFO,
	SFDO_LOG_LEVEL_DEBUG,
};

typedef void (*sfdo_log_handler_func_t)(
		enum sfdo_log_level level, const char *fmt, va_list args, void *data);

#ifdef __cplusplus
}
#endif

#endif