Changeset cfadd08 for libcfa/src


Ignore:
Timestamp:
Aug 31, 2021, 1:49:10 AM (3 years ago)
Author:
Jacob Prud'homme <jafprudhomme@…>
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)
Message:

Slimmed down copied code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/parseconfig.cfa

    r8e0f2db rcfadd08  
    9999        KVPairs kv_pairs = { num_entries };
    100100
    101         char key[64];
    102         char value[256];
     101        try {
     102                ifstream in = { config_file };                                  // open the configuration file for input
    103103
    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];
    106107
    107                 while () {
    108                 for ( Parmnum ) {                                                               // parameter names can appear in any order
    109108                  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
    113110                        in | value;
    114111
     
    117114                  if ( eof( in ) ) break;
    118115                        in | nl;                                                                        // ignore remainder of line
    119                         numOfParms += 1;
    120                         parms[posn].value = value;
    121116                } // for
    122117        } catch( Open_Failure * ex; ex->istream == &in ) {
Note: See TracChangeset for help on using the changeset viewer.