2015-08-07 12:14:19 +00:00
2016-03-15 03:47:12 +00:00
2016-03-13 06:35:02 +00:00
2014-05-14 09:50:17 +00:00
2014-05-14 09:50:17 +00:00
2014-05-14 09:50:17 +00:00
2014-05-14 09:50:17 +00:00
2015-07-07 11:01:31 +00:00
2016-01-25 18:56:11 +00:00
2016-03-13 06:35:02 +00:00
2016-02-11 19:22:30 +00:00
2015-08-06 19:35:18 +00:00
2016-03-12 08:54:36 +00:00
2016-03-12 08:54:36 +00:00
2014-11-23 23:58:33 +00:00
2015-11-12 20:00:51 +00:00
2014-05-12 15:43:26 +00:00
2014-07-13 12:34:40 +00:00
2014-12-15 15:11:19 +00:00
2014-04-16 21:58:53 +00:00
2015-08-04 09:38:03 +00:00

Synopsis

kcgi is an open source CGI and FastCGI library for C web applications. It is minimal, secure, and auditable. This is the README file for display with GitHub, which hosts a read-only source repository of the project. To keep up to date with the current stable release of kcgi, visit the kcgi website.

Code Example

Implementing a CGI or FastCGI application with kcgi is easy. One usually specifies the pages recognised by the application and the known form inputs. kcgi then parses the request.

#include <stdint.h>
#include <stdlib.h>
#include <kcgi.h>
 
int main(void) {
  struct kreq r;
  const char *page = "index";
  if (KCGI_OK != khttp_parse(&r, NULL, 0, &page, 1, 0))
	return(EXIT_FAILURE);
  khttp_head(&r, kresps[KRESP_STATUS], "%s", khttps[KHTTP_200]);
  khttp_head(&r, kresps[KRESP_CONTENT_TYPE], "%s", kmimetypes[r.mime]);
  khttp_body(&r);
  khttp_puts(&r, "Hello, world!");
  khttp_free(&r);
  return(EXIT_SUCCESS);
}

Installation

kcgi works out-of-the-box with modern UNIX systems. Simply download the latest version's source archive (or download the project from GitHub), compile with make, then sudo make install. Your operating system might already have kcgi as one of its third-party libraries: check to make sure!

API Reference

See the kcgi(3) manpage for complete library documentation.

Tests

The system contains a full regression suite and is also built to work with AFL. See the kcgi website for details on how to deploy (or write) tests.

License

All sources use the ISC (like OpenBSD) license. See the LICENSE.md file for details.

S
Description
No description provided
Readme ISC
2.2 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 96.2%
Makefile 2.1%
CSS 1.3%
C++ 0.2%
Gnuplot 0.2%