CGI programming support (OMCGI)

The OMCGI library contains one macro and two OmniMark functions to simplify writing CGI programs with OmniMark. The functions allow you to retrieve and decode CGI input data and CGI-related environment variables.

The CRLF macro allows you to easily use %13#%10#, instead of %n, to insert new lines in your CGI programs. Using the CRLF macro instead of %n ensures the portability of your code across platforms. You need to declare #process-output as binary-mode so that all systems will properly interpret the %13#%10# new line sequence.

You must also declare #process-input stream as unbuffered. If you do not, on some systems your CGI program will hang. #process-input is bound to standard input and used by your CGI program to receive POST data. This leaves #main-input free to receive a file name as an OmniMark command-line name if necessary.

Usage Note

To use OMCGI, you must include the following code at the beginning of your program:

  declare #process-input  has unbuffered
  declare #process-output has unbuffered
  
  include "omcgi.xin"