Bioplib
Protein Structure C Library
|
Read from a string using FORTRAN-like rigid formatting. More...
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include "SysDefs.h"
#include "macros.h"
#include "general.h"
Go to the source code of this file.
Functions | |
int | fsscanf (char *buffer, char *format,...) |
Read from a string using FORTRAN-like rigid formatting.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
Hard formatted version of sscanf(). Implements FORTRAN-like file reading.
The only parsing characters recognised are:
%<n>f A single precision floating point number of width <n> %<n>lf A double precision floating point number of width <n> %<n>d An integer of width <n> %<n>ld A long integer of width <n> %<n>u An unsigned of width <n> %<n>lu An unsigned long of width <n> %<n>s A string of width <n> %c A character (of width 1) %<n>x <n> spaces (like FORTRAN).
With the exception of the c parser, the column width, <n>, must* be specified.
Blank fields read as numbers are given a value of zero.
Returns: The number of arguments filled in (EOF if blank string or no specifiers found in format string).
For example:
Definition in file fsscanf.c.
int fsscanf | ( | char * | buffer, |
char * | format, | ||
... | |||
) |
[in] | *buffer | Buffer from which to read information |
[in] | *format | Format string (like scanf() et al., but see restrictions below) |
[out] | ... | Scanned output variables |
Hard formatted version of sscanf(). Implements FORTRAN-like rigid column reading out of a string.
The only parsing characters recognised are:
%<n>f A single precision floating point number of width <n> %<n>lf A double precision floating point number of width <n> %<n>d An integer of width <n> %<n>ld A long integer of width <n> %<n>u An unsigned of width <n> %<n>lu An unsigned long of width <n> %<n>s A string of width <n> %c A character (of width 1) %<n>x <n> spaces (like FORTRAN).
With the exception of the c parser, the column width, <n>, must* be specified.
Blank fields read as numbers are given a value of zero.