aboutsummaryrefslogtreecommitdiff
path: root/src/core/file.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-01-19 17:13:40 -0800
committerGarrett D'Amore <garrett@damore.org>2018-01-20 15:03:12 -0800
commit7dbc9ae4fef34c6fd836b939bd559e54b8008b72 (patch)
tree54660fef8a4a597c067a18953a295f1cfdb96cf0 /src/core/file.h
parent338706c2420ce3e51b546a6ba2574e10346a511b (diff)
downloadnng-7dbc9ae4fef34c6fd836b939bd559e54b8008b72.tar.gz
nng-7dbc9ae4fef34c6fd836b939bd559e54b8008b72.tar.bz2
nng-7dbc9ae4fef34c6fd836b939bd559e54b8008b72.zip
fixes #216 HTTP server side API refactoring, directory serving support
This changes the backend (internal) HTTP API to provide a much more sensible handler scheme, where the handlers are opaque objects and we can allocate a handler for different types of tasks. We've also added support serving up directories of static content, and added code to validate that the directory serving is working as intended. This is a key enabling step towards the public API.
Diffstat (limited to 'src/core/file.h')
-rw-r--r--src/core/file.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/file.h b/src/core/file.h
index b45aae61..7969ae5f 100644
--- a/src/core/file.h
+++ b/src/core/file.h
@@ -76,4 +76,12 @@ extern char *nni_file_join(const char *, const char *);
// The returned value generally is within the supplied path name.
extern const char *nni_file_basename(const char *);
+// nni_file_is_file returns true if the path references a file. It returns
+// false if an error occurs, or the path references something else.
+extern bool nni_file_is_file(const char *);
+
+// nni_file_is_dir returns true if the path references a directroy. It returns
+// false if an error occurs, or the path references something else.
+extern bool nni_file_is_dir(const char *);
+
#endif // CORE_FILE_H