-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemit.c
38 lines (30 loc) · 775 Bytes
/
emit.c
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
#include <assert.h>
#include <string.h>
#include <xcb/xcb.h>
#include "ind.h"
#include "globals.h"
#include "emit.h"
void* ni_dummy_get_event(ni_emitter *this);
void ni_dummy_free(ni_emitter *this);
ni_emitter* ni_emitter_new(){
ni_emitter* this = mallocz(sizeof(*this), 2);
this->get_event = &ni_dummy_get_event;
this->destroy = &ni_dummy_free;
return this;
}
void ni_emitter_free(ni_emitter* this){
assert(this != NULL);
this->destroy(this);
this = NULL;
}
void* ni_emitter_get_event(ni_emitter* this){
return this->get_event(this);
}
// Basic emitter implementations
void* ni_dummy_get_event(ni_emitter *this){
char* event= "exit";
return memdupz(event, strlen(event));
}
void ni_dummy_free(ni_emitter *this){
return;
}