commit db127723c67534d5693fc033f19c855a403d1447
Author: Laslo Hunhold <[email protected]>
AuthorDate: Fri Aug 28 23:46:12 2020 +0200
Commit: Laslo Hunhold <[email protected]>
CommitDate: Fri Aug 28 23:46:12 2020 +0200
Rename functions in data.h and adapt ifdef
Signed-off-by: Laslo Hunhold <[email protected]>
diff --git a/data.c b/data.c
index 3794416..46486aa 100644
--- a/data.c
+++ b/data.c
@@ -39,7 +39,7 @@ suffix(int t)
}
enum status
-resp_dir(int fd, const struct response *res)
+data_send_dirlisting(int fd, const struct response *res)
{
enum status ret;
struct dirent **e;
@@ -87,7 +87,7 @@ cleanup:
}
enum status
-resp_file(int fd, const struct response *res)
+data_send_file(int fd, const struct response *res)
{
FILE *fp;
enum status ret = 0;
diff --git a/data.h b/data.h
index 92e5ad6..12aacc8 100644
--- a/data.h
+++ b/data.h
@@ -1,13 +1,10 @@
/* See LICENSE file for copyright and license details. */
-#ifndef RESP_H
-#define RESP_H
-
-#include <sys/stat.h>
-#include <sys/types.h>
+#ifndef DATA_H
+#define DATA_H
#include "http.h"
-enum status resp_dir(int, const struct response *);
-enum status resp_file(int, const struct response *);
+enum status data_send_dirlisting(int, const struct response *);
+enum status data_send_file(int, const struct response *);
-#endif /* RESP_H */
+#endif /* DATA_H */
diff --git a/main.c b/main.c
index 81cabde..2946a0b 100644
--- a/main.c
+++ b/main.c
@@ -50,9 +50,9 @@ serve(int infd, const struct sockaddr_storage *in_sa, const
struct server *srv)
} else {
/* send data */
if (c.res.type == RESTYPE_FILE) {
- resp_file(c.fd, &c.res);
+ data_send_file(c.fd, &c.res);
} else if (c.res.type == RESTYPE_DIRLISTING) {
- resp_dir(c.fd, &c.res);
+ data_send_dirlisting(c.fd, &c.res);
}
}