Blame tests/libkeymap-showmaps.c
|
Packit Service |
50ad14 |
#include <stdio.h>
|
|
Packit Service |
50ad14 |
#include <stdlib.h>
|
|
Packit Service |
50ad14 |
#include <string.h>
|
|
Packit Service |
50ad14 |
#include <keymap.h>
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
#include "contextP.h"
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
int main(int argc, char **argv)
|
|
Packit Service |
50ad14 |
{
|
|
Packit Service |
50ad14 |
int i;
|
|
Packit Service |
50ad14 |
struct lk_ctx *ctx;
|
|
Packit Service |
50ad14 |
lkfile_t f;
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
ctx = lk_init();
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
f.pipe = 0;
|
|
Packit Service |
50ad14 |
strcpy(f.pathname, argv[1]);
|
|
Packit Service |
50ad14 |
f.fd = fopen(argv[1], "r");
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
lk_parse_keymap(ctx, &f);
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
for (i = 0; i < ctx->keymap->total; i++) {
|
|
Packit Service |
50ad14 |
if (!lk_map_exists(ctx, i))
|
|
Packit Service |
50ad14 |
continue;
|
|
Packit Service |
50ad14 |
printf("keymap %03d\n", i);
|
|
Packit Service |
50ad14 |
}
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
lk_free(ctx);
|
|
Packit Service |
50ad14 |
return 0;
|
|
Packit Service |
50ad14 |
}
|