1.6 Writing a Basic NLM

The following steps are basic to NLM development, and will produce an NLM that runs on the server. (Code development can become considerably more complex with the increasing complexity of an NLM's functionality.)

  1. Set up the development environment you will use to build, run, and debug the NLM:

  2. Create a subdirectory for the new NLM you are creating.

  3. Write the code for the NLM.

    For a starting NLM, it may be best to use standard ANSI functions so you can get a feel for the core NLM development process without the complications of the NetWare CLIB server API set. When you are ready to move on to multithreaded NLMs with fuller functionality that use a variety of functions in the CLIB family of server-based APIs, see Section 4.1, Developing Multithreaded NLMs.

    Bear in mind at this point that when you are developing more complex NLMs that allocate resources to CLIB threads and require CLIB context to free those resources, it will be extremely important to write the code required to allow the NLM to terminate gracefully with resources properly freed. To review that process, see Section 4.2, Terminating an NLM.

  4. Compile and debug your source code.

  5. Compile and debug the source code as an NLM.

  6. Copy the NLM onto the server and load it to see how well it runs. For fully functional NLMs, make sure this step is done on a server used for development rather than a production server.

  7. Although it is probably not needed with a simple NLM such as this one, time should be allocated at this point for testing. That time will much more than pay for itself.