api: move epoll_xxx functions to api.c

This commit is contained in:
Bert Belder 2017-09-25 19:57:17 +02:00
parent 4ea40313be
commit fa10bfc829
4 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,7 @@
#include <stdint.h>
#include <stdlib.h>
#include "api.h"
#include "epoll.h"
#include "error.h"
#include "init.h"
@ -16,7 +17,7 @@ static inline ep_port_t* _handle_tree_node_to_port(
return container_of(tree_node, ep_port_t, handle_tree_node);
}
int epoll_global_init(void) {
int api_global_init(void) {
reflock_tree_init(&_epoll_handle_tree);
return 0;
}

8
src/api.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef EPOLL_API_H_
#define EPOLL_API_H_
#include "internal.h"
EPOLL_INTERNAL int api_global_init(void);
#endif /* EPOLL_API_H_ */

View File

@ -1,8 +0,0 @@
#ifndef EPOLL_EPOLL_INIT_H_
#define EPOLL_EPOLL_INIT_H_
#include "internal.h"
EPOLL_INTERNAL int epoll_global_init(void);
#endif /* EPOLL_EPOLL_INIT_H_ */

View File

@ -1,6 +1,6 @@
#include <stdbool.h>
#include "epoll-init.h"
#include "api.h"
#include "error.h"
#include "init.h"
#include "nt.h"
@ -22,7 +22,7 @@ static int _winsock_global_init(void) {
static int _init_once(void) {
if (_winsock_global_init() < 0 || nt_global_init() < 0 ||
reflock_global_init() < 0 || epoll_global_init() < 0)
reflock_global_init() < 0 || api_global_init() < 0)
return -1;
_initialized = true;