summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-07-27 11:48:29 +1000
committerRan Benita <ran@unusedvar.com>2020-08-30 21:49:41 +0300
commit351b4b9c0bd8844ff9d408be2adee2b4b095fb06 (patch)
treeb9562417cc02c8f7ab47f111bc41e92105031167 /src
parenta0c1c2f42dafecbad7b9912dcaba7f206805981d (diff)
downloadlibxkbcommon-351b4b9c0bd8844ff9d408be2adee2b4b095fb06.tar.gz
libxkbcommon-351b4b9c0bd8844ff9d408be2adee2b4b095fb06.tar.bz2
libxkbcommon-351b4b9c0bd8844ff9d408be2adee2b4b095fb06.zip
xkbcomp: move the logging of include paths into a helper function
No functional changes, prep work for some other refacturing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/xkbcomp/include.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/xkbcomp/include.c b/src/xkbcomp/include.c
index cf90384..ac2279f 100644
--- a/src/xkbcomp/include.c
+++ b/src/xkbcomp/include.c
@@ -195,6 +195,31 @@ DirectoryForInclude(enum xkb_file_type type)
return xkb_file_type_include_dirs[type];
}
+static void
+LogIncludePaths(struct xkb_context *ctx)
+{
+ unsigned int i;
+
+ if (xkb_context_num_include_paths(ctx) > 0) {
+ log_err(ctx, "%d include paths searched:\n",
+ xkb_context_num_include_paths(ctx));
+ for (i = 0; i < xkb_context_num_include_paths(ctx); i++)
+ log_err(ctx, "\t%s\n",
+ xkb_context_include_path_get(ctx, i));
+ }
+ else {
+ log_err(ctx, "There are no include paths to search\n");
+ }
+
+ if (xkb_context_num_failed_include_paths(ctx) > 0) {
+ log_err(ctx, "%d include paths could not be added:\n",
+ xkb_context_num_failed_include_paths(ctx));
+ for (i = 0; i < xkb_context_num_failed_include_paths(ctx); i++)
+ log_err(ctx, "\t%s\n",
+ xkb_context_failed_include_path_get(ctx, i));
+ }
+}
+
FILE *
FindFileInXkbPath(struct xkb_context *ctx, const char *name,
enum xkb_file_type type, char **pathRtrn)
@@ -228,24 +253,7 @@ FindFileInXkbPath(struct xkb_context *ctx, const char *name,
log_err(ctx, "Couldn't find file \"%s/%s\" in include paths\n",
typeDir, name);
- if (xkb_context_num_include_paths(ctx) > 0) {
- log_err(ctx, "%d include paths searched:\n",
- xkb_context_num_include_paths(ctx));
- for (i = 0; i < xkb_context_num_include_paths(ctx); i++)
- log_err(ctx, "\t%s\n",
- xkb_context_include_path_get(ctx, i));
- }
- else {
- log_err(ctx, "There are no include paths to search\n");
- }
-
- if (xkb_context_num_failed_include_paths(ctx) > 0) {
- log_err(ctx, "%d include paths could not be added:\n",
- xkb_context_num_failed_include_paths(ctx));
- for (i = 0; i < xkb_context_num_failed_include_paths(ctx); i++)
- log_err(ctx, "\t%s\n",
- xkb_context_failed_include_path_get(ctx, i));
- }
+ LogIncludePaths(ctx);
free(buf);
return NULL;