summaryrefslogtreecommitdiff
path: root/src/context.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-16 13:33:09 +0300
committerRan Benita <ran234@gmail.com>2012-09-16 15:20:18 +0300
commite670d084a6b4431de2ef3b5395c1473ba4b73725 (patch)
treec54a61abedd5a9e83623bf785d20ede5d49877c4 /src/context.c
parent09a4f2ca89a0ee1e30782fc86312c9806cd86386 (diff)
downloadxorg-lib-libxkbcommon-e670d084a6b4431de2ef3b5395c1473ba4b73725.tar.gz
include: improve file-not-found error reporting
Only report it once, and not only for rules. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/context.c')
-rw-r--r--src/context.c16
1 files changed, 16 insertions, 0 deletions
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)
{