From e670d084a6b4431de2ef3b5395c1473ba4b73725 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 16 Sep 2012 13:33:09 +0300 Subject: include: improve file-not-found error reporting Only report it once, and not only for rules. Signed-off-by: Ran Benita --- src/context.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/context.c') diff --git a/src/context.c b/src/context.c index af9fb51..b116884 100644 --- a/src/context.c +++ b/src/context.c @@ -132,6 +132,12 @@ xkb_context_num_include_paths(struct xkb_context *ctx) return darray_size(ctx->includes); } +unsigned int +xkb_context_num_failed_include_paths(struct xkb_context *ctx) +{ + return darray_size(ctx->failed_includes); +} + /** * Returns the given entry in the context's include path, or NULL if an * invalid index is passed. @@ -145,6 +151,16 @@ xkb_context_include_path_get(struct xkb_context *ctx, unsigned int idx) return darray_item(ctx->includes, idx); } +const char * +xkb_context_failed_include_path_get(struct xkb_context *ctx, + unsigned int idx) +{ + if (idx >= xkb_context_num_failed_include_paths(ctx)) + return NULL; + + return darray_item(ctx->failed_includes, idx); +} + unsigned xkb_context_take_file_id(struct xkb_context *ctx) { -- cgit v1.2.1