summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-08-21 17:28:22 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-08-21 17:28:22 +0930
commitf05f20fd203afdadbcd571023ed31638ccda1f88 (patch)
tree446bc55b6c366db886285444be2e6d8801ba6345 /misc.c
parent1aad2a5d8ede9fe5212a4e6087fbe34aa170ac54 (diff)
downloadxorg-app-xkbcomp-f05f20fd203afdadbcd571023ed31638ccda1f88.tar.gz
More comments.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index fe07812..c7b41dd 100644
--- a/misc.c
+++ b/misc.c
@@ -36,6 +36,18 @@
/***====================================================================***/
+/**
+ * Open the file given in the include statement and parse it's content.
+ * If the statement defines a specific map to use, this map is returned in
+ * file_rtrn. Otherwise, the default map is returned.
+ *
+ * @param stmt The include statement, specifying the file name to look for.
+ * @param file_type Type of file (XkmKeyNamesIdx, etc.)
+ * @param file_rtrn Returns the key map to be used.
+ * @param merge_rtrn Always returns stmt->merge.
+ *
+ * @return True on success or False otherwise.
+ */
Bool
ProcessIncludeFile(IncludeStmt * stmt,
unsigned file_type,
@@ -438,6 +450,18 @@ ComputeKbdDefaults(XkbDescPtr xkb)
return Success;
}
+/**
+ * Find the key with the given name and return its keycode in kc_rtrn.
+ *
+ * @param name The 4-letter name of the key as a long.
+ * @param kc_rtrn Set to the keycode if the key was found, otherwise 0.
+ * @param use_aliases True if the key aliases should be searched too.
+ * @param create If True and the key is not found, it is added to the
+ * xkb->names at the first free keycode.
+ * @param start_from Keycode to start searching from.
+ *
+ * @return True if found, False otherwise.
+ */
Bool
FindNamedKey(XkbDescPtr xkb,
unsigned long name,
@@ -495,6 +519,7 @@ FindNamedKey(XkbDescPtr xkb,
return False;
}
}
+ /* Find first unused keycode and store our key here */
for (n = xkb->min_key_code; n <= xkb->max_key_code; n++)
{
if (xkb->names->keys[n].name[0] == '\0')