Archived
1
0
Fork 0

docs: added path

This commit is contained in:
Henrik Hautakoski 2010-11-14 11:36:59 +01:00
parent 4bf08bdc7f
commit c6309dd0af
2 changed files with 36 additions and 1 deletions

View file

@ -2,7 +2,7 @@
ASCIIDOC = asciidoc ASCIIDOC = asciidoc
HTML_DOCS = index.html api-notify.html strbuf.html xalloc.html rbtree.html \ HTML_DOCS = index.html api-notify.html strbuf.html xalloc.html rbtree.html \
log.html fscrawl.html log.html fscrawl.html path.html
ifndef VERBOSE ifndef VERBOSE
QUIET_ASCIIDOC = @echo ' ' GEN $@; QUIET_ASCIIDOC = @echo ' ' GEN $@;

35
docs/path.txt Normal file
View file

@ -0,0 +1,35 @@
Path - Path handling routines
-----------------------------
This module implements common routines for dealing with paths.
Functions
~~~~~~~~~
`is_abspath()`::
Returns a non zero value if 'path' is an absolute path. zero otherwise.
`is_file()`::
Returns a non zero value if 'path' is a regular file. zero otherwise.
`is_dir()`::
Returns a non zero value if 'path' is a directory. zero otherwise.
`path_normalize`::
Returns a string that contains the normalized full path specified by 'base', 'name' and 'dir'. +
The function performs this type of checks/manipulation:
+
--
* If the first character in 'base' is "~" it is expanded to the users home directory.
* Sequences of delimiters are replaced with one delimiter.
* Makes sure 'base' is an absolute path.
* 'name' must not contain an delimiter.
* terminates the string with an delimiter if 'dir' is non-zero.
--
+
Returns `NULL` if 'base' is not an absolute path or 'name' contains a delimiter.