Blob Blame Raw

#include "app.h"

#include "common.c"
#include "app.c"
#include "graph.c"
#include "input.c"
#include "keyboard.c"

#include "layout.en.inc.c"
#include "layout.fn.inc.c"
#include "layout.en.full.inc.c"
#include "layout.am.inc.c"
#include "layout.ru.inc.c"

#include <sys/signal.h>


Layout layouts[] = {
  { keysEn, COUNTOF(keysEn) },
  { keysFn, COUNTOF(keysFn) },
  { keysEnFull, COUNTOF(keysEnFull) },
  { keysAm, COUNTOF(keysAm) },
  { keysRu, COUNTOF(keysRu) },
};

App app = {
  { layouts, COUNTOF(layouts) } }; // keyboard


void terminate(int s)
    { appStop(&app, 1); }


int main() {
  if (!appInit(&app))
    return 1;
  
  struct sigaction act = {};
  act.sa_handler = &terminate;
  sigaction(SIGHUP, &act, NULL);
  sigaction(SIGINT, &act, NULL);
  sigaction(SIGTERM, &act, NULL);
  
  int success = appRun(&app);
  appDeinit(&app);
  return !success;
}