.\" -*- coding: UTF-8 -*- .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sun Jul 25 10:54:03 1993 by Rik Faith (faith@cs.unc.edu) .\" Fixed typo, aeb, 950823 .\" 2002-02-22, joey, mihtjel: Added strtoull() .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH STRTOUL 3 "1 Noviembre 2020" GNU "Manual del Programador de Linux" .SH NOMBRE strtoul, strtoull, strtouq \- convierten una cadena en un entero largo sin signo .SH SINOPSIS .nf \fB#include \fP .PP \fBunsigned long strtoul(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .PP \fBunsigned long long strtoull(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB,\fP \fB int \fP\fIbase\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP .ad l \fBstrtoull\fP(): .RS 4 _ISOC99_SOURCE || || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE .RE .ad .SH DESCRIPCIÓN The \fBstrtoul\fP() function converts the initial part of the string in \fInptr\fP to an \fIunsigned long\fP value according to the given \fIbase\fP, which must be between 2 and 36 inclusive, or be the special value 0. .PP The string may begin with an arbitrary amount of white space (as determined by \fBisspace\fP(3)) followed by a single optional \(aq+\(aq or \(aq\-\(aq sign. If \fIbase\fP is zero or 16, the string may then include a "0x" prefix, and the number will be read in base 16; otherwise, a zero \fIbase\fP is taken as 10 (decimal) unless the next character is \(aq0\(aq, in which case it is taken as 8 (octal). .PP The remainder of the string is converted to an \fIunsigned long\fP value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter \(aqA\(aq in either uppercase or lowercase represents 10, \(aqB\(aq represents 11, and so forth, with \(aqZ\(aq representing 35.) .PP Si \fIendptr\fP no es NULL, \fBstrtoul\fP() almacena la dirección del primer caracter no válido en \fI*endptr\fP. Si no hubiera dígitos en absoluto \fBstrtoul\fP() almacena el valor original de \fInptr\fP en \fI*endptr\fP. (y devuelve 0). En particular, si \fI*nptr\fP es distinto de \(aq\e0\(aq pero \fI**endptr\fP es \(aq\e0\(aq a la vuelta, la cadena entera es válida. .PP The \fBstrtoull\fP() function works just like the \fBstrtoul\fP() function but returns an \fIunsigned long long\fP value. .SH "VALOR DEVUELTO" The \fBstrtoul\fP() function returns either the result of the conversion or, if there was a leading minus sign, the negation of the result of the conversion represented as an unsigned value, unless the original (nonnegated) value would overflow; in the latter case, \fBstrtoul\fP() returns \fBULONG_MAX\fP and sets \fIerrno\fP to \fBERANGE\fP. Precisely the same holds for \fBstrtoull\fP() (with \fBULLONG_MAX\fP instead of \fBULONG_MAX\fP). .SH ERRORES .TP \fBEINVAL\fP (no está en C99) La \fIbase\fP dada contiene un valor no soportado. .TP \fBERANGE\fP El valor resultante está fuera de rango. .PP La implementación puede poner también \fIerrno\fP a \fBEINVAL\fP en caso de que no se realice ninguna conversión (no se encuentren dígitos, y se devuelva 0). .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbw32 lb lb l l l. Interfaz Atributo Valor T{ \fBstrtoul\fP(), \fBstrtoull\fP(), \fBstrtouq\fP() T} Seguridad del hilo Configuración regional de multi\-hilo seguro .TE .SH "CONFORME A" \fBstrtoul\fP(): POSIX.1\-2001, POSIX.1\-2008, C89, C99 SVr4. .PP \fBstrtoull\fP(): POSIX.1\-2001, POSIX.1\-2008, C99. .SH NOTAS Since \fBstrtoul\fP() can legitimately return 0 or \fBULONG_MAX\fP (\fBULLONG_MAX\fP for \fBstrtoull\fP()) on both success and failure, the calling program should set \fIerrno\fP to 0 before the call, and then determine if an error occurred by checking whether \fIerrno\fP has a nonzero value after the call. .PP In locales other than the "C" locale, other strings may be accepted. (For example, the thousands separator of the current locale may be supported.) .PP BSD tiene también la función .PP .in +4n .EX \fBu_quad_t strtouq(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB, int \fP\fIbase\fP\fB);\fP .EE .in .PP con una definición completamente análoga. Dependiendo del tamaño de palabra de la arquitectura actual, ésta puede ser equivalente a \fBstrtoull()\fP o a \fBstrtoul\fP(). .PP Negative values are considered valid input and are silently converted to the equivalent \fIunsigned long\fP value. .SH EJEMPLOS See the example on the \fBstrtol\fP(3) manual page; the use of the functions described in this manual page is similar. .SH "VÉASE TAMBIÉN" \fBa64l\fP(3), \fBatof\fP(3), \fBatoi\fP(3), \fBatol\fP(3), \fBstrtod\fP(3), \fBstrtol\fP(3), \fBstrtoumax\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .