GNUnet  0.20.0
compat.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define memrchr(s, c, n)   GN_memrchr_ (s, c, n)


void * GN_memrchr_ (const void *s, int c, size_t n)
 memrchr as defined in glibc More...

Detailed Description

Martin Schanzenbach

Definitions for macOS and Win32

Definition in file compat.h.

Macro Definition Documentation

◆ memrchr

#define memrchr (   s,
)    GN_memrchr_ (s, c, n)

Definition at line 49 of file compat.h.

Function Documentation

◆ GN_memrchr_()

void* GN_memrchr_ ( const void *  s,
int  c,
size_t  n 

memrchr as defined in glibc

spointer to memory
ccharacter to search for
nsearch character limit

Definition at line 39 of file proc_compat.c.

42 {
43  const unsigned char *ucs = s;
44  ssize_t i;
46  for (i = n - 1; i >= 0; i--)
47  if (c == (int) ucs[i])
48  return (void *) &ucs[i];
49  return NULL;
50 }