Shadow Network Framework  0.0.2-alpha
C Server Library for Shadow Network Framework
Loading...
Searching...
No Matches
epoll.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////
2///
3/// \file epoll.h
4/// This file is used to define functions related to epoll
5/// that would be used mainly in network.c
6///
7/// \warning Do not use any functions inside this file outside of
8/// **network.c**, unless you know what you're doing.
9///
10///////////////////////////////////////////////////////////////////
11
12#ifndef epoll_h
13#define epoll_h
14
15#include <SNF/SNF.h>
16#include <SNF/network.h>
17
18/// @brief Describes the amount of file descriptors to be handled
19extern int SNF_NFDS;
20/// @brief Defines Epoll's file descriptor.
21extern int SNF_EPOLLFD;
22
23/// @brief Initializes the Epoll
24extern void snf_epoll_init();
25/// @brief Add's a file descriptor to be handled by epoll
26/// @param FD The File descriptor to be added
27/// @return The result :
28/// * **0** Success
29/// * **1** Fail
30extern int snf_epoll_add(int FD);
31/// @brief removes a file descriptor from being handled by epoll
32/// @param fd The File descriptor to be removed
33extern void snf_epoll_del(int fd);
34/// @brief Fetches the awaiting **Epoll Events**
35/// @return The result of the wait
36/// @note - This function will block depending on epoll_wait (set with a timeout of 10 ms)
37/// @note - the awaiting **Epoll Events** will be put in \ref SNF_EPOLL_EVENTS
38extern int snf_epoll_getList();
39
40#endif
Main Header FileThis File Calls for all the header files exisitng in this library,...
int snf_epoll_add(int FD)
Add's a file descriptor to be handled by epoll.
int SNF_NFDS
Describes the amount of file descriptors to be handled.
void snf_epoll_init()
Initializes the Epoll.
int SNF_EPOLLFD
Defines Epoll's file descriptor.
int snf_epoll_getList()
Fetches the awaiting Epoll Events
void snf_epoll_del(int fd)
removes a file descriptor from being handled by epoll
This file Defines everything related to networking.