urlspace.c File Reference

#include "nsd.h"

Data Structures

struct  Node
struct  Trie
struct  Branch
struct  Channel
struct  Junction

Functions

void NsInitUrlSpace (void)
int Ns_UrlSpecificAlloc (void)
void Ns_UrlSpecificSet (char *server, char *method, char *url, int id, void *data, int flags, void(*deletefunc)(void *))
void * Ns_UrlSpecificGet (char *server, char *method, char *url, int id)
void * Ns_UrlSpecificGetFast (char *server, char *method, char *url, int id)
void * Ns_UrlSpecificGetExact (char *server, char *method, char *url, int id, int flags)
void * Ns_UrlSpecificDestroy (char *server, char *method, char *url, int id, int flags)
int Ns_ServerSpecificAlloc (void)
void Ns_ServerSpecificSet (char *handle, int id, void *data, int flags, void(*deletefunc)(void *))
void * Ns_ServerSpecificGet (char *handle, int id)
void * Ns_ServerSpecificDestroy (char *handle, int id, int flags)

Function Documentation

int Ns_ServerSpecificAlloc ( void   ) 

----------------------------------------------------------------------

Ns_ServerSpecificAlloc --

Allocate a unique integer to be used with Ns_ServerSpecific* calls

Results: An integer handle

Side effects: None

----------------------------------------------------------------------

void* Ns_ServerSpecificDestroy ( char *  handle,
int  id,
int  flags 
)

----------------------------------------------------------------------

Ns_ServerSpecificDestroy --

Destroy server-specific data.

Results: None.

Side effects: Will remove data from urlspace.

----------------------------------------------------------------------

void* Ns_ServerSpecificGet ( char *  handle,
int  id 
)

----------------------------------------------------------------------

Ns_ServerSpecificGet --

Get server-specific data.

Results: User server-specific data.

Side effects: None.

----------------------------------------------------------------------

void Ns_ServerSpecificSet ( char *  handle,
int  id,
void *  data,
int  flags,
void(*)(void *)  deletefunc 
)

----------------------------------------------------------------------

Ns_ServerSpecificSet --

Set server-specific data

Results: None

Side effects: See Ns_UrlSpecificSet

----------------------------------------------------------------------

int Ns_UrlSpecificAlloc ( void   ) 

----------------------------------------------------------------------

Ns_UrlSpecificAlloc --

Allocate a unique ID to create a seperate virtual URL-space.

Results: An integer handle

Side effects: nextid will be incremented; don't call after server startup.

----------------------------------------------------------------------

void* Ns_UrlSpecificDestroy ( char *  server,
char *  method,
char *  url,
int  id,
int  flags 
)

----------------------------------------------------------------------

Ns_UrlSpecificDestroy --

Delete some urlspecific data.

flags can be NS_OP_NODELETE, NS_OP_NOINHERIT and/or NS_OP_RECURSE

Results: None

Side effects: Will remove data from urlspace; don't call this after server startup.

----------------------------------------------------------------------

void* Ns_UrlSpecificGet ( char *  server,
char *  method,
char *  url,
int  id 
)

----------------------------------------------------------------------

Ns_UrlSpecificGet --

Find URL-specific data in the subspace identified by id that the passed-in URL matches

Results: A pointer to user data, set with Ns_UrlSpecificSet

Side effects: None

----------------------------------------------------------------------

void* Ns_UrlSpecificGetExact ( char *  server,
char *  method,
char *  url,
int  id,
int  flags 
)

----------------------------------------------------------------------

Ns_UrlSpecificGetExact -- Similar to Ns_UrlSpecificGet, but does not support URL inheritance

Results: See Ns_UrlSpecificGet

Side effects: None

----------------------------------------------------------------------

void* Ns_UrlSpecificGetFast ( char *  server,
char *  method,
char *  url,
int  id 
)

----------------------------------------------------------------------

Ns_UrlSpecificGetFast --

Similar to Ns_UrlSpecificGet, but doesn't support wildcards; on the other hand, it's a lot faster.

Results: See Ns_UrlSpecificGet

Side effects: None

----------------------------------------------------------------------

void Ns_UrlSpecificSet ( char *  server,
char *  method,
char *  url,
int  id,
void *  data,
int  flags,
void(*)(void *)  deletefunc 
)

----------------------------------------------------------------------

Ns_UrlSpecificSet --

Associate data with a set of URLs matching a wildcard, or that are simply sub-URLs.

Flags can be NS_OP_NOINHERIT or NS_OP_NODELETE.

Results: None

Side effects: Will set data in the urlspace trie.

----------------------------------------------------------------------

void NsInitUrlSpace ( void   ) 

----------------------------------------------------------------------

NsInitUrlSpace --

Initialize the urlspace API.

Results: None.

Side effects: None.

----------------------------------------------------------------------


Generated on Tue Sep 4 19:58:56 2007 by  doxygen 1.5.1