Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
option_parser.h File Reference

Parser for settings and cmdline arguments. More...

#include <glib.h>
#include <stdbool.h>
#include <stdio.h>
#include "dunst.h"
#include "settings.h"
#include "ini.h"
+ Include dependency graph for option_parser.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int string_parse_enum (const void *data, const char *s, void *ret)
 
int string_parse_sepcolor (const void *data, const char *s, void *ret)
 
int string_parse_color (const char *s, struct color *ret)
 Parse a color string.
 
int string_parse_gradient (const char *s, struct gradient **ret)
 
int string_parse_bool (const void *data, const char *s, void *ret)
 
int string_parse_corners (const void *data, const char *s, void *ret)
 
int string_parse_maybe_int (const void *data, const char *s, void *ret)
 Parse a string that may represent an integer value.
 
void set_defaults (void)
 
void save_settings (struct ini *ini)
 
void cmdline_load (int argc, char *argv[])
 
char * cmdline_get_string_offset (const char *key, const char *def, int start, int *found)
 
char * cmdline_get_string (const char *key, const char *def, const char *description)
 
char * cmdline_get_path (const char *key, const char *def, const char *description)
 
char ** cmdline_get_list (const char *key, const char *def, const char *description)
 
int cmdline_get_int (const char *key, int def, const char *description)
 
double cmdline_get_double (const char *key, double def, const char *description)
 
int cmdline_get_bool (const char *key, int def, const char *description)
 
bool cmdline_is_set (const char *key)
 
void cmdline_usage_append (const char *key, const char *type, const char *description)
 
const char * cmdline_create_usage (void)
 

Detailed Description

Parser for settings and cmdline arguments.

License
BSD-3-Clause

Definition in file option_parser.h.

Function Documentation

◆ cmdline_create_usage()

const char * cmdline_create_usage ( void )

Definition at line 738 of file option_parser.c.

◆ cmdline_get_bool()

int cmdline_get_bool ( const char * key,
int def,
const char * description )

Definition at line 698 of file option_parser.c.

◆ cmdline_get_double()

double cmdline_get_double ( const char * key,
double def,
const char * description )

Definition at line 687 of file option_parser.c.

◆ cmdline_get_int()

int cmdline_get_int ( const char * key,
int def,
const char * description )

Definition at line 676 of file option_parser.c.

◆ cmdline_get_list()

char ** cmdline_get_list ( const char * key,
const char * def,
const char * description )

Definition at line 652 of file option_parser.c.

◆ cmdline_get_path()

char * cmdline_get_path ( const char * key,
const char * def,
const char * description )

Definition at line 641 of file option_parser.c.

◆ cmdline_get_string()

char * cmdline_get_string ( const char * key,
const char * def,
const char * description )

Definition at line 635 of file option_parser.c.

◆ cmdline_get_string_offset()

char * cmdline_get_string_offset ( const char * key,
const char * def,
int start,
int * found )

Definition at line 623 of file option_parser.c.

◆ cmdline_is_set()

bool cmdline_is_set ( const char * key)

Definition at line 709 of file option_parser.c.

◆ cmdline_load()

void cmdline_load ( int argc,
char * argv[] )

Definition at line 580 of file option_parser.c.

◆ cmdline_usage_append()

void cmdline_usage_append ( const char * key,
const char * type,
const char * description )

Definition at line 714 of file option_parser.c.

◆ save_settings()

void save_settings ( struct ini * ini)

Definition at line 525 of file option_parser.c.

◆ set_defaults()

void set_defaults ( void )

Definition at line 507 of file option_parser.c.

◆ string_parse_bool()

int string_parse_bool ( const void * data,
const char * s,
void * ret )

Definition at line 286 of file option_parser.c.

◆ string_parse_color()

int string_parse_color ( const char * s,
struct color * ret )

Parse a color string.

The format is:

#RRGGBB[AA] 

Definition at line 209 of file option_parser.c.

◆ string_parse_corners()

int string_parse_corners ( const void * data,
const char * s,
void * ret )

Definition at line 96 of file option_parser.c.

◆ string_parse_enum()

int string_parse_enum ( const void * data,
const char * s,
void * ret )

Definition at line 31 of file option_parser.c.

◆ string_parse_gradient()

int string_parse_gradient ( const char * s,
struct gradient ** ret )

Definition at line 255 of file option_parser.c.

◆ string_parse_maybe_int()

int string_parse_maybe_int ( const void * data,
const char * s,
void * ret )

Parse a string that may represent an integer value.

Definition at line 298 of file option_parser.c.

◆ string_parse_sepcolor()

int string_parse_sepcolor ( const void * data,
const char * s,
void * ret )

Definition at line 177 of file option_parser.c.