int maapi_query_start(int sock, int thandle, const char *expr,
const char *context_node, int chunk_size,
int initial_offset, enum
confd_query_result_type result_as, int nselect, const char *select,
int nsort, const char *sort);
and User Guide says:
chunk_size How many results to return at a time. If set to 0 a default number will be used.
so, if I have list that has more than 2000 instances inside, and I set chunk_size = 1000, what does maapi_query_result_count returns? 2000 or 1000?
It returns the size of the whole node set, i.e. 2000 in your case. It is useful right after maapi_start_query, it tells you what you should expect. You do not need to call any API function to know how large a particular chunk is - the structure confd_query_result contains field nresults that indicates it.