* util.h (str_unconst): Provide a replacement for the const_cast

macro from global.h.
	* util.c (str_unconst): Likewise.
This commit is contained in:
Roland Illig 2005-04-13 18:47:12 +00:00
parent d34c405387
commit a3a1e26210
3 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-04-13 Roland Illig <roland.illig@gmx.de>
* util.h (str_unconst): Provide a replacement for the const_cast
macro from global.h.
* util.c (str_unconst): Likewise.
2005-04-07 Roland Illig <roland.illig@gmx.de>
* view.c: Removed mmap(2) support. Now regular files are

View File

@ -1441,3 +1441,9 @@ cstrcasestr (const char *haystack, const char *needle)
}
return NULL;
}
extern char *
str_unconst (const char *s)
{
return (char *) s;
}

View File

@ -3,6 +3,12 @@
#include <sys/types.h>
/* Returns its argument as a "modifiable" string. This function is
* intended to pass strings to legacy libraries that don't know yet
* about the "const" modifier. The return value of this function
* MUST NOT be modified. */
extern char *str_unconst (const char *);
/* String managing functions */
extern const char *cstrcasestr (const char *haystack, const char *needle);