Loading the Gateway

There are two functionally-identical ways to load a gateway:

The gateway must be a reentrant NLM because it is loaded for each printer agent that the gateway must service. Reentrancy provides the gateway with a mechanism for receiving information from the command line.

To make your gateway code reentrant, you must add the following lines to your Make file:

        reentrant        start           PreMain

where PreMain is the function called by the loader each time your gateway is loaded.

Remember that CLIB prelude code is not automatically called, so unless you call _Prelude (and you only want to call it once), your NLM will not have a CLIB context. Without the CLIB context, you cannot use any call that requires a CLIB context such as malloc until you have called _Prelude.