SCTC
the soundcloud.com terminal client
Macros | Functions | Variables
config.c File Reference

Implements the parsing of the configfile and provides access to those values. More...

#include "_hard_config.h"
#include "config.h"
#include <confuse.h>
#include <ncurses.h>
#include "command.h"
#include "helper.h"
#include "log.h"
Include dependency graph for config.c:

Macros

#define SCTC_CONFIG_FILE   "sctc.conf"
 
#define OPTION_SUBSCRIBE   "subscribe"
 
#define OPTION_CACHE_PATH   "cache_path"
 
#define OPTION_CACHE_LIMIT   "cache_limit"
 

Functions

static int get_curses_ch (const char *str)
 
static const struct commandget_cmd_by_name (const char *input)
 
static int config_map_command (cfg_t *cfg, cfg_opt_t *opt, int argc, const char **argv)
 
void config_init ()
 
command_func_ptr config_get_function (int key)
 
const char * config_get_param (int key)
 
int config_get_subscribe_count ()
 
char * config_get_subscribe (int id)
 
char * config_get_cache_path ()
 
bool config_finalize ()
 

Variables

static char ** config_subscribe = NULL
 
static int config_subscribe_count = 0
 
static char * cache_path
 
static int cache_limit
 
struct {
   void(*   func )(char *)
 
   const char *   param
 
key_command_mapping [KEY_MAX] = { {NULL} }
 

Detailed Description

Implements the parsing of the configfile and provides access to those values.

Macro Definition Documentation

#define OPTION_CACHE_LIMIT   "cache_limit"
#define OPTION_CACHE_PATH   "cache_path"
#define OPTION_SUBSCRIBE   "subscribe"
#define SCTC_CONFIG_FILE   "sctc.conf"

Function Documentation

bool config_finalize ( )

Here is the caller graph for this function:

char* config_get_cache_path ( )

Here is the caller graph for this function:

command_func_ptr config_get_function ( int  key)

Here is the caller graph for this function:

const char* config_get_param ( int  key)

Here is the caller graph for this function:

char* config_get_subscribe ( int  id)

Here is the caller graph for this function:

int config_get_subscribe_count ( )

Here is the caller graph for this function:

void config_init ( )

Here is the call graph for this function:

Here is the caller graph for this function:

static int config_map_command ( cfg_t *  cfg,
cfg_opt_t *  opt,
int  argc,
const char **  argv 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static const struct command* get_cmd_by_name ( const char *  input)
static

Here is the caller graph for this function:

static int get_curses_ch ( const char *  str)
static

Here is the caller graph for this function:

Variable Documentation

int cache_limit
static
char* cache_path
static
char** config_subscribe = NULL
static
int config_subscribe_count = 0
static
void(* func) (char *)
struct { ... } key_command_mapping[KEY_MAX]
const char* param