-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathts.h
61 lines (54 loc) · 1.29 KB
/
ts.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#ifndef TS_H
#define TS_H
//////////////////////////////////////
#include <assert.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
//////////////////////////////////////
#include "module/def.h"
#include "module/module.h"
#include "module/require.h"
#include "uptime/include/uptime/uptime.h"
//////////////////////////////////////
enum ts_log_mode_t {
TS_LOG_MODE_NONE = 1,
TS_LOG_MODE_ERROR,
TS_LOG_MODE_INFO,
TS_LOG_MODE_DEBUG,
TS_LOG_MODES_QTY,
};
module(ts) {
define(ts, CLIB_MODULE);
enum ts_log_mode_t log_mode;
int pid;
int (*GetPID)();
void (*info)(char *);
void (*debug)(char *);
void (*error)(char *);
unsigned long (*ts)(void);
unsigned long (*ms)(void);
unsigned long (*uptime)(void);
};
int ts_init(module(ts) * exports);
void ts_deinit(module(ts) * exports);
unsigned long __ts_ts(void);
unsigned long __ts_ms(void);
exports(ts) {
.log_mode = TS_LOG_MODE_NONE,
.init = ts_init,
.deinit = ts_deinit,
.ts = __ts_ts,
.ms = __ts_ms,
.uptime = getUptime,
.pid = -1,
};
#define ts_m module(ts)
#endif