X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=err.h;h=e8b977bc45f2735c8e2057b32eeeeb1d85834004;hp=078fdbec1ef8f5dcce0809ad1fc9bd05324c6e29;hb=4f629ff865b978a7ea399776ff6af83c6428bda0;hpb=4aa3fd762e2190a4e418581cf24446484d0b7df5 diff --git a/err.h b/err.h index 078fdbe..e8b977b 100644 --- a/err.h +++ b/err.h @@ -41,13 +41,16 @@ * and UCI_TRAP_RESTORE. */ #define UCI_HANDLE_ERR(ctx) do { \ + DPRINTF("ENTER: %s\n", __func__); \ int __val = 0; \ + ctx->errno = 0; \ if (!ctx) \ return UCI_ERR_INVAL; \ if (!ctx->internal) \ __val = setjmp(ctx->trap); \ ctx->internal = false; \ if (__val) { \ + DPRINTF("LEAVE: %s, ret=%d\n", __func__, __val); \ ctx->errno = __val; \ return __val; \ } \ @@ -73,10 +76,16 @@ memcpy(ctx->trap, __old_trap, sizeof(ctx->trap)); \ } while(0) +/** + * UCI_INTERNAL: Do an internal call of a public API function + * + * Sets Exception handling to passthrough mode. + * Allows API functions to change behavior compared to public use + */ #define UCI_INTERNAL(func, ctx, ...) do { \ ctx->internal = true; \ func(ctx, __VA_ARGS__); \ -} while (0); +} while (0) /* * check the specified condition.