src/options.c
/*!
 * Allocates and sets options to their defaults, so they can be safely freed.
 * @see options_destroy
 */
Allocates and sets options to their defaults, so they can be safely freed.
Allocates and sets options to their defaults so they can be safely freed .
static struct options *options_allocate()
{
	struct options *new = malloc(sizeof(struct options));
	if (new == NULL)
		return NULL;
	new->bar_height = DEFAULT_HEIGHT;
	new->bar_on_bottom = DEFAULT_ON_BOTTOM;
	new->default_font = strdup(DEFAULT_FONT);
	new->default_foreground = strdup(DEFAULT_FOREGROUND);
	new->default_background = strdup(DEFAULT_BACKGROUND);
	return new;
}
static struct options * options_allocate ( ) { struct options * new = malloc ( sizeof ( struct options ) ) ; if ( new == NULL ) return NULL ; new -> bar_height = DEFAULT_HEIGHT ; new -> bar_on_bottom = DEFAULT_ON_BOTTOM ; new -> default_font = strdup ( DEFAULT_FONT ) ; new -> default_foreground = strdup ( DEFAULT_FOREGROUND ) ; new -> default_background = strdup ( DEFAULT_BACKGROUND ) ; return new ; }
Allocates and sets options to their defaults, so they can be safely freed.
Allocates and sets options to their defaults so they can be safely freed .