Skip to content

Commit

Permalink
lib: add 2string for zapi nhg result codes
Browse files Browse the repository at this point in the history
Add a utility '2string' function for daemon nhg result codes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
  • Loading branch information
Mark Stapp committed Apr 15, 2021
1 parent 53c42c8 commit 90b0718
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/zclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,29 @@ enum zclient_send_status {
ZCLIENT_SEND_BUFFERED = 1
};

static inline const char *
zapi_nhg_notify_owner2str(enum zapi_nhg_notify_owner note)
{
const char *ret = "UNKNOWN";

switch (note) {
case ZAPI_NHG_FAIL_INSTALL:
ret = "ZAPI_NHG_FAIL_INSTALL";
break;
case ZAPI_NHG_INSTALLED:
ret = "ZAPI_NHG_INSTALLED";
break;
case ZAPI_NHG_REMOVE_FAIL:
ret = "ZAPI_NHG_REMOVE_FAIL";
break;
case ZAPI_NHG_REMOVED:
ret = "ZAPI_NHG_REMOVED";
break;
}

return ret;
}

static inline const char *
zapi_rule_notify_owner2str(enum zapi_rule_notify_owner note)
{
Expand Down

0 comments on commit 90b0718

Please sign in to comment.