api: move epoll_xxx functions to api.c
This commit is contained in:
parent
4ea40313be
commit
fa10bfc829
@ -1,6 +1,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "api.h"
|
||||||
#include "epoll.h"
|
#include "epoll.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "init.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);
|
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);
|
reflock_tree_init(&_epoll_handle_tree);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
8
src/api.h
Normal file
8
src/api.h
Normal 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_ */
|
||||||
@ -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_ */
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "epoll-init.h"
|
#include "api.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "nt.h"
|
#include "nt.h"
|
||||||
@ -22,7 +22,7 @@ static int _winsock_global_init(void) {
|
|||||||
|
|
||||||
static int _init_once(void) {
|
static int _init_once(void) {
|
||||||
if (_winsock_global_init() < 0 || nt_global_init() < 0 ||
|
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;
|
return -1;
|
||||||
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user