From 7d47df8425792ff76e469259242c0d57011bc244 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 27 Nov 2009 09:07:04 +0100 Subject: [PATCH] librouteros(3): Added some details about the semantic of callbacks. --- doc/librouteros.pod | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/librouteros.pod b/doc/librouteros.pod index 9e083a7..8a98f87 100644 --- a/doc/librouteros.pod +++ b/doc/librouteros.pod @@ -67,7 +67,8 @@ called B: int callback (ros_connection_t *c, const ros_reply_t *r, void *user_data); The reply is broken into parts (or "sentences") and passed to the callback -function as a linked list of type B. The callback uses a couple of +function as a linked list of type B. It is only called once for +query and must traverse the linked list itself. The callback uses a couple of helper functions to iterate over this list and fetch parameters as necessary. The first and second arguments are objects representing the connection and the @@ -80,6 +81,10 @@ The value returned by the callback function will be returned by B to the calling code. To distinguish from error codes returned by B upon errors, use negative values in the callback function. +Because the entire reply is read back from the connection before the callback +function is called, it is legal for the callback function to send out another +query. + General queries / replies are handled using the following functions: =over 4 -- 2.11.0