Direct Mode

Webkit hands CGI input to your program in an array and receives CGI output on standard output (stdout). Create a function called wkmain (aEnv, aData) to handle CGI forms input. This function must have the following characteristics:

  1. It must execute quickly, because the web browser client is waiting.
  2. It must write valid HTML code to the file handle nHandle.
  3. It must use the aEnv array to recover environment variables from the calling HTML form.
  4. It must not require user input other than the aEnv and aData arrays.
  5. The program may do other things, such as updating databases or performing lookups, but it must do them quickly.

When linking a CGI-enabled FlagShip program for Batch Mode or Proxy Mode, you need to specify wkmain as your program's main module (by using the -M switch). The linker will find wkmain() in libwebkit.a for you.

Next: Proxy Mode
Previous: Batch Mode
Webkit Index