#ifndef CONFIG_H
#define CONFIG_H

#include <stdbool.h>
#include "kernel.h"

#define PASSWORD_LEN 8

/* Global configuration */
typedef struct
{
  bool dont_nudge_mouse;
  bool enable_filter;
  bool stretch_keys;
  bool enable_clipboard; /* Computed value: True if any server requires clipboard support */
  bool enable_input; /* Computed value: True if any server enables keyboard/mouse input */
  bool multiple_connections;
  bool broadcast_clipboard;
} global_config_t;

/* Server configuration */
typedef struct
{
  int port;
  bool enable_mouse;
  bool enable_kbd;
  bool swap_adjust_menu;
  int prefer_xcursor; /* 0 -> no preference, 1 -> xcursor, -1 -> cursor */
  bool enable_clipboard;
  int zlib_level;
  bool allow_exclusive;
  char password[PASSWORD_LEN+1];
  char name[256];
} server_config_t;

extern global_config_t global_config;

extern void configs_shutdown();
extern _kernel_oserror *config_load(const char *filename);
extern const server_config_t *configs_get(int *count);

#endif
