aboutsummaryrefslogtreecommitdiff
path: root/README
blob: d2c75741e5695f32589404f9cbae0cda3e2edc4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    Description
Magi Library (libmagi) implements Common Gateway Interface.

    Overview
Magi are free and open-source software: legal info is in the 'LICENSE' file.
They are written in ANSI C without any dependecies except for C standard
library.  All source and inner header files are in the 'src' directory.
The 'include' directory is intended to be used in your include environment.
Headers in it contain library interface and its description in comments.
They are in subdirectory 'include/magi', due to their short and simple names.
If you are not about choosing which header to include and just want everything
to be included you can '#include <magi.h>'.
For detailed documentation look into 'man' directory.

    Compiling
Compilation and its options are described in the Makefile.
Running make produces 'build/libmagi.a', which is precompiled library itself,
ready to be statically linked into your project.  In order to install magi
you can run 'make install', and to uninstall run 'make uninstall'.
Since default include (/usr/include), lib (/usr/lib) and man (/usr/share/man)
directories can be not valid for you, don't forget to specify them in either
environment variables or the Makefile itself.

    Examples
Running 'make examples' produces executable for each example in 'examples'.
Descriptions and details are in corresponding source files.

    Usage
magi_request handles incoming request, general workflow is to:
1. prepare request for analysis, setup defaults via magi_request_init;
2. analyse CGI request via magi_parse;
4. do your work, and response request:
   1. specify and send headers (magi_response_...),
   2. response body (through stdout);
5. finally, free memory via magi_request_free.

    Motivation
Web must be fun.