libowfat Documentation - scan.a

scan_8long - parse an unsigned long integer in octal ASCII representation
scan_charsetnskip - skip characters from set
scan_double - parse a floating point number in decimal ASCII representation
scan_noncharsetnskip - skip characters not from set
scan_nonwhitenskip - skip non-whitespace
scan_plusminus - parse '+' or '-'
scan_ulong - parse an unsigned long integer in decimal ASCII representation
scan_whitenskip - skip whitespace
scan_xlong - parse an unsigned long integer in hexadecimal ASCII representation

Table of Contents

Synopsis

#include <scan.h>
int scan_8long(const char *src, unsigned long *dest);
int scan_charsetnskip(const char *src, const char *charset, unsigned int *limit);
int scan_double(const char *src, double *dest);
int scan_noncharsetnskip(const char *src, const char *charset, unsigned int *limit);
int scan_nonwhitenskip(const char *src, unsigned int *limit);
int scan_plusminus(const char *src, int *dest);
int scan_ulong(const char *src, unsigned long *dest);
int scan_whitenskip(const char *src, unsigned int *limit);
int scan_xlong(const char *src, unsigned long *dest);

Description

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

scan_charsetnskip returns the length of the maximum prefix of src that consists solely of characters that occur in charset (up to and not including the \0).

scan_double parses a floating point number in decimal ASCII representation from src and writes the result into dest. It returns the number of bytes read from src.

scan_noncharsetnskip returns the length of the maximum prefix of src that consists solely of characters that do not occur in charset (up to and not including the \0).

scan_nonwhitenskip returns the length of the maximum prefix of src that consists solely of non-whitespace characters as defined by !isspace. Normally, this is everything but ' ', '\f', '\n', '\r', '\t', '\v'.

scan_plusminus parses an ASCII '+' or '-' sign from src, sets dest 1 or -1, respectively, and returns 1. If neither is found, '+' is assumed and 0 is returned.

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.

scan_whitenskip returns the length of the maximum prefix of src that consists solely of whitespace charac­ ters as defined by isspace. Normally, this is ' ', '\f', '\n', '\r', '\t', '\v'.

scan_xlong parses an unsigned long integer in hexadecimal ASCII representation from src and writes the result into dest. It returns the number of bytes read from src. scan_xlong understands both upper and lower case letters. scan_xlong does not expect or understand a "0x" prefix.

Tino Reichardt <der@mcmilk.de>, Felix von Leitner <der@fefe.de>
Version: 5.2, Date: 2001/05/26