Source Code - Netscape ENTERPRISE SERVER 6.0 - NSAPI PROGRAMMER GUIDE Manual

Nsapi
Table of Contents

Advertisement

PathCheck Example

Source Code

The source code for this example is in
plugins/nsapi/examples
#include "nsapi.h"
/* Set to NULL to prevent problems with people not calling
acf-init */
static char **hosts = NULL;
#include <stdio.h>
#include "base/daemon.h"
#include "base/util.h"
#include "frame/log.h"
#include "frame/protocol.h" /* protocol_status */
/* The longest line we'll allow in an access control file */
#define MAX_ACF_LINE 256
/* Used to free static array on restart */
#ifdef __cplusplus
extern "C"
#endif
NSAPI_PUBLIC void acf_free(void *unused)
{
register int x;
for(x = 0; hosts[x]; ++x)
FREE(hosts);
hosts = NULL;
}
#ifdef __cplusplus
extern "C"
#endif
NSAPI_PUBLIC int acf_init(pblock *pb, Session *sn, Request *rq)
{
/* Parameter */
char *acf_file = pblock_findval("file", pb);
/* Working variables */
int num_hosts;
FILE *f;
char err[MAGNUS_ERROR_LEN];
char buf[MAX_ACF_LINE];
220
Netscape Enterprise Server NSAPI Programmer's Guide • November 2001
subdirectory within the server root directory.
FREE(hosts[x]);
in the
pcheck.c
nsapi/examples/
/* util_sprintf */
/* log_error */
or

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise server 6.0

Table of Contents