diff --git a/docs/Makefile b/docs/Makefile index 873427b..4522997 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,7 +1,8 @@ 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 QUIET_ASCIIDOC = @echo ' ' GEN $@; diff --git a/docs/fscrawl.txt b/docs/fscrawl.txt new file mode 100644 index 0000000..6e53edd --- /dev/null +++ b/docs/fscrawl.txt @@ -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()`.