cSvn-UI for SVN Repositories

cGit-UI – is a web interface for Subversion (SVN) Repositories. cSvn CGI script is writen in C and therefore it's fast enough

6 Commits   0 Branches   2 Tags
author: kx <kx@radix.pro> 2023-03-24 03:55:33 +0300 committer: kx <kx@radix.pro> 2023-03-24 03:55:33 +0300 commit: bfc1508d26c89c9a36d2d9a827fe2c4ed128884d parent: c836ae3775cf72f17e0b7e3792d156fdb389bee3
Commit Summary:
Version 0.1.4
Diffstat:
1 file changed, 36 insertions, 0 deletions
diff --git a/csvncgi/http.h b/csvncgi/http.h
new file mode 100644
index 0000000..6304b64
--- /dev/null
+++ b/csvncgi/http.h
@@ -0,0 +1,52 @@
+
+#ifndef    __HTTP_H
+#define    __HTTP_H
+
+#define HTTP_VERSION  "2"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+typedef void (*http_errfunc)( const char *fmt, ... );
+
+extern void http_error( const char *fmt, ... ) __attribute__((format (printf,1,2)));
+extern http_errfunc http_fatal; /* Default Fatal Error Function == http_error() */
+
+
+extern const signed char hexval_table[256];
+static inline unsigned int hexval( unsigned char c )
+{
+  return hexval_table[c];
+}
+/*******************************************************************
+  Convert two consecutive hexadecimal digits into a char. Return a
+  negative value on error. Don't run over the end of short strings.
+ */
+static inline int hex2chr( const char *s )
+{
+  unsigned int val = hexval(s[0]);
+  return (val & ~0xf) ? val : (val << 4) | hexval(s[1]);
+}
+
+extern char *url_decode_mem( const char *url, int len );
+extern char *url_percent_decode( const char *encoded );
+extern char *url_decode_parameter_name( const char **query );
+extern char *url_decode_parameter_value( const char **query );
+extern void http_parse_querystring( const char *txt, void (*fn)(const char *name, const char *value) );
+
+
+extern char *fmt( const char *format,... ) __attribute__((format (printf,1,2)));
+extern char *fmtalloc( const char *format,... ) __attribute__((format (printf,1,2)));
+
+
+extern char *http_date( time_t t );
+extern const char *http_status( int status_code );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* __HTTP_H */