Changeset 75dc12 in git for factory/ftest
- Timestamp:
- Oct 28, 1997, 6:20:53 PM (27 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- 893dc92f445605ec4a9c79ded0b5667307c5ca86
- Parents:
- 695c9d1775130a70e6014f892793ffc856de1097
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/ftest/ftest_io.cc
r695c9d r75dc12 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: ftest_io.cc,v 1. 7 1997-10-15 13:53:21schmidt Exp $ */2 /* $Id: ftest_io.cc,v 1.8 1997-10-28 17:20:53 schmidt Exp $ */ 3 3 4 4 //{{{ docu … … 35 35 const char * stringF = canFormSpec; 36 36 stringF = ftestSkipBlancs( stringF ); 37 if ( *stringF == '$' ) { 38 const char * tokenCursor = ftestSkipBlancs( stringF+1 ); 39 // read canonical form from environment 40 stringF = getenv( tokenCursor ); 41 if ( ! stringF ) 37 if ( *stringF == '<' ) { 38 CanonicalForm f; 39 40 stringF++; 41 if ( *stringF == '-' ) { 42 // read canonical form from stdin 43 cin >> f; 44 } else 42 45 ftestError( CanFormSpecError, 43 "no environment variable `$%s' set\n", 44 tokenCursor ); 46 "not a valid canonical form specification `<%s'\n", 47 stringF ); 48 return f; 49 } else { 50 if ( *stringF == '$' ) { 51 const char * tokenCursor = ftestSkipBlancs( stringF+1 ); 52 // read canonical form from environment 53 stringF = getenv( tokenCursor ); 54 if ( ! stringF ) 55 ftestError( CanFormSpecError, 56 "no environment variable `$%s' set\n", 57 tokenCursor ); 58 } 59 60 // create terminated CanonicalForm 61 int i = strlen( stringF ); 62 char * terminatedStringF = new char[i+2]; 63 char * stringCursor = terminatedStringF; 64 while ( *stringF ) { 65 switch ( *stringF ) { 66 case '.': *stringCursor = '*'; break; 67 case '{': *stringCursor = '('; break; 68 case '}': *stringCursor = ')'; break; 69 default: *stringCursor = *stringF; break; 70 } 71 stringF++; stringCursor++; 72 } 73 *stringCursor++ = ';'; 74 *stringCursor = '\0'; 75 76 // read f 77 CanonicalForm f; 78 istrstream( terminatedStringF ) >> f; 79 80 delete [] terminatedStringF; 81 return f; 45 82 } 46 47 // create terminated CanonicalForm48 int i = strlen( stringF );49 char * terminatedStringF = new char[i+2];50 char * stringCursor = terminatedStringF;51 while ( *stringF ) {52 switch ( *stringF ) {53 case '.': *stringCursor = '*'; break;54 case '{': *stringCursor = '('; break;55 case '}': *stringCursor = ')'; break;56 default: *stringCursor = *stringF; break;57 }58 stringF++; stringCursor++;59 }60 *stringCursor++ = ';';61 *stringCursor = '\0';62 63 // read f64 CanonicalForm f;65 istrstream( terminatedStringF ) >> f;66 67 delete [] terminatedStringF;68 return f;69 83 } 70 84 //}}}
Note: See TracChangeset
for help on using the changeset viewer.