GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
scan_ulong(3) FreeBSD Library Functions Manual scan_ulong(3)

scan_ulong - parse an unsigned long integer in decimal ASCII representation

#include <libowfat/scan.h>

size_t scan_ulong(const char *src,unsigned long *dest);

scan_ulong parses an unsigned long integer in decimal ASCII representation from src and writes the result into dest. It returns the number of bytes read from src.

Leading + or - or space (or anything outside of 0-9) is not accepted. The libc conventions of "023" for octal or "0x23" for hexadecimal are not supported.

scan_ulong will abort the scan if the next character is not a digit, or if it is a digit but adding it to the number would lead to an integer overflow.

scan_ulong returns the number of characters successfully scanned and processed from src.

scan_ulong("23",&i) -> i=23, return 2

scan_ulong("+23",&i) -> return 0

scan_ulong("-23",&i) -> return 0

scan_ulong(" 23",&i) -> return 0

scan_ulong("23,42",&i) -> i=23, return 2

scan_ulong("023",&i) -> i=23, return 3

scan_ulong("0x23",&i) -> i=0, return 1

scan_ulong("4294967296",&i") -> i=429496729, return 9 // 32-bit system

scan_xlong(3), scan_8long(3), fmt_ulong(3)

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.