Edit

kc3-lang/libxkbcommon/src/xkbcomp/include.h

Branch :

  • Show log

    Commit

  • Author : Ran Benita
    Date : 2025-02-05 14:41:21
    Hash : df2322d7
    Message : Replace include guards by `#pragma once` We currently have a mix of include headers, pragma once and some missing. pragma once is not standard but is widely supported, and we already use it with no issues, so I'd say it's not a problem. Let's convert all headers to pragma once to avoid the annoying include guards. The public headers are *not* converted. Signed-off-by: Ran Benita <ran@unusedvar.com>

  • src/xkbcomp/include.h
  • /*
     * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
     * SPDX-License-Identifier: HPND
     */
    #pragma once
    
    #include "ast.h"
    
    /* Reasonable threshold, with plenty of margin for keymaps in the wild */
    #define INCLUDE_MAX_DEPTH 15
    
    #define MERGE_OVERRIDE_PREFIX '+'
    #define MERGE_AUGMENT_PREFIX  '|'
    #define MERGE_DEFAULT_PREFIX  MERGE_OVERRIDE_PREFIX
    #define is_merge_mode_prefix(ch) \
        ((ch) == MERGE_OVERRIDE_PREFIX || (ch) == MERGE_AUGMENT_PREFIX)
    
    bool
    ParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn,
                    char *nextop_rtrn, char **extra_data);
    
    FILE *
    FindFileInXkbPath(struct xkb_context *ctx, const char *name,
                      enum xkb_file_type type, char **pathRtrn,
                      unsigned int *offset);
    
    bool
    ExceedsIncludeMaxDepth(struct xkb_context *ctx, unsigned int include_depth);
    
    XkbFile *
    ProcessIncludeFile(struct xkb_context *ctx, IncludeStmt *stmt,
                       enum xkb_file_type file_type);