Hello Lyu,

Lyu ABE <[EMAIL PROTECTED]> writes:

> I'd like to know how I can retrieve questions, answers, votes, etc. I
> tried to use the "question_info" method, but I do not understand the
> server's reply because I only got a int value.

No, the question_info() method returns a quite complex data
structure. Here is part of its XDR (ONC-RPC) description:

struct response_t {
  response_desc_t r_info_desc;
  external_link_t r_info_link;
};

enum question_status_e { tagging_only = 1, public = 2 };

struct question_t {
  _int32 int q_timestamp;
  question_id_t q_id;
  question_desc_t q_desc;
  date_t q_info_limit_date; /* if set to zero, there is no limit date */
  question_status_e q_info_status;
  response_t q_info_responses<MAX_NUMBER_RESPONSES>;
  int q_info_num_votes;
  int q_info_elected_responses<MAX_NUMBER_RESPONSES>;
};

struct question_info_return_t {
  return_code_t question_info_rc;
  question_t question_info<MAX_NUMBER_IDS>;
};


Roughly speaking, you have a basic structure (question_info_return_t)
that contains a return code (question_info_rc) and an array of question
information (question_info). Each entry of the `question_info' array is
a structure (question_t) that contains the question timestamp, its id,
its description, etc.

question_info() is probably not the simplest RPC to start with. Maybe
Diogene might help you on this.

> My question is not "What am I doing wrong?", but rather "How to properly
> do that?".

Without some code, it is quite difficult to answer such a question.


Yours,
d.
-- 
GPG/PGP key: A3AD7A2A David MENTRE <[EMAIL PROTECTED]>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A


_______________________________________________
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev

Répondre à