libkeymap 2.0.3 Library to manage the Linux keymaps

- Main Page
- Data Structures
- Files

- File List
- Globals

Data Structures | Enumerations | Functions
src/libkeymap/keymap/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...
## 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)
int | lk_dump_ctable (struct lk_ctx *ctx, FILE *fd)
void | lk_dump_keymap (struct lk_ctx *ctx, FILE *fd, lk_table_shape table, char numeric)
void | lk_dump_keys (struct lk_ctx *ctx, FILE *fd, lk_table_shape table, char numeric)
void | lk_dump_keymaps (struct lk_ctx *ctx, FILE *fd)
void | lk_dump_funcs (struct lk_ctx *ctx, FILE *fd)
void | lk_dump_diacs (struct lk_ctx *ctx, FILE *fd)
char * | lk_code_to_ksym (struct lk_ctx *ctx, int code)
char * | lk_get_sym (struct lk_ctx *ctx, unsigned int ktype, unsigned int index)
int | lk_ksym_to_unicode (struct lk_ctx *ctx, const char *code)
int | lk_get_kmapinfo (struct lk_ctx *ctx, struct kmapinfo *res)
void | lk_dump_summary (struct lk_ctx *ctx, FILE *fd, int console)
void | lk_dump_symbols (struct lk_ctx *ctx, FILE *fd)

## Detailed Description

Functions for keymap output.

## Enumeration Type Documentation

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

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.

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.

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.

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.

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.

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.

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.

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.

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

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.

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

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

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