#include "utf8.h"
#include "parser.h"
-#define MAX_LHS_LEN 10
-#define MAX_INCLUDE_DEPTH 5
-
/*
* Grammar adapted from libX11/modules/im/ximcp/imLcPrs.c.
* See also the XCompose(5) manpage.
scanner_buf_append(s, '%');
}
else if (scanner_chr(s, 'H')) {
- const char *home = secure_getenv("HOME");
+ const char *home = xkb_context_getenv(table->ctx, "HOME");
if (!home) {
scanner_err(s, "%%H was used in an include statement, but the HOME environment variable is not set");
return TOK_ERROR;
}
}
else if (scanner_chr(s, 'L')) {
- char *path = get_locale_compose_file_path(table->locale);
+ char *path = get_locale_compose_file_path(table->ctx, table->locale);
if (!path) {
scanner_err(s, "failed to expand %%L to the locale Compose file");
return TOK_ERROR;
free(path);
}
else if (scanner_chr(s, 'S')) {
- const char *xlocaledir = get_xlocaledir_path();
+ const char *xlocaledir = get_xlocaledir_path(table->ctx);
if (!scanner_buf_appends(s, xlocaledir)) {
scanner_err(s, "include path after expanding %%S is too long");
return TOK_ERROR;
const struct production *production)
{
unsigned lhs_pos = 0;
- uint16_t curr = darray_size(table->nodes) == 1 ? 0 : 1;
- uint16_t *pptr = NULL;
+ uint32_t curr = darray_size(table->nodes) == 1 ? 0 : 1;
+ uint32_t *pptr = NULL;
struct compose_node *node = NULL;
/* Warn before potentially going over the limit, discard silently after. */
ok = map_file(file, &string, &size);
if (!ok) {
- log_err(table->ctx, "Couldn't read Compose file %s: %s\n",
+ log_err(table->ctx,
+ XKB_LOG_MESSAGE_NO_ID,
+ "Couldn't read Compose file %s: %s\n",
file_name, strerror(errno));
return false;
}