[util] Add position_to_str()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
e4d091ab2e
commit
ae1cea061c
|
@ -112,6 +112,25 @@ position_get_from_str(const char *pos)
|
||||||
return Off;
|
return Off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
position_to_str(position_t p)
|
||||||
|
{
|
||||||
|
switch(p)
|
||||||
|
{
|
||||||
|
case Top:
|
||||||
|
return a_strdup("top");
|
||||||
|
case Bottom:
|
||||||
|
return a_strdup("bottom");
|
||||||
|
case Right:
|
||||||
|
return a_strdup("right");
|
||||||
|
case Left:
|
||||||
|
return a_strdup("left");
|
||||||
|
case Auto:
|
||||||
|
return a_strdup("auto");
|
||||||
|
}
|
||||||
|
return a_strdup("off");
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief safe limited strdup.
|
/** \brief safe limited strdup.
|
||||||
*
|
*
|
||||||
* Copies at most min(<tt>n-1</tt>, \c l) characters from \c src into a newly
|
* Copies at most min(<tt>n-1</tt>, \c l) characters from \c src into a newly
|
||||||
|
|
|
@ -261,6 +261,7 @@ void _warn(int, const char *, const char *, ...)
|
||||||
__attribute__ ((format(printf, 3, 4)));
|
__attribute__ ((format(printf, 3, 4)));
|
||||||
|
|
||||||
position_t position_get_from_str(const char *);
|
position_t position_get_from_str(const char *);
|
||||||
|
char * position_to_str(position_t);
|
||||||
fuzzy_t fuzzy_get_from_str(const char *);
|
fuzzy_t fuzzy_get_from_str(const char *);
|
||||||
double compute_new_value_from_arg(const char *, double);
|
double compute_new_value_from_arg(const char *, double);
|
||||||
void *name_func_lookup(const char *, const name_func_link_t *);
|
void *name_func_lookup(const char *, const name_func_link_t *);
|
||||||
|
|
Loading…
Reference in New Issue