Archived
1
0
Fork 0

docs: added fscrawl

This commit is contained in:
Henrik Hautakoski 2010-11-14 10:44:08 +01:00
parent 2ad92d719e
commit 546a78ad76
2 changed files with 50 additions and 1 deletions

View file

@ -1,7 +1,8 @@
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
ifndef VERBOSE ifndef VERBOSE
QUIET_ASCIIDOC = @echo ' ' GEN $@; QUIET_ASCIIDOC = @echo ' ' GEN $@;

48
docs/fscrawl.txt Normal file
View file

@ -0,0 +1,48 @@
fscrawl - Filesystem traversal
------------------------------
API for traversing a filesystem tree/subtree.
Data Structures
~~~~~~~~~~~~~~~
* `fscrawl_t`
An abstract datatype, holds information about where in the filesystem you currently are etc.
* `fs_entry`
Holds information about a node on the filesystem
`name`::
name of the entry (filename, directory name)
`base`::
The base directory where `name` exists in.
`dir`::
zero if the entry is a file, non zero otherwise
Functions
~~~~~~~~~
`fsc_open()`::
Tries to open 'path' for traversal. +
Returns `NULL` if 'path' can't be open, otherwise a valid pointer to a `fscrawl_t` that can be passed to other fsc_* functions.
`fsc_close()`::
Closes a `fscrawl_t` and free's all memory used by the structure.
`fsc_cpy()`::
Returns a copy of 'ent'.
`fsc_read()`::
Reads one entry from `fscrawl_t` and returns it. +
If the traversal is completed. the function closes `fscrawl_t` and returns `NULL`.
+
NOTE: if you need to safe the `fs_entry` structure this function returns, make a call to `fsc_cpy()` +
otherwise you data will be overwritten by further calls to `fsc_read()`.