NAME
ss1i - Scan an int from a string
SYNOPSIS
#include "l/l_sys_scan.h"
Example compile flags (system dependent):
-DLINUX_386 -DLINUX_386_P4
-I/home/kobus/include
-L/home/kobus/load/linux_386_p4 -L/usr/local/lib -L/usr/lib
-lKJB -llapack -lblas -lg2c -lXext -lX11
int ss1i
(
const char *input_str,
int *int_ptr
);
DESCRIPTION
This routine reads an int from a string with more sophisticated error
reporting that available using scanf. It the contents of "str" is exactly one
number which will fit into an int, it sets *int_ptr to that number and
returns NO_ERROR. Otherwise and error message is set, and ERROR is returned.
The contents of *int_ptr are only changed on success.
RETURNS
If "str" is a valid int, then NO_ERROR is returned. Otherwise the problem
with "str" is reported in the set error message, and ERRROR is returned.
The problem with "str" can be printed with kjb_print_error.
NOTE
For successful return, "str" cannot contain two numbers. For example, it
can't be something like "1 2".
MACROS
ss1i32, ss1i16
These macros can be used to force scanning of a certain integer size. The
argument of these is normally a pointer to kjb_int32 or kjb_int16 as appropriate.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTOR
Kobus Barnard
SEE ALSO
ss1l
,
ss1spl
,
ss1pl
,
ss1pl_2
,
ss1spi
,
ss1pi
,
ss1pi_2
,
ss1s
,
ss1sps
,
ss1ps
,
ss1ps_2
,
ss1f
,
ss1d
,
ss1snf
,
ss1snd