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:
parent
745eec145f
commit
a9a59e5d28
14
src/conky.c
14
src/conky.c
@ -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 *))
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user