aboutsummaryrefslogtreecommitdiffstats
path: root/man3/libsimple_rawmemrelem.3
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-25 14:17:49 +0100
committerMattias Andrée <maandree@kth.se>2018-11-25 14:17:49 +0100
commite2dc7cf9c966d4c94b7556c1c2ada8d170715654 (patch)
tree78733ab53fb0e1d185773d23f0f5ccd373be2bc1 /man3/libsimple_rawmemrelem.3
parentAdd man pages (diff)
downloadlibsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.gz
libsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.bz2
libsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.xz
Fix consistence in memelem functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'man3/libsimple_rawmemrelem.3')
-rw-r--r--man3/libsimple_rawmemrelem.314
1 files changed, 7 insertions, 7 deletions
diff --git a/man3/libsimple_rawmemrelem.3 b/man3/libsimple_rawmemrelem.3
index 0a179a8..4ac85aa 100644
--- a/man3/libsimple_rawmemrelem.3
+++ b/man3/libsimple_rawmemrelem.3
@@ -1,11 +1,11 @@
-.TH LIBSIMPLE_RAWMEMRELEM 3 2018-11-24 libsimple
+.TH LIBSIMPLE_RAWMEMRELEM 3 2018-11-25 libsimple
.SH NAME
libsimple_rawmemrelem \- find aligned byte string in memory
.SH SYNOPSIS
.nf
#include <libsimple.h>
-void *libsimple_rawmemrelem(const void *\fIhaystack\fP, size_t \fInhaystack\fP, const void *\fIneedle\fP, size_t \fInneedle\fP);
+void *libsimple_rawmemrelem(const void *\fIhaystack\fP, const void *\fIneedle\fP, size_t \fIwidth\fP, size_t \fIn\fP);
#ifndef rawmemrelem
# define rawmemrelem libsimple_rawmemrelem
@@ -20,13 +20,13 @@ The
function scans the memory segment
.IR haystack ,
with the size
-.IR nhaystack*nneedle ,
+.IR n*width ,
for the last occurence of the byte string
.I needle
with the size
-.IR nneedle ,
+.IR width ,
and with an offset equivalent to zero modulo
-.IR nneedle .
+.IR width .
The
.BR libsimple_rawmemrelem ()
function assumes there is at least one
@@ -40,12 +40,12 @@ The
function returns the pointer
.I s
with a maximal offset such that
-.IR !memcmp(r,needle,nneedle) ,
+.IR !memcmp(r,needle,width) ,
where
.I r
is the returned pointer, and such that
the offset is equivalent to zero modulo
-.IR nneedle .
+.IR width .
If no such offset exists, the behaviour is undefined.
.SH ERRORS
The