Edit

kc3-lang/libxkbcommon/test/compose-iter.h

Branch :

  • Show log

    Commit

  • Author : Pierre Le Marre
    Date : 2024-09-01 09:07:00
    Hash : d4deb755
    Message : compose: Add quickcheck test for traversal Test against the `foreach` reference implementation: - Suffle compose file lines randomly; - Compare traversal entry by entry. The `foreach` Compose traversal implementation is based on Ran’s work: https://github.com/bluetech/libxkbcommon/commit/f7f3c3c385fdc9ae91135f95e4b10f072603b812

  • test/compose-iter.h
  • #ifndef COMPOSE_LEGACY_ITER_H
    #define COMPOSE_LEGACY_ITER_H
    
    #include "config.h"
    #include "src/compose/table.h"
    
    /**
     * The iterator function type used by xkb_compose_table_for_each().
     */
    typedef void
    (*xkb_compose_table_iter_t)(struct xkb_compose_table_entry *entry,
                                void *data);
    
    /**
     * Run a specified function for every valid entry in the table.
     *
     * The entries are returned in lexicographic order of the left-hand
     * side of entries. This does not correspond to the order in which
     * the entries appear in the Compose file.
     */
    void
    xkb_compose_table_for_each(struct xkb_compose_table *table,
                               xkb_compose_table_iter_t iter,
                               void *data);
    
    #endif