path.h File Reference

#include <libc.h>

Go to the source code of this file.


#define __CONVEN_PATH_H__   1
#define PATHOPT_CATWD   (1<<0u)
#define PATHOPT_SIMPLIFY   (1<<1u)
#define PATHOPT_DEBUG   (1<<2u)


typedef int(* t_path_gate_fn )(char *npath, int *gate_returned)


char ** path_split (char *path, char sep)
int path_simplify (char *path)
int userland_path_gate (char *npath, int *gate_returned)
char * path_treat (char *path, u_int32_t opts, char *wd, t_path_gate_fn path_gate, int *gate_returned, char *s)

Define Documentation

#define __CONVEN_PATH_H__   1

#define PATHOPT_CATWD   (1<<0u)

catenates workdir

#define PATHOPT_DEBUG   (1<<2u)

debug info is printed

#define PATHOPT_SIMPLIFY   (1<<1u)

simplify path

Typedef Documentation

typedef int(* t_path_gate_fn)(char *npath, int *gate_returned)

Function Documentation

int path_simplify char *  path  ) 

simplifies path - removes /./ or // returns 0 if OK else -1 and fills errno

char** path_split char *  path,
char  sep

splits a path in pieces e.g: "//foo//bar" becomes {"", "", "foo", "", "bar", NULL} returns NULL if a memory problem was encountered

char* path_treat char *  path,
u_int32_t  opts,
char *  wd,
t_path_gate_fn  path_gate,
int *  gate_returned,
char *  s

treat a path before any operations on it - should be called before any path lookup: (see options).

If OK returns newly allocated pointer, else returns NULL and errno filled.

path  input path
opts  options
wd  work directory
path_gate  or NULL (should set errno)
s  comment for debug

int userland_path_gate char *  npath,
int *  gate_returned

Generated on Wed May 24 23:05:54 2006 for LSE/OS by  doxygen 1.4.6