void recv_command(char *command) { struct tnt_iter i; tnt_iter_reply(&i, tnt); while (tnt_next(&i)) { struct tnt_reply *r = TNT_IREPLY_PTR(&i); printf("%s: respond %s (op: %"PRIu32", reqid: %"PRIu32", code: %"PRIu32", count: %"PRIu32")\n", command, tnt_strerror(tnt), r->op, r->reqid, r->code, r->count); struct tnt_iter it; tnt_iter_list(&it, TNT_REPLY_LIST(r)); while (tnt_next(&it)) { struct tnt_tuple *tu = TNT_ILIST_TUPLE(&it); print_tuple(tu); } tnt_iter_free(&it); } if (i.status == TNT_ITER_FAIL) fail_tnt_perror("tnt_next"); tnt_iter_free(&i); }
int tc_query_printer(struct tnt_reply *r, void *ptr, char **e) { (void)ptr; (void)e; tc_printf("%s OK, %d rows affected\n", tc_query_op(r), r->count); tc_print_list(TNT_REPLY_LIST(r)); return 0; }