summaryrefslogtreecommitdiff
path: root/src/context.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-05-09 11:29:04 +0300
committerDaniel Stone <daniel@fooishbar.org>2012-05-09 15:30:49 +0100
commit4aef083e46568664708f57b5aaa356e858c1f4de (patch)
treed0f97a1a416a468d96caa0836a20fbf3a9852d0d /src/context.c
parent64aa5c95ed4507f88aa00d397e793af73dd812f4 (diff)
downloadxorg-lib-libxkbcommon-4aef083e46568664708f57b5aaa356e858c1f4de.tar.gz
Contextualize XkbFile IDs
Currently the IDs are assigned from a static variable inside CreateXKBFile. This can lead to some unpleasantness with threads, so maintain the counter in the context instead. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/context.c')
-rw-r--r--src/context.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/context.c b/src/context.c
index 2aaee35..190a1c5 100644
--- a/src/context.c
+++ b/src/context.c
@@ -35,6 +35,9 @@ struct xkb_context {
char **include_paths;
int num_include_paths;
int size_include_paths;
+
+ /* xkbcomp needs to assign sequential IDs to XkbFile's it creates. */
+ int file_id;
};
/**
@@ -149,6 +152,12 @@ xkb_context_include_path_get(struct xkb_context *context, unsigned int idx)
return context->include_paths[idx];
}
+int
+xkb_context_take_file_id(struct xkb_context *context)
+{
+ return context->file_id++;
+}
+
/**
* Take a new reference on the context.
*/