diff options
Diffstat (limited to 'src/cgi.h')
-rw-r--r-- | src/cgi.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/cgi.h b/src/cgi.h new file mode 100644 index 0000000..2aa34cf --- /dev/null +++ b/src/cgi.h @@ -0,0 +1,37 @@ +/** + * This CGI program renders the oper.io blog + * Copyright (C) 2019 Aaron Ball <nullspoon@oper.io> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#define QS_MAX 256 + +struct querystring { + char* qs; + int pos; +}; + +void cgi_print_header(char*, int); + +char* cgi_remote_ip(); + +char* cgi_user_agent(); + +int cgi_read_qs(struct querystring*, char*); + +int cgi_qs_get_val(struct querystring*, char**, char*); |