libkeymap  2.0.4
Library to manage the Linux keymaps
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

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:
ctxis a keymap library context.
fdis 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:
ctxis a keymap library context.
fdis 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:
ctxis a keymap library context.
fdis a FILE pointer for output.
tablespecifies the output format of the keycode table.
numericindicates 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:
ctxis a keymap library context.
fdis a FILE pointer for output.
tablespecifies the output format of the keycode table.
numericindicates whether to output the keycodes in numerical form.
void lk_dump_keymaps ( struct lk_ctx *  ctx,
FILE *  fd 
)

Outputs 'keymaps' line.

Parameters:
ctxis a keymap library context.
fdis a FILE pointer for output.
void lk_dump_funcs ( struct lk_ctx *  ctx,
FILE *  fd 
)

Outputs function keys.

Parameters:
ctxis a keymap library context.
fdis a FILE pointer for output.
void lk_dump_diacs ( struct lk_ctx *  ctx,
FILE *  fd 
)

Outputs accent table.

Parameters:
ctxis a keymap library context.
fdis 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:
ctxis a keymap library context.
codeis 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:
ctxis a keymap library context.
codeis 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 
)