1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-02-03 20:48:31 +00:00

move the custom defined memrchr to the right place

And make it static, as tailhead.c is the only user of it.
This commit is contained in:
Phil Sutter 2009-02-25 00:22:31 +01:00
parent 745eec145f
commit a9a59e5d28
2 changed files with 14 additions and 14 deletions

View File

@ -418,20 +418,6 @@ static char *text_buffer;
static unsigned int special_index; /* used when drawing */
#endif /* X11 */
#ifndef HAVE_MEMRCHR
void *memrchr(const void *buffer, char c, size_t n)
{
const unsigned char *p = buffer;
for (p += n; n; n--) {
if (*--p == c) {
return (void *) p;
}
}
return NULL;
}
#endif
/* quite boring functions */
static inline void for_each_line(char *b, void f(char *))

View File

@ -36,6 +36,20 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifndef HAVE_MEMRCHR
static void *memrchr(const void *buffer, char c, size_t n)
{
const unsigned char *p = buffer;
for (p += n; n; n--) {
if (*--p == c) {
return (void *) p;
}
}
return NULL;
}
#endif
int init_tailhead_object(enum tailhead_type type,
struct text_object *obj, const char *arg)
{