diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-01-12 15:24:24 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-01-12 15:24:24 +0100 |
commit | 1579f7c0df91df4581c1096448dde8cf9afddb49 (patch) | |
tree | 0a730fe3f624b1f74c1e9ea0edad3d785b5e8617 /applause.c | |
parent | 95f096e7fefd9ddb5130c1faf7314cb19922e3ad (diff) | |
download | applause2-1579f7c0df91df4581c1096448dde8cf9afddb49.tar.gz |
added history support: it is saved in .applause_history of the current working directory
Diffstat (limited to 'applause.c')
-rw-r--r-- | applause.c | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -31,10 +31,11 @@ #include <jack/midiport.h> #include <jack/ringbuffer.h> -#define LUA_MODULE "applause.lua" +#define LUA_MODULE "applause.lua" +#define APPLAUSE_HISTORY ".applause_history" -#define CMD_SERVER_IP "127.0.0.1" -#define CMD_SERVER_PORT 10000 +#define CMD_SERVER_IP "127.0.0.1" +#define CMD_SERVER_PORT 10000 #define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) @@ -878,6 +879,12 @@ main(int argc, char **argv) signal_action.sa_handler = SIG_IGN; sigaction(SIGPIPE, &signal_action, NULL); + /* + * Load the libhistory file. + */ + using_history(); + read_history(APPLAUSE_HISTORY); + L = luaL_newstate(); if (!L) { fprintf(stderr, "Error creating Lua state.\n"); @@ -960,5 +967,12 @@ main(int argc, char **argv) svsem_free(buffer_sem); lua_close(L); + + /* + * Write libhistory file + */ + if (write_history(APPLAUSE_HISTORY)) + perror("write_history"); + return 0; } |