util: position_tostr() return const

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-01 16:33:24 +02:00
parent 99fe611d31
commit a816ce0440
2 changed files with 8 additions and 14 deletions

View File

@ -124,23 +124,17 @@ position_fromstr(const char *pos, ssize_t len)
* \param p The position.
* \return A position string.
*/
char *
const char *
position_tostr(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");
default:
return a_strdup("off");
case Top: return "top";
case Bottom: return "bottom";
case Right: return "right";
case Left: return "left";
case Auto: return "auto";
default: return "off";
}
}

View File

@ -324,7 +324,7 @@ void _warn(int, const char *, const char *, ...)
__attribute__ ((format(printf, 3, 4)));
position_t position_fromstr(const char *, ssize_t);
char * position_tostr(position_t);
const char * position_tostr(position_t);
void *name_func_lookup(const char *, const name_func_link_t *);
const char * name_func_rlookup(void *, const name_func_link_t *);
void a_exec(const char *);