GNUnet  0.11.x
Macros | Functions
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.

Referenced by extract_hosts(), and resolver_lookup_get_next_label().

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 38 of file proc_compat.c.

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