1#pragma once
2#include <cerrno>
3#include <sys/stat.h>
4#include <SDL2/SDL.h>
5
6#define CONFIG_DIR_DEFAULT_MODE S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
7#define USE_CONFIG_DIR true
8#define CONFIG_DIR_NAME "LaiNES"
9#define CONFIG_FALLBACK ".laines-settings"
10/* PATH_MAX is a portability nightmare. */
11#define CONFIG_PATH_MAX 1024
12
13namespace GUI {
14
15/* Loading and saving */
16void load_settings();
17void save_settings();
18const char* get_config_path(char * buf, int buflen);
19
20extern int last_window_size;
21extern SDL_Scancode KEY_A [];
22extern SDL_Scancode KEY_B [];
23extern SDL_Scancode KEY_SELECT[];
24extern SDL_Scancode KEY_START [];
25extern SDL_Scancode KEY_UP [];
26extern SDL_Scancode KEY_DOWN [];
27extern SDL_Scancode KEY_LEFT [];
28extern SDL_Scancode KEY_RIGHT [];
29extern int BTN_UP [];
30extern int BTN_DOWN [];
31extern int BTN_LEFT [];
32extern int BTN_RIGHT [];
33extern int BTN_A [];
34extern int BTN_B [];
35extern int BTN_SELECT[];
36extern int BTN_START [];
37extern bool useJoystick[];
38
39}
40