16#define numberOfStaticInt32s ( 100 * 1000 )
19#define INT32_MIN -2147483648
20#define INT32_MAX 2147483647
23static int32_t *nfu_stringToListOfInt32s_2(
statusMessageReporting *smr,
char const *str,
char sep, int64_t *numberConverted,
char **endCharacter );
28 char **endCharacter ) {
30 if( strchr(
"0123456789.+-eE", sep ) != NULL ) {
36 *endCharacter = (
char *) str;
37 if( isspace( sep ) ) sep =
' ';
38 return( nfu_stringToListOfInt32s_2( smr, str, sep, numberConverted, endCharacter ) );
43static int32_t *nfu_stringToListOfInt32s_2(
statusMessageReporting *smr,
char const *str,
char sep, int64_t *numberConverted,
44 char **endCharacter ) {
46 int64_t i1, i2, numberConverted_initial = *numberConverted;
47 int32_t *Int32Ptr = NULL;
50 if( staticInt32s == NULL ) {
59 if( *numberConverted == 0 ) {
61 *endCharacter = (
char *) str;
69 char const *str2 = str;
71 while( isspace( *str2 ) ) ++str2;
84 *endCharacter = (
char *) str;
89 if( str2 == (
char const *) *endCharacter ) *endCharacter = (
char *) str;
91 if( str == (
char const *) *endCharacter ) {
92 int64_t
number = *numberConverted;
94 if( *numberConverted == 0 )
number = 1;
95 if( ( Int32Ptr = (int32_t *)
smr_malloc2( smr, (
size_t) number *
sizeof( int32_t ), 0,
"Int32Ptr" ) ) == NULL ) {
104 str = (
char const *) *endCharacter;
107 if( Int32Ptr == NULL ) Int32Ptr = nfu_stringToListOfInt32s_2( smr, str, sep, numberConverted, endCharacter );
108 if( Int32Ptr != NULL ) {
109 int32_t *Int32Ptr2 = &(Int32Ptr[numberConverted_initial]);
110 char *end = *endCharacter;
112 for( i2 = 0; i2 < i1; i2++, Int32Ptr2++ ) *Int32Ptr2 = staticInt32s[i2];
113 while( isspace( *end ) ) ++end;
114 if( *end == 0 ) *endCharacter = end;
118 free( staticInt32s );
128 long lValue = strtol( str, endCharacter, 10 );
137 *value = (int) lValue;
#define numberOfStaticInt32s
int32_t * nfu_stringToListOfInt32s(statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, char **endCharacter)
int nfu_stringToInt32(statusMessageReporting *smr, char const *str, char **endCharacter, int32_t *value)
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_setReportError2p(smr, libraryID, code, fmt)
#define smr_malloc2(smr, size, zero, forItem)