Page 1042 DESCRIPTION The strtoul() function converts the string in nptr to an unsigned long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. The string must begin with an arbitrary amount of whitespace (as determined by isspace(3)) followed by a single optional + or - sign. If base is zero or 16, the string may then include a 0x prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is 0, in which case it is taken as 8 (octal). The remainder of the string is converted to an unsigned long int value in the obvious manner, stopping at the first character that is not a valid digit in the given base. (In bases above 10, the letter A in either upper- or lowercase represents 10, B represents 11, and so forth, with Z representing 35.) If endptr is not NULL, strtoul() stores the address of the first invalid character in *endptr. If there were no digits at all, strtoul() stores the original value of nptr in *endptr. (Thus, if *nptr is not \0 but **endptr is \0 on return, the entire string is invalid.) RETURN VALUE The strtoul() function returns either the result of the conversion or, if there was a leading minus sign, the negation of the result of the conversion, unless the original (non-negated) value would overflow; in the latter case, strtoul() returns ULONG_MAX and sets the global variable errno to ERANGE. ERRORS
CONFORMS TO SVID 3, BSD 4.3, ISO 9899 SEE ALSO atof(3), atoi(3), atol(3), strtod(3), strtol(3) BUGS strtoul ignores the current locale. GNU, 29 March 1993 strxfrmstrxfrmString transformation SYNOPSIS #include <string.h> size t strxfrm(char *dest, const char *src, size_t n); DESCRIPTION The strxfrm() function transforms the src string into a form such that the result of strcmp() on two strings that have been transformed with strxfrm() is the same as the result of strcoll() on the two strings before their transformation. The first n characters of the transformed string are placed in dest. The transformation is based on the program's current locale for category LC_COLLATE. (See setlocale(3)). RETURN VALUE The strxfrm() function returns the number of bytes required to store the transformed string in dest excluding the terminating \0 character. If the value returned is n or more, the contents of dest are indeterminate. Page 1043 CONFORMS TO SVID 3, BSD 4.3, ISO 9899 NOTES The Linux C Library currently hasn't implemented the complete POSIX-collating. In the POSIX or C locales strxfrm() is equivalent to copying the string with strncpy(). SEE ALSO bcmp(3), memcmp(3), strcasecmp(3), strcmp(3), strcoll(3), setlocale(3) GNU, 12 April 1993 swabswabSwaps adjacent bytes SYNOPSIS #include <string.h> void swab(const void *from, void*to, size_t n); DESCRIPTION The swab() function copies n bytes from the array pointed to by from to the array pointed to by to, exchanging adjacent even and odd bytes. This function is used to exchange data between machines that have different low/high byte ordering. RETURN VALUE The swab() function returns no value. CONFORMS TO SVID 3, BSD 4.3 SEE ALSO bstring(3) GNU, 13 April 1993 sysconfsysconfGets configuration information at runtime SYNOPSIS #include <unistd.h> long sysconf(int name); DESCRIPTION sysconf() provides a way for the application to determine values for system limits or options at runtime. The equivalent macros defined in <unistd.h> can only give conservative values; if an application wants to take advantage of values that may change, a call to sysconf() can be made, which may yield more liberal results. For getting information about a particular file, see fpathconf() or pathconf(). The following values are supported for name. First, the POSIX.1_compatible values: Page 1044
Next, the POSIX.2 values:
|