X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontext.h;h=d5fa117b22b03b09ec54fdd1188cf47380bf1872;hb=ef81d04eef4b1a60ff42bd9ccbe2918b0a5420ec;hp=ead25086f2883288b33008dbaa9328f7eb965ac4;hpb=d7b39f6ffbe9b46181c5597b0d0e7373eb2e9070;p=platform%2Fupstream%2Flibxkbcommon.git diff --git a/src/context.h b/src/context.h index ead2508..d5fa117 100644 --- a/src/context.h +++ b/src/context.h @@ -27,6 +27,7 @@ #define CONTEXT_H #include "atom.h" +#include "messages-codes.h" struct xkb_context { int refcnt; @@ -45,13 +46,20 @@ struct xkb_context { struct atom_table *atom_table; + /* Used and allocated by xkbcommon-x11, free()d with the context. */ + void *x11_atom_cache; + /* Buffer for the *Text() functions. */ char text_buffer[2048]; size_t text_next; unsigned int use_environment_names : 1; + unsigned int use_secure_getenv : 1; }; +char * +xkb_context_getenv(struct xkb_context *ctx, const char *name); + unsigned int xkb_context_num_failed_include_paths(struct xkb_context *ctx); @@ -107,16 +115,31 @@ xkb_context_sanitize_rule_names(struct xkb_context *ctx, * format is supplied without arguments. Not supplying it would still * result in an error, though. */ +#define xkb_log_with_code(ctx, level, verbosity, msg_id, fmt, ...) \ + xkb_log(ctx, level, verbosity, "[XKB-%03d] " fmt, \ + msg_id, ##__VA_ARGS__) +#define log_dbg_with_code(ctx, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_DEBUG, 0, (id), __VA_ARGS__) #define log_dbg(ctx, ...) \ xkb_log((ctx), XKB_LOG_LEVEL_DEBUG, 0, __VA_ARGS__) +#define log_info_with_code(ctx, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_INFO, 0, (id), __VA_ARGS__) #define log_info(ctx, ...) \ xkb_log((ctx), XKB_LOG_LEVEL_INFO, 0, __VA_ARGS__) +#define log_warn_with_code(ctx, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_WARNING, 0, (id), __VA_ARGS__) #define log_warn(ctx, ...) \ - xkb_log((ctx), XKB_LOG_LEVEL_WARNING, 0, __VA_ARGS__) + xkb_log((ctx), XKB_LOG_LEVEL_WARNING, 0, __VA_ARGS__) +#define log_err_with_code(ctx, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_ERROR, 0, (id), __VA_ARGS__) #define log_err(ctx, ...) \ - xkb_log((ctx), XKB_LOG_LEVEL_ERROR, 0, __VA_ARGS__) + xkb_log((ctx), XKB_LOG_LEVEL_ERROR, 0, __VA_ARGS__) +#define log_wsgo_with_code(ctx, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_CRITICAL, 0, (id), __VA_ARGS__) #define log_wsgo(ctx, ...) \ xkb_log((ctx), XKB_LOG_LEVEL_CRITICAL, 0, __VA_ARGS__) +#define log_vrb_with_code(ctx, vrb, id, ...) \ + xkb_log_with_code((ctx), XKB_LOG_LEVEL_WARNING, (vrb), (id), __VA_ARGS__) #define log_vrb(ctx, vrb, ...) \ xkb_log((ctx), XKB_LOG_LEVEL_WARNING, (vrb), __VA_ARGS__)