Skip to content

Commit ed27758

Browse files
committed
libyang UPDATE compatibility macros
Refs #2205
1 parent ef81d2f commit ed27758

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libyang.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ extern "C" {
3737
#include "tree_data.h"
3838
#include "tree_schema.h"
3939

40+
/**
41+
* @brief libyang v3 compatibility macros with v2.
42+
*/
43+
#define ly_strerrcode ly_strerr
44+
#define ly_last_errmsg ly_last_logmsg
45+
#define ly_errcode(ctx) (ly_err_last(ctx) ? ly_err_last(ctx)->err : 0)
46+
#define ly_errmsg(ctx) (ly_err_last(ctx) ? ly_err_last(ctx)->msg : NULL)
47+
#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)
48+
#define ly_vecode(ctx) (ly_err_last(ctx) ? ly_err_last(ctx)->vecode : 0)
49+
4050
/*
4151
* The following headers are supposed to be included explicitly:
4252
* - hash_table.h

0 commit comments

Comments
 (0)