Changeset 90c3b1c for src/libcfa/iostream
- Timestamp:
- Mar 2, 2016, 4:59:19 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- bdad1679
- Parents:
- ac1ed49
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream
rac1ed49 r90c3b1c 7 7 // iostream -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Peter A. Buhr 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 17 14:04:24201613 // Update Count : 3212 // Last Modified On : Wed Mar 2 16:44:32 2016 13 // Update Count : 81 14 14 // 15 15 16 #ifndef IOSTREAM_H17 #define IOSTREAM_H16 #ifndef __IOSTREAM_H__ 17 #define __IOSTREAM_H__ 18 18 19 19 #include "iterator" 20 20 21 typedef unsigned long streamsize_type;22 23 21 context ostream( dtype ostype ) { 22 _Bool sepPrt( ostype * ); 23 void sepOn( ostype * ); 24 void sepOff( ostype * ); 25 void sepSet( ostype *, const char * ); 26 const char * sepGet( ostype * ); 27 void sepDisable( ostype * ); 28 void sepEnable( ostype * ); 24 29 int fail( ostype * ); 25 30 int flush( ostype * ); 26 ostype * write( ostype *, const char *, streamsize_type ); 31 void open( ostype * os, const char * name, const char * mode ); 32 void close( ostype * os ); 33 ostype * write( ostype *, const char *, unsigned long int ); 34 int prtfmt( ostype *, const char fmt[], ... ); 27 35 }; 36 28 37 context writeable( type T ) { 29 38 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T ); … … 33 42 34 43 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char ); 44 45 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, short int ); 46 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned short int ); 35 47 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, int ); 36 48 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned int ); … … 39 51 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long int ); 40 52 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long long int ); 53 41 54 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float ); // FIX ME: should not be required 42 55 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double ); 43 56 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double ); 57 44 58 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float _Complex ); 45 59 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double _Complex ); 46 60 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double _Complex ); 61 47 62 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * ); 48 63 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * ); 49 64 50 forall( dtype ostype , dtype retostype | ostream( ostype ) | ostream( retostype ) ) retostype * ?|?( ostype *os, retostype * (* manip)(ostype*) );65 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, ostype * (*)( ostype * ) ); 51 66 forall( dtype ostype | ostream( ostype ) ) ostype * endl( ostype * ); 67 forall( dtype ostype | ostream( ostype ) ) ostype * sepOn( ostype * ); 68 forall( dtype ostype | ostream( ostype ) ) ostype * sepOff( ostype * ); 52 69 53 70 // writes the range [begin, end) to the given stream … … 63 80 int fail( istype * ); 64 81 int eof( istype * ); 65 istype * get( istype *, int * ); 66 istype * read( istype *, char *, streamsize_type ); 82 void open( istype * is, const char * name, const char * mode ); 83 void close( istype * is ); 84 istype * read( istype *, char *, unsigned long int ); 67 85 istype * ungetc( istype *, char ); 86 int scanfmt( istype *, const char fmt[], ... ); 68 87 }; 69 88 … … 72 91 }; 73 92 74 forall( dtype istype | istream( istype ) ) 75 istype * ?|?( istype *, char * ); 93 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char * ); 76 94 77 forall( dtype istype | istream( istype ) ) 78 istype * ?|?( istype *, int * ); 95 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, short int * ); 96 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned short int * ); 97 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, int * ); 98 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned int * ); 99 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long int * ); 100 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long long int * ); 101 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long int * ); 102 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long long int * ); 79 103 80 #endif // IOSTREAM_H 104 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float * ); 105 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double * ); 106 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double * ); 107 108 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float _Complex * ); 109 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double _Complex * ); 110 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double _Complex * ); 111 112 struct _Istream_str1 { char * s; }; 113 _Istream_str1 str( char * ); 114 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_str1 ); 115 116 struct _Istream_str2 { char * s; int size; }; 117 _Istream_str2 str( char *, int size ); 118 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_str2 ); 119 120 #endif // __IOSTREAM_H__ 81 121 82 122 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.