summaryrefslogtreecommitdiff
path: root/procd.h
blob: 66a08e2d125f7f765f252e19fce0b988e7424030 (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
#ifndef __PROCD_H
#define __PROCD_H

#include <libubox/uloop.h>
#include <libubox/utils.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