Changes in src/libcfa/iostream.c [44574f2:1e6e08de]
- File:
-
- 1 edited
-
src/libcfa/iostream.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream.c
r44574f2 r1e6e08de 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 25 13:09:28 201813 // Update Count : 4 6712 // Last Modified On : Thu Dec 21 13:55:09 2017 13 // Update Count : 427 14 14 // 15 15 … … 19 19 #include <stdio.h> 20 20 #include <stdbool.h> // true/false 21 //#include <string.h> // strlen, strcmp 22 extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); 23 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); 21 #include <string.h> // strlen 24 22 #include <float.h> // DBL_DIG, LDBL_DIG 25 23 #include <complex.h> // creal, cimag … … 303 301 304 302 forall( dtype istype | istream( istype ) ) 305 istype & ?|?( istype & is, _Bool & b ) {306 char val[6];307 fmt( is, "%5s", val );308 if ( strcmp( val, "true" ) == 0 ) b = true;309 else if ( strcmp( val, "false" ) == 0 ) b = false;310 else {311 fprintf( stderr, "invalid _Bool constant\n" );312 abort();313 } // if314 return is;315 } // ?|?316 317 forall( dtype istype | istream( istype ) )318 303 istype & ?|?( istype & is, char & c ) { 319 304 fmt( is, "%c", &c ); // must pass pointer through varg to fmt … … 425 410 } // ?|? 426 411 427 forall( dtype istype | istream( istype ) )428 istype & ?|?( istype & is, istype & (* manip)( istype & ) ) {429 return manip( is );430 } // ?|?431 432 forall( dtype istype | istream( istype ) )433 istype & endl( istype & is ) {434 fmt( is, "%*[ \t\f\n\r\v]" ); // ignore whitespace435 return is;436 } // endl437 438 412 _Istream_cstrUC cstr( char * str ) { return (_Istream_cstrUC){ str }; } 439 413 forall( dtype istype | istream( istype ) )
Note:
See TracChangeset
for help on using the changeset viewer.