Sun Java System Web Server 7.0 Update 6 NSAPI Developer's Guide

USE_NSAPI_VERSION() Macro

Plug-in 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 the resulting value 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 as 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 6–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 ONE Application Server 7.0 

3.1 

Sun ONE Web Server 6.1 

3.2 

Sun Java System Web Proxy Server 4.0 

3.3 

Sun Java System Web Server 7.0 Update 6 

3.3 

Do not 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 7.0 Update 6:

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

See Also

NSAPI_RUNTIME_VERSION() Macro, NSAPI_VERSION() Macro