diff options
Diffstat (limited to 'gisi')
-rw-r--r-- | gisi/message.c | 6 | ||||
-rw-r--r-- | gisi/message.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gisi/message.c b/gisi/message.c index 51672e68..01f3a277 100644 --- a/gisi/message.c +++ b/gisi/message.c @@ -24,6 +24,7 @@ #endif #include <stdint.h> +#include <string.h> #include <errno.h> #include <arpa/inet.h> #include <glib.h> @@ -45,6 +46,11 @@ int g_isi_msg_error(const GIsiMessage *msg) return msg ? -msg->error : -EINVAL; } +const char *g_isi_msg_strerror(const GIsiMessage *msg) +{ + return strerror(-g_isi_msg_error(msg)); +} + uint8_t g_isi_msg_resource(const GIsiMessage *msg) { return msg && msg->addr ? msg->addr->spn_resource : 0; diff --git a/gisi/message.h b/gisi/message.h index d71b8db4..95348f8c 100644 --- a/gisi/message.h +++ b/gisi/message.h @@ -50,6 +50,7 @@ typedef struct _GIsiMessage GIsiMessage; int g_isi_msg_version_major(const GIsiMessage *msg); int g_isi_msg_version_minor(const GIsiMessage *msg); int g_isi_msg_error(const GIsiMessage *msg); +const char *g_isi_msg_strerror(const GIsiMessage *msg); uint8_t g_isi_msg_resource(const GIsiMessage *msg); uint16_t g_isi_msg_object(const GIsiMessage *msg); |