do not schedule timer events less than TIMER_RES
[flowgen.git] / common.h
blob9f26df90a92d97ddd184bc2ea4719ce4a1d227e0
1 /*
2 * Copyright (c) 2017 Mohamed Aslan <maslan@sce.carleton.ca>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef COMMON_H
18 #define COMMON_H
21 struct log {
22 enum {
23 LOG_NONE,
24 LOG_CSV
25 } type;
26 union {
27 char *filename;
28 } param;
29 FILE *fd;
32 void log_init(struct log *);
33 void log_free(struct log *);
34 void f_log(struct log *, const char *, ...);
35 void atimer(int, int, unsigned int);
36 void timer(int, int, unsigned int);
38 #endif