File: memmem.3

package info (click to toggle)
manpages-es 1.24a-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,256 kB
  • ctags: 7
  • sloc: makefile: 66; sh: 62
file content (67 lines) | stat: -rw-r--r-- 2,932 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     386BSD man pages
.\" Modified Sat Jul 24 18:50:48 1993 by Rik Faith (faith@cs.unc.edu)
.\" Interchanged `needle' and `haystack'; added history, aeb, 980113.
.\" Translated into Spanish Wed Mar  4 10:07:39 CET 1998 by Gerardo
.\" Aburruzaga Garca <gerardo.aburruzaga@uca.es>
.\" Translation revised Wed Aug 19 1998 by Juan Piernas <piernas@ditec.um.es>
.\"
.TH MEMMEM 3  "13 Enero 1998" "GNU" "Manual del Programador de Linux"
.SH NOMBRE
memmem \- localiza una subcadena
.SH SINOPSIS
.nf
.B #include <string.h>
.sp
.BI "void *memmem(const void *" haystack ", size_t " haystacklen ,
.RS
.BI "const void *" needle ", size_t " needlelen  );
.fi
.SH DESCRIPCIN
La funcin \fBmemmem()\fP busca el principio de la primera ocurrencia de la
subcadena \fIneedle\fP de longitud \fIneedlelen\fP en el rea de memoria
\fIhaystack\fP de longitud \fIhaystacklen\fP.
.SH "VALOR DEVUELTO"
La funcin \fBmemmem()\fP devuelve un puntero al principio de la
subcadena, o NULL si la subcadena no se encuentra.
.SH "CONFORME A"
Esta funcin es una extensin GNU.
.SH FALLOS
Esta funcin se adapt a las libreras de Linux y se incluy a partir de la
versin 5.0.9 de libc;
all los argumentos `needle' y `haystack' estaban intercambiados y se
devolva un puntero al final de la primera ocurrencia de \fIneedle\fP. Ya
que todava se usa ampliamente libc 5.0.9, es peligroso utilizar esta
funcin.
.br
Tanto la antigua como la nueva libc tienen el fallo de que si \fIneedle\fP
es vaco, se devuelve \fIhaystack\fP-1 (en lugar de \fIhaystack\fP). Y glibc
(2.0.5) lo hace peor todava y devuelve un puntero al ltimo byte de
`haystack'.
Esperemos que esto se solucione. Por ahora no debe utilizarse
\fImemmem\fP() con un argumento `needle' vaco.
.SH "VASE TAMBIN"
.BR strstr (3)