| 1 |
/* |
| 2 |
* Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. |
| 3 |
* SPDX-License-Identifier: HPND |
| 4 |
*/ |
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include "config.h" |
| 8 |
|
| 9 |
#include "ast.h" |
| 10 |
#include "utils.h" |
| 11 |
|
| 12 |
/* Reasonable threshold, with plenty of margin for keymaps in the wild */ |
| 13 |
#define INCLUDE_MAX_DEPTH 15 |
| 14 |
|
| 15 |
#define MERGE_OVERRIDE_PREFIX '+' |
| 16 |
#define MERGE_AUGMENT_PREFIX '|' |
| 17 |
#define MERGE_REPLACE_PREFIX '^' |
| 18 |
#define MERGE_DEFAULT_PREFIX MERGE_OVERRIDE_PREFIX |
| 19 |
#define is_merge_mode_prefix(ch) \ |
| 20 |
((ch) == MERGE_OVERRIDE_PREFIX || (ch) == MERGE_AUGMENT_PREFIX || \ |
| 21 |
(ch) == MERGE_REPLACE_PREFIX) |
| 22 |
static const char MERGE_MODE_PREFIXES[] = |
| 23 |
{ MERGE_OVERRIDE_PREFIX, MERGE_AUGMENT_PREFIX, MERGE_REPLACE_PREFIX, 0 }; |
| 24 |
|
| 25 |
|
| 26 |
bool |
| 27 |
ParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn, |
| 28 |
char *nextop_rtrn, char **extra_data); |
| 29 |
|
| 30 |
ssize_t |
| 31 |
expand_path(struct xkb_context *ctx, const char* parent_file_name, |
| 32 |
const char *name, size_t name_len, enum xkb_file_type type, |
| 33 |
char *buf, size_t buf_size); |
| 34 |
|
| 35 |
FILE * |
| 36 |
FindFileInXkbPath(struct xkb_context *ctx, const char* parent_file_name, |
| 37 |
const char *name, size_t name_len, enum xkb_file_type type, |
| 38 |
char *buf, size_t buf_size, unsigned int *offset, |
| 39 |
bool required); |
| 40 |
|
| 41 |
bool |
| 42 |
ExceedsIncludeMaxDepth(struct xkb_context *ctx, unsigned int include_depth); |
| 43 |
|
| 44 |
XkbFile * |
| 45 |
ProcessIncludeFile(struct xkb_context *ctx, const IncludeStmt *stmt, |
| 46 |
enum xkb_file_type file_type, char *path, size_t path_size); |