raise ubusd priority to speed up message processing under load
[project/procd.git] / procd.h
1 #ifndef __PROCD_H
2 #define __PROCD_H
3
4 #include <libubox/uloop.h>
5 #include <libubus.h>
6 #include <stdio.h>
7
8 #define __init __attribute__((constructor))
9
10 #define DPRINTF(fmt, ...) do { \
11         if (debug) \
12                 fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
13         } while (0)
14
15 #define DEBUG(level, fmt, ...) do { \
16         if (debug >= level) \
17                 fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
18         } while (0)
19
20 extern int debug;
21 extern char *ubus_socket;
22 void procd_connect_ubus(void);
23 void procd_init_service(struct ubus_context *ctx);
24
25 #endif