pathname.c File Reference

#include "nsd.h"

Defines

#define isslash(c)   ((c) == '/' || (c) == '\\')

Functions

int Ns_PathIsAbsolute (char *path)
char * Ns_NormalizePath (Ns_DString *dsPtr, char *path)
char * Ns_MakePath (Ns_DString *dest,...)
char * Ns_LibPath (Ns_DString *dest,...)
char * Ns_BinPath (Ns_DString *dest,...)
char * Ns_HomePath (Ns_DString *dest,...)
char * Ns_ModulePath (Ns_DString *dest, char *server, char *module,...)
int NsTclModulePathObjCmd (ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])

Define Documentation

#define isslash (  )     ((c) == '/' || (c) == '\\')


Function Documentation

char* Ns_BinPath ( Ns_DString *  dest,
  ... 
)

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

Ns_BinPath --

Returns the path where AOLserver binaries exist, with varargs appended to it with slashes between each, stopping at null arg.

Results: dest->string

Side effects: Appends to dest.

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

char* Ns_HomePath ( Ns_DString *  dest,
  ... 
)

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

Ns_HomePath --

Build a path relative to AOLserver's home dir.

Results: dest->string

Side effects: Appends to dest.

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

char* Ns_LibPath ( Ns_DString *  dest,
  ... 
)

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

Ns_LibPath --

Returns the path where AOLserver libraries exist, with varargs appended to it with slashes between each, stopping at null arg.

Results: dest->string

Side effects: Appends to dest.

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

char* Ns_MakePath ( Ns_DString *  dest,
  ... 
)

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

Ns_MakePath --

Append all the elements together with slashes between them. Stop at NULL.

Results: dest->string

Side effects: Will append to dest.

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

char* Ns_ModulePath ( Ns_DString *  dest,
char *  server,
char *  module,
  ... 
)

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

Ns_ModulePath --

Append a path to dest: server-home/?servers/hserver?/?modules/hmodule?/... server and module may both be null.

Results: dest->string

Side effects: Appends to dest.

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

char* Ns_NormalizePath ( Ns_DString *  dsPtr,
char *  path 
)

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

Ns_NormalizePath --

Remove "..", "." from paths.

Results: dsPtr->string

Side effects: Will append to dsPtr. Assumes an absolute path.

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

Move past leading slash(es)

Move to next slash

There's a "..", so wipe out one path backwards.

There's something non-null and not ".".

If what remains is an empty string, change it to "/".

int Ns_PathIsAbsolute ( char *  path  ) 

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

Ns_PathIsAbsolute --

Boolean: is the path absolute?

Results: NS_TRUE if it is, NS_FALSE if not.

Side effects: None.

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

int NsTclModulePathObjCmd ( ClientData  arg,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *CONST  objv[] 
)

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

NsTclModulePathObjCmd --

Implements ns_modulepath command; basically a wrapper around Ns_ModulePath.

Results: Tcl result.

Side effects: None (deprecated)

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


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