Blob


1 /*
2 * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 *
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.
7 *
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.
15 */
17 #include <sys/time.h>
19 #include <event2/event.h>
20 #include <event2/event_compat.h>
21 #include <event2/event_struct.h>
22 #include <event2/buffer.h>
23 #include <event2/buffer_compat.h>
24 #include <event2/bufferevent.h>
25 #include <event2/bufferevent_struct.h>
26 #include <event2/bufferevent_compat.h>
28 static void
29 rw_cb(struct bufferevent *bev, void *d)
30 {
31 return;
32 }
34 static void
35 err_cb(struct bufferevent *bev, short err, void *d)
36 {
37 return;
38 }
40 int
41 main(void)
42 {
43 struct bufferevent *bev;
45 event_init();
47 if ((bev = bufferevent_new(0, rw_cb, rw_cb, err_cb, NULL)) == NULL)
48 return 1;
50 evbuffer_unfreeze(bev->input, 0);
51 evbuffer_unfreeze(bev->output, 1);
53 bufferevent_free(bev);
55 return 0;
56 }