int QP_ipc_next(command, arg1, ..., argm)
         int command;

The C routine QP_ipc_next() retrieves an answer for a goal (command) that was initiated by a previous call to QP_ipc_prepare(). The command is identified by command. It must be the same as the command given to QP_ipc_prepare(). The remaining arguments are variables that will be set by QP_ipc_next() to the values returned as the next answer to the goal. There is one argument for each field in the interface specification that was annotated with -. They must be in left-to-right order. The types of the arguments must correspond to the types declared in the external/3 specification as follows:

             -integer:       int *
             -float:         float *
             -atom:          QP_atom *
             -string:        char **

For a returned value of type string, space must be provided by the calling routine to hold the value returned. The characters of the returned string will be copied over the string passed in.

If an(other) answer to the query has been obtained and the argument parameters have been set accordingly, QP_ipc_next() returns 0. If there are no more answers, it returns -1. If there is an error, it returns -2.

See the example below in ipc-rpc-cpp-exa.