﻿# CGIUTL

_Updated September 2014; see History_

**xcall CGIUTL, opcode \{,param1, param2 ...\}**

CGIUTL contains several utility functions which are very handy when writing CGI (traditional or FastCGI) programs. The calling format and parameters beyond _opcode_ depend on the value of _opcode_, so we will consider each case separately, with the value of _opcode_ inserted into the syntax examples below. _Opcode _itself can be any numeric format. See [A-Shell as a CGI Engine](a-shellasacgiweb.md) for more details on using CGIUTL.  

| **Opcode** | **Value** | **Function** |
|------|------|------|
| CGIOP\_STATUS | 0 | [CGI Status](cgistatus.md) |
| CGIOP\_STDIN | 1 | [Retrieve stdin](retrievestdin.md) |
| CGIOP\_GETPAR  | 2 | [Retrieve Single Parameter](retrievesingleparameter.md) |
| CGIOP\_MRGOUT | 3 | [Copy Disk File to stdout](copydiskfiletostdout.md) |
| CGIOP\_STDOUT | 4 | [Write String to stdout](writestringtostdout.md) |
| CGIOP\_GETENV | 5 | [Retrieve envvar into envdef](retrieveenvvarintoenvdef.md) |
| CGIOP\_MRGFIL | 6 | [Generate Custom File from Template](generatecustom.md) |
| CGIOP\_GETPARX | 7 | [Retrieve Multiple Parameters](retrievemultipleparameters.md) |
| CGIOP\_UNESCAPE | 9 | [Convert HTML Escapes](unescapeuri-encodedstring.md) |
| CGIOP\_GETREQ | 10 | [Support FastCGI](supportfastcgi.md) |
| CGIOP\_GETPARARY | 12 | [Retrieve Params into Ordered Map](retrieveparams.md) |
| **Definition file: [ashell.def](ashell.md)** | | 



**History**

2018 February, A-Shell 6.5.1628:  Remove limit on number of subroutine parameters.

2014 September, A-Shell 6.1.1394:  Add opcode CGIOP\_GETPARARY.

2014 September, A-Shell 6.1.1390:  Add support for [FastCGI](fastcgi.md) and opcodes CGIOP\_UNESCAPE and CGIOP\_GETREQ.