summaryrefslogtreecommitdiffstats
path: root/procd.h
blob: 6461be66b3180f396af244d699daffaf8aca2036 (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
#ifndef __PROCD_H
#define __PROCD_H

#include <libubox/uloop.h>
#include <libubus.h>
#include <stdio.h>

#define __init __attribute__((constructor))

#define DPRINTF(fmt, ...) do { \
	if (debug) \
		fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
	} while (0)

#define DEBUG(level, fmt, ...) do { \
	if (debug >= level) \
		fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
	} while (0)

extern int debug;
extern char *ubus_socket;
void procd_connect_ubus(void);
void procd_init_service(struct ubus_context *ctx);

#endif