Revision 507372bb common/common.c

View differences:

common/common.c
1 1
/*
2
 * Common functions (mostly init stuff) for GRAPES
2
 * Common functions (mostly init stuff) for NAPA
3 3
 */
4 4

  
5 5
#include	<stdio.h>
......
9 9
#include	<event2/event.h>
10 10

  
11 11

  
12
#include	"grapes.h"
13
#include	"grapes_log.h"
12
#include	"napa.h"
13
#include	"napa_log.h"
14 14

  
15 15
struct event_base *eventbase = NULL;
16 16

  
......
22 22
#endif
23 23

  
24 24
/** Initialize the software. This should be called FIRST */
25
void grapesInit(void *event2_base) {
25
void napaInit(void *event2_base) {
26 26
	eventbase = event2_base;
27 27
#if 0
28 28
	/* Won't need this for normal operation */
......
31 31
#endif
32 32
}
33 33

  
34
void grapesYield() {
34
void napaYield() {
35 35
	event_base_loop(eventbase, EVLOOP_ONCE);
36 36
}
37 37

  
......
56 56
}
57 57

  
58 58

  
59
HANDLE grapesSchedulePeriodic(const struct timeval *start, double frequency, void(*cb)(HANDLE handle, void *arg), void *cbarg) {
59
HANDLE napaSchedulePeriodic(const struct timeval *start, double frequency, void(*cb)(HANDLE handle, void *arg), void *cbarg) {
60 60
	struct timeval t = { 0,0 };
61 61
	if (start) t = *start;
62 62
	struct periodic *h = malloc(sizeof(struct periodic));
......
70 70
	return h;
71 71
}
72 72

  
73
void grapesStopPeriodic(HANDLE h) {
73
void napaStopPeriodic(HANDLE h) {
74 74
	struct periodic *p = h;
75 75
	p->frequency = 0.0;
76 76
}

Also available in: Unified diff