[ Previous ] [ Contents ] [ Index ] [ Next ]

Loadable C Module Development

The AOLserver can be extended by loading one or more C modules dynamically. You write these modules using your ordinary C code development environment and compile them as shared library modules on Unix or Dynamic Link Libraries on Windows NT, as described below.


The Commercial service level does not support the C API..




Each module must include an initialization routine that typically calls one or more AOLserver C API functions for registering the procedures within your module. The procedures within your module can handle URLs (operation procedures) or do other special-purpose functions. To register a C function in your module with the AOLserver, pass a pointer to your function as an argument to one of the AOLserver C API registration functions.

Module initialization functions can also set up any state required by your functions. For example, the AOLserver database services module's initialization routine creates a pool of database connections.

Creating a Loadable Module

To create a dynamically loadable C module, compile your code and then link the resulting object module into a shared library module on Unix or as a DLL on NT.

Your C source code file must include the ns.h header file, which can be found in the include subdirectory of the AOLserver home directory. To compile and link your module, use the following instructions specific to your architecture.


Compile on Alpha OSF 3.0 or 3.2 platform:

Compile on HP/UX 10.0 platform:

Compile on SGI IRIX 5.3 platform:

Compile on Solaris 2.4 platform:
To compile on Solaris, you will need the development packages SUNWarc, SUNWbtool, SUNWesu, SUNWhea, SUNWlibm, SUNWtoo, and SUNWsprot.


Compile on Linux*

platform:


Compile on Windows NT 3.5:
On Windows NT, you must compile your module into a Dynamic Link Library, or DLL.

See the Microsoft C/C++ Language Quick Reference for details. Alternatively, you can write a module definition (.DEF) file to export your initialization routine. See Chapter 50 of the Microsoft Win32 Programmer's Reference for details.

Using a Loadable Module

For each shared library or DLL you would like to have the AOLserver load at startup time, add an entry in the virtual server's Module section in the AOLserver configuration file. The format of a load entry is a nickname for the module, an equal sign, the filename of the module, and, optionally, the name of an initialization routine in parentheses. For example:

    mymodule=mymodule.so(MyInit)

Module filenames typically end in .so on Unix platforms and .dll on NT. If the module filename is not an absolute path name, the AOLserver searches for the module in the bin subdirectory of the AOLserver home directory. The name of the initialization routine defaults to "Ns_ModuleInit".

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.