Sun Java System Web Server 6.1 SP12 NSAPI Programmer's Guide

USE_NSAPI_VERSION

Plugin developers can define the USE_NSAPI_VERSION macro before including the nsapi.h header file to request a particular version of NSAPI. The requested NSAPI version is encoded by multiplying the major version number by 100 and then adding this to the minor version number. For example, the following code requests NSAPI 3.2 features:

#define USE_NSAPI_VERSION 302 /* We want NSAPI 3.2 (Web Server 6.1) */
#include "nsapi.h"

To develop a plug-in that is compatible across multiple server versions, define USE_NSAPI_VERSION to the highest NSAPI version supported by all of the target server versions.

The following table lists server versions and the highest NSAPI version supported by each:

Table 7–2 NSAPI Versions Supported by Different Servers

Server Version  

NSAPI Version  

iPlanet Web Server 4.1 

3.0 

iPlanet Web Server 6.0 

3.1 

Netscape Enterprise Server 6.0 

3.1 

Netscape Enterprise Server 6.1 

3.1 

Sun Java System Application Server 7.0 

3.1 

Sun Java System Web Server 6.1 

3.2 

It is an error to request a version of NSAPI higher than the highest version supported by the nsapi.h header that the plug-in is being compiled against. Additionally, to use USE_NSAPI_VERSION, you must compile against an nsapi.h header file that supports NSAPI 3.2 or higher.

Syntax

int USE_NSAPI_VERSION

Example

The following code can be used when building a plug-in designed to work with iPlanet Web Server 4.1 and Sun Java System Web Server 6.1:

#define USE_NSAPI_VERSION 300 /* We want NSAPI 3.0 (Web Server 4.1) */
#include "nsapi.h"

See Also

NSAPI_RUNTIME_VERSION, NSAPI_VERSION