From: Florian Forster Date: Thu, 19 Nov 2009 11:28:13 +0000 (+0100) Subject: Added the mt_reply_status function. X-Git-Tag: librouteros-0.1.0~21 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6c3403d470cd185d209de32d14f5272e87b4ca38;p=routeros-api.git Added the mt_reply_status function. --- diff --git a/src/main.c b/src/main.c index 3f844ab..a0d6dcc 100644 --- a/src/main.c +++ b/src/main.c @@ -673,6 +673,13 @@ int mt_reply_num (const mt_reply_t *r) /* {{{ */ return (ret); } /* }}} int mt_reply_num */ +const char *mt_reply_status (const mt_reply_t *r) /* {{{ */ +{ + if (r == NULL) + return (NULL); + return (r->status); +} /* }}} char *mt_reply_status */ + const char *mt_reply_param_key_by_index (const mt_reply_t *r, /* {{{ */ unsigned int index) { diff --git a/src/routeros_api.h b/src/routeros_api.h index 7995c28..63fd7d9 100644 --- a/src/routeros_api.h +++ b/src/routeros_api.h @@ -51,9 +51,13 @@ int mt_query (mt_connection_t *c, const mt_reply_t *mt_reply_next (const mt_reply_t *r); int mt_reply_num (const mt_reply_t *r); +const char *mt_reply_status (const mt_reply_t *r); + /* Receiving reply parameters */ -const char *mt_reply_param_key_by_index (const mt_reply_t *r, unsigned int index); -const char *mt_reply_param_val_by_index (const mt_reply_t *r, unsigned int index); +const char *mt_reply_param_key_by_index (const mt_reply_t *r, + unsigned int index); +const char *mt_reply_param_val_by_index (const mt_reply_t *r, + unsigned int index); const char *mt_reply_param_val_by_key (const mt_reply_t *r, const char *key); /* vim: set ts=2 sw=2 noet fdm=marker : */