Changeset cfadd08
- Timestamp:
- Aug 31, 2021, 1:49:10 AM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
- Children:
- f789b82
- Parents:
- 8e0f2db
- git-author:
- Jacob Prud'homme <jafprudhomme@…> (08/03/21 01:18:25)
- git-committer:
- Jacob Prud'homme <jafprudhomme@…> (08/31/21 01:49:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/parseconfig.cfa ¶
r8e0f2db rcfadd08 99 99 KVPairs kv_pairs = { num_entries }; 100 100 101 char key[64];102 char value[256];101 try { 102 ifstream in = { config_file }; // open the configuration file for input 103 103 104 try { 105 ifstream in = { config_file }; // open the configuration file for input 104 while () { // parameter names can appear in any order 105 char key[64]; 106 char value[256]; 106 107 107 while () {108 for ( Parmnum ) { // parameter names can appear in any order109 108 if ( comments( in, key ) ) break; // eof ? 110 for ( posn = 0; posn < Parmnum && strcmp( name, parms[posn].name ) != 0; posn += 1 ); // linear search 111 if ( posn == Parmnum ) break; // configuration not found ? 112 if ( parms[posn].value != 0 ) break; // duplicate configuration ? 109 // Must add check to see if we have already read in a key-value pair, once we switch to using hash table as intermediate storage 113 110 in | value; 114 111 … … 117 114 if ( eof( in ) ) break; 118 115 in | nl; // ignore remainder of line 119 numOfParms += 1;120 parms[posn].value = value;121 116 } // for 122 117 } catch( Open_Failure * ex; ex->istream == &in ) {
Note: See TracChangeset
for help on using the changeset viewer.