Skip to content

Commit

Permalink
Document Ns_TrieWalk C API.
Browse files Browse the repository at this point in the history
  • Loading branch information
dossy committed Nov 16, 2010
1 parent 022b009 commit 646c258
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions doc/Ns_UrlSpecific.3
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,22 @@ void *
void
\fBNs_UrlSpecificSet\fR(\fIchar *server, char *method, char *url,
int id, void *data, int flags, void (*deletefunc) (void *)\fR)
.sp
int
\fBNs_TrieWalk\fR(\fIid, callback, userdata\fR)
.BE

.SH ARGUMENTS
.AS void *userdata
.AP int id in
Handle from Ns_UrlSpecificAlloc.

.AP int (*callback) in
The callback function to invoke on every node in the trie.

.AP void *userdata in/out
A pointer that is passed in to the callback along with the node data.

.SH DESCRIPTION
.PP
These functions allow you to store URL-specific data in memory for later
Expand Down Expand Up @@ -173,6 +187,13 @@ already has an operation registered for it causes the previous operation's delet
procedure to be called. You can override this behavior by adding the
NS_OP_NODELETE flag.

.TP
\fBNs_TrieWalk\fR traverses a trie, invoking a callback function on each node passing in the node data and a user data pointer. If the callback returns something other than NS_OK, the walk terminates immediately. The callback should have the following signature:

.CS
int (*callback)(const void *data, void *userdata)
.CE

.SH "SEE ALSO"
nsd(1), info(n)

Expand Down

0 comments on commit 646c258

Please sign in to comment.