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

Go to the source code of this file.

Macros

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

Functions

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

Detailed Description

Author
Martin Schanzenbach

Definitions for macOS and Win32

Definition in file compat.h.

Macro Definition Documentation

◆ memrchr

#define memrchr (   s,
  c,
 
)    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

Parameters
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;
45
46 for (i = n - 1; i >= 0; i--)
47 if (c == (int) ucs[i])
48 return (void *) &ucs[i];
49 return NULL;
50}