Skip to content

Commit

Permalink
libyang UPDATE compatibility macros
Browse files Browse the repository at this point in the history
Refs #2205
  • Loading branch information
michalvasko committed Mar 28, 2024
1 parent ef81d2f commit ed27758
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libyang.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ extern "C" {
#include "tree_data.h"
#include "tree_schema.h"

/**
* @brief libyang v3 compatibility macros with v2.
*/
#define ly_strerrcode ly_strerr
#define ly_last_errmsg ly_last_logmsg
#define ly_errcode(ctx) (ly_err_last(ctx) ? ly_err_last(ctx)->err : 0)
#define ly_errmsg(ctx) (ly_err_last(ctx) ? ly_err_last(ctx)->msg : NULL)
#define ly_errpath(ctx) (ly_err_last(ctx) ? (ly_err_last(ctx)->data_path ? ly_err_last(ctx)->data_path : ly_err_last(ctx)->schema_path) : NULL)
#define ly_vecode(ctx) (ly_err_last(ctx) ? ly_err_last(ctx)->vecode : 0)

/*
* The following headers are supposed to be included explicitly:
* - hash_table.h
Expand Down

0 comments on commit ed27758

Please sign in to comment.