aboutsummaryrefslogtreecommitdiff
path: root/page.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-06-06 03:49:36 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-06-06 03:52:16 +0200
commit5a6c92d69bbb307ca09ac2ecbad54df4f2394bea (patch)
tree4ae024ff5218b5483731467b2e8ddd14c37057df /page.h
parent6e9ce3a25b438a94ad870ba85dd8c9bf8a28e043 (diff)
Implement search
This new feature adds a HTML form on each directory listing that allows to search files recursively, starting from the current user directory. Wildcard patterns are also allowed.
Diffstat (limited to 'page.h')
-rw-r--r--page.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/page.h b/page.h
index bd47138..2554bdc 100644
--- a/page.h
+++ b/page.h
@@ -2,6 +2,7 @@
#define PAGE_H
#include "http.h"
+#include <stddef.h>
struct page_quota
{
@@ -17,6 +18,17 @@ struct page_resource
size_t n_args;
};
+struct page_search
+{
+ struct page_search_result
+ {
+ char *name;
+ } *results;
+
+ const char *root;
+ size_t n;
+};
+
int page_login(struct http_response *r);
int page_style(struct http_response *r);
int page_failed_login(struct http_response *r);
@@ -27,5 +39,6 @@ int page_public(struct http_response *r, const char *res);
int page_share(struct http_response *r, const char *path);
int page_quota_exceeded(struct http_response *r, unsigned long long len,
unsigned long long quota);
+int page_search(struct http_response *r, const struct page_search *s);
#endif /* PAGE_H */