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

Go to the source code of this file.

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

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}