libkeymap 2.4.0 Library to manage the Linux keymaps

Data Structures | Macros | Enumerations | Functions
dump.h File Reference

Functions for keymap output. More...

`#include <stdio.h>`
`#include <keymap/context.h>`

Go to the source code of this file.

## Data Structures
struct | kmapinfo
| General information about the keymap. More...

## Macros
#define | __attribute__(x) /*NOTHING*/

## Enumerations
enum | lk_table_shape { LK_SHAPE_DEFAULT = (1 << 1) , LK_SHAPE_FULL_TABLE = (1 << 2) , LK_SHAPE_SEPARATE_LINES = (1 << 3) , LK_SHAPE_UNTIL_HOLE = (1 << 4) }
| Flags controlling the output keymap. More...

## Functions
int | lk_dump_bkeymap (struct lk_ctx *ctx, FILE *fd) __attribute__((nonnull(1)))
int | lk_dump_ctable (struct lk_ctx *ctx, FILE *fd) __attribute__((nonnull(1
int void | lk_dump_keymap (struct lk_ctx *ctx, FILE *fd, lk_table_shape table, char numeric) __attribute__((nonnull(1
int void void | lk_dump_keys (struct lk_ctx *ctx, FILE *fd, lk_table_shape table, char numeric) __attribute__((nonnull(1
int void void void | lk_dump_keymaps (struct lk_ctx *ctx, FILE *fd) __attribute__((nonnull(1
int void void void void | lk_dump_funcs (struct lk_ctx *ctx, FILE *fd) __attribute__((nonnull(1
int void void void void void | lk_dump_diacs (struct lk_ctx *ctx, FILE *fd) __attribute__((nonnull(1
int void void void void void char * | lk_code_to_ksym (struct lk_ctx *ctx, int code) __attribute__((nonnull(1)))
char * | lk_get_sym (struct lk_ctx *ctx, int ktype, int index) __attribute__((nonnull(1)))
int | lk_ksym_to_unicode (struct lk_ctx *ctx, const char *code) __attribute__((nonnull(1
int int | lk_get_kmapinfo (struct lk_ctx *ctx, struct kmapinfo *res) __attribute__((nonnull(1
int int void | lk_dump_summary (struct lk_ctx *ctx, FILE *fd, int console) __attribute__((nonnull(1
int int void void | lk_dump_symbols (struct lk_ctx *ctx, FILE *fd) __attribute__((nonnull(1

## Detailed Description

Functions for keymap output.

## Macro Definition Documentation

## ◆ __attribute__

#define __attribute__ | ( |  | x | ) | /*NOTHING*/

## Enumeration Type Documentation

## ◆ lk_table_shape

enum lk_table_shape

Flags controlling the output keymap.

Enumerator
LK_SHAPE_DEFAULT |
LK_SHAPE_FULL_TABLE | one line for each keycode
LK_SHAPE_SEPARATE_LINES | one line for each (modifier,keycode) pair
LK_SHAPE_UNTIL_HOLE | one line for each keycode until 1st hole

## Function Documentation

## ◆ lk_dump_bkeymap()

int lk_dump_bkeymap | ( | struct lk_ctx * | ctx,
|  | FILE * | fd
| ) |  |

Outputs a keymap in binary format.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.

Returns
  0 on success, -1 on error.

## ◆ lk_dump_ctable()

int lk_dump_ctable | ( | struct lk_ctx * | ctx,
|  | FILE * | fd
| ) |  |

Outputs a keymap in C format.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.

Returns
  0 on success, -1 on error.

## ◆ lk_dump_keymap()

int void lk_dump_keymap | ( | struct lk_ctx * | ctx,
|  | FILE * | fd,
|  | lk_table_shape | table,
|  | char | numeric
| ) |  |

Outputs whole keymap. This is a high-level function that calls lk_dump_keys, lk_dump_keymaps, lk_dump_funcs and lk_dump_diacs.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.
  table | specifies the output format of the keycode table.
  numeric | indicates whether to output the keycodes in numerical form.

## ◆ lk_dump_keys()

int void void lk_dump_keys | ( | struct lk_ctx * | ctx,
|  | FILE * | fd,
|  | lk_table_shape | table,
|  | char | numeric
| ) |  |

Outputs keycodes.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.
  table | specifies the output format of the keycode table.
  numeric | indicates whether to output the keycodes in numerical form.

## ◆ lk_dump_keymaps()

int void void void lk_dump_keymaps | ( | struct lk_ctx * | ctx,
|  | FILE * | fd
| ) |  |

Outputs 'keymaps' line.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.

## ◆ lk_dump_funcs()

int void void void void lk_dump_funcs | ( | struct lk_ctx * | ctx,
|  | FILE * | fd
| ) |  |

Outputs function keys.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.

## ◆ lk_dump_diacs()

int void void void void void lk_dump_diacs | ( | struct lk_ctx * | ctx,
|  | FILE * | fd
| ) |  |

Outputs accent table.

Parameters

  ctx | is a keymap library context.
  fd | is a FILE pointer for output.

## ◆ lk_code_to_ksym()

int void void void void void char * lk_code_to_ksym | ( | struct lk_ctx * | ctx,
|  | int | code
| ) |  |

Converts a number to a string representation of the character.

Parameters

  ctx | is a keymap library context.
  code | is a numeric representation of ksym.

Returns
  a string representation of the code.

## ◆ lk_get_sym()

char * lk_get_sym | ( | struct lk_ctx * | ctx,
|  | int | ktype,
|  | int | index
| ) |  |

## ◆ lk_ksym_to_unicode()

int lk_ksym_to_unicode | ( | struct lk_ctx * | ctx,
|  | const char * | code
| ) |  |

Converts a string to a numeric representation of the character.

Parameters

  ctx | is a keymap library context.
  code | is a string representation of ksym.

Returns
  a unicode representation of the code.

## ◆ lk_get_kmapinfo()

int int lk_get_kmapinfo | ( | struct lk_ctx * | ctx,
|  | struct kmapinfo * | res
| ) |  |

## ◆ lk_dump_summary()

int int void lk_dump_summary | ( | struct lk_ctx * | ctx,
|  | FILE * | fd,
|  | int | console
| ) |  |

## ◆ lk_dump_symbols()

int int void void lk_dump_symbols | ( | struct lk_ctx * | ctx,
|  | FILE * | fd
| ) |  |