aboutsummaryrefslogtreecommitdiff
path: root/src/request.h
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2019-09-13 18:50:34 +0300
committerAleksey Veresov <aleksey@veresov.pro>2019-09-13 18:50:34 +0300
commitad6188f911af896c9c77e9215bea3c5c2a4e6cc3 (patch)
tree158b4015ff302f72fe2bb8a0ee3d5441ffb66719 /src/request.h
downloadmagi-ad6188f911af896c9c77e9215bea3c5c2a4e6cc3.tar
magi-ad6188f911af896c9c77e9215bea3c5c2a4e6cc3.tar.xz
magi-ad6188f911af896c9c77e9215bea3c5c2a4e6cc3.zip
Project name and license are added. Minor changes.
Diffstat (limited to 'src/request.h')
-rw-r--r--src/request.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/request.h b/src/request.h
new file mode 100644
index 0000000..4957099
--- /dev/null
+++ b/src/request.h
@@ -0,0 +1,52 @@
+#ifndef MAGI_INCLUDED_REQUEST_H
+#define MAGI_INCLUDED_REQUEST_H
+
+#include "field.h"
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Request
+ */
+struct magi_request {
+ struct magi_field_list *fields;
+ struct magi_cookie_list *cookies;
+ char *method;
+ char *uri;
+ char *document_root;
+ char *document_uri;
+ char *script_name;
+ char *script_filename;
+ char *remote_addr;
+ char *remote_port;
+ char *server_addr;
+ char *server_name;
+ char *server_port;
+ char *server_protocol;
+ char *server_software;
+ struct magi_param_list *http_params;
+}; /* http[s]://{server_name}[:{server_port}]{script_name}[?...] */
+
+
+/* Common Request Handling */
+/*
+ * Destroys request; request is not valid after destruction.
+ */
+void magi_request_destroy(struct magi_request *request);
+
+/* CGI Request Handling */
+/*
+ * Constructs request using environment variables and standart I/O;
+ * Returns null if succeed, otherwise error code.
+ */
+int magi_request_build_cgi(
+ struct magi_request *request,
+ /* Callback will be used only for fields loaded via multipart. */
+ /* Null callback disables callback system. */
+ void (*callback)(struct magi_field *field, char *buffer, int len),
+ int max_post
+);
+
+/* TODO: FastCGI Request Handling */
+
+
+#endif