summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2020-04-30 11:40:58 +0200
committerAki <please@ignore.pl>2020-04-30 11:40:58 +0200
commitbf70b8424ff43a65d642df1474b68e9a4b9d4717 (patch)
treebcc33414b4d6db14317a13fab0e2f2e932eb32f0
parentab0f572b4cdd4b48aa28129f703e7e6347829e8a (diff)
downloadplop-bf70b8424ff43a65d642df1474b68e9a4b9d4717.zip
plop-bf70b8424ff43a65d642df1474b68e9a4b9d4717.tar.gz
plop-bf70b8424ff43a65d642df1474b68e9a4b9d4717.tar.bz2
Added basic docs comments
-rw-r--r--plop.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/plop.c b/plop.c
index c0f9919..eb27125 100644
--- a/plop.c
+++ b/plop.c
@@ -4,6 +4,12 @@
#include <sys/types.h>
#include <unistd.h>
+/// Tries to create, bind and start listening on INET server socket.
+/// \param node Hostname
+/// \param service Port
+/// \return File descriptor of the socket or -1 in case of an error
+/// \see getaddrinfo(3)
+// TODO: Handle UNIX sockets
int make_server(const char * node, const char * service)
{
struct addrinfo hints = {
@@ -50,6 +56,10 @@ int make_server(const char * node, const char * service)
return server;
}
+/// Standard entry point for the program.
+/// \param argc Argument count
+/// \param argv Argument array
+/// \return Error code
int main(int argc, char ** argv)
{
if (2 != argc)