GNUnet  0.17.6
proc_compat.c File Reference
#include "platform.h"
Include dependency graph for proc_compat.c:

Go to the source code of this file.


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 proc_compat.c.

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

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