summaryrefslogtreecommitdiff
path: root/src/disfluid-cache-request.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/disfluid-cache-request.h')
-rw-r--r--src/disfluid-cache-request.h122
1 files changed, 0 insertions, 122 deletions
diff --git a/src/disfluid-cache-request.h b/src/disfluid-cache-request.h
deleted file mode 100644
index 8d6310c..0000000
--- a/src/disfluid-cache-request.h
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef DISFLUID_CACHE_REQUEST_INCLUDED
-# define DISFLUID_CACHE_REQUEST_INCLUDED
-
-struct disfluid_cache_request;
-
-static inline int cache_request_init (struct disfluid_cache_request *request);
-
-static inline
- void cache_request_clear (struct disfluid_cache_request *request);
-
-static inline
- int cache_request_prepare (struct disfluid_cache_request *request,
- const char *method, const char *host,
- const char *path, const char *version);
-
-static inline
- const char *cache_request_method (const struct disfluid_cache_request
- *request);
-
-static inline
- const char *cache_request_path (const struct disfluid_cache_request
- *request);
-
-static inline
- const char *cache_request_host (const struct disfluid_cache_request
- *request);
-
-static inline
- const char *cache_request_version (const struct disfluid_cache_request
- *request);
-
-struct disfluid_cache_request
-{
- char *method;
- char *host;
- char *path;
- char *version;
-};
-
-static inline int
-cache_request_init (struct disfluid_cache_request *request)
-{
- request->method = NULL;
- request->host = NULL;
- request->path = NULL;
- request->version = NULL;
- return 0;
-}
-
-static inline void
-cache_request_clear (struct disfluid_cache_request *request)
-{
- free (request->method);
- free (request->host);
- free (request->path);
- free (request->version);
- request->method = NULL;
- request->host = NULL;
- request->path = NULL;
- request->version = NULL;
-}
-
-static inline int
-cache_request_prepare (struct disfluid_cache_request *request,
- const char *method, const char *host, const char *path,
- const char *version)
-{
- char *my_method = malloc (strlen (method) + 1);
- char *my_host = malloc (strlen (host) + 1);
- char *my_path = malloc (strlen (path) + 1);
- char *my_version = malloc (strlen (version) + 1);
- if (my_method && my_host && my_path && my_version)
- {
- strcpy (my_method, method);
- strcpy (my_host, host);
- strcpy (my_path, path);
- strcpy (my_version, version);
- free (request->method);
- free (request->host);
- free (request->path);
- free (request->version);
- request->method = my_method;
- request->host = my_host;
- request->path = my_path;
- request->version = my_version;
- return 0;
- }
- else
- {
- free (my_method);
- free (my_host);
- free (my_path);
- free (my_version);
- return 1;
- }
-}
-
-static inline const char *
-cache_request_method (const struct disfluid_cache_request *request)
-{
- return request->method;
-}
-
-static inline const char *
-cache_request_path (const struct disfluid_cache_request *request)
-{
- return request->path;
-}
-
-static inline const char *
-cache_request_host (const struct disfluid_cache_request *request)
-{
- return request->host;
-}
-
-static inline const char *
-cache_request_version (const struct disfluid_cache_request *request)
-{
- return request->version;
-}
-
-#endif /* DISFLUID_CACHE_REQUEST_INCLUDED */