Rename functions in data.h and adapt ifdef - quark - quark web server | |
git clone git://git.suckless.org/quark | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit db127723c67534d5693fc033f19c855a403d1447 | |
parent a94b15814cf5729a377dd23c7961f183c6884b59 | |
Author: Laslo Hunhold <[email protected]> | |
Date: Fri, 28 Aug 2020 23:46:12 +0200 | |
Rename functions in data.h and adapt ifdef | |
Signed-off-by: Laslo Hunhold <[email protected]> | |
Diffstat: | |
M data.c | 4 ++-- | |
M data.h | 13 +++++-------- | |
M main.c | 4 ++-- | |
3 files changed, 9 insertions(+), 12 deletions(-) | |
--- | |
diff --git 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 | |
@@ -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 | |
@@ -50,9 +50,9 @@ serve(int infd, const struct sockaddr_storage *in_sa, const s… | |
} 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); | |
} | |
} | |