Changeset 085370c in git for factory/ftest/ftest_io.cc


Ignore:
Timestamp:
Mar 11, 1998, 5:11:28 PM (26 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0e083a79e79fdba1836c125232887812195dd9b8
Parents:
d636adca8e47219c329f1d05ef6a4b1712a88b48
Message:
***** merge from branch `factory-gcd' to main trunk


git-svn-id: file:///usr/local/Singular/svn/trunk@1209 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/ftest/ftest_io.cc

    rd636ad r085370c  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: ftest_io.cc,v 1.10 1997-11-21 13:59:07 schmidt Exp $ */
     2/* $Id: ftest_io.cc,v 1.11 1998-03-11 16:10:54 schmidt Exp $ */
    33
    44//{{{ docu
     
    141141//}}}
    142142
     143//{{{ bool ftestGetbool ( const char * stringBool )
     144//{{{ docu
     145//
     146// ftestGetbool() - read an boolean from stringBool,
     147//   return it.
     148//
     149//}}}
     150bool
     151ftestGetbool ( const char * stringBool )
     152{
     153    const char * tokenCursor;
     154
     155    bool b;
     156    // skip blancs
     157    stringBool = ftestSkipBlancs( stringBool );
     158
     159    // look for "true" or "false"
     160    tokenCursor = ftestSubStr( "true", stringBool );
     161    if ( stringBool != tokenCursor )
     162        b = true;
     163    else {
     164        tokenCursor = ftestSubStr( "false", stringBool );
     165        b = false;
     166    }
     167
     168    // do error checks
     169    if ( stringBool == tokenCursor )
     170        ftestError( CommandlineError,
     171                    "bool expected at `%s'\n", stringBool );
     172
     173    // check for extra characters
     174    stringBool = ftestSkipBlancs( tokenCursor );
     175    if ( *stringBool )
     176        ftestError( CommandlineError,
     177                    "extra characters after bool spec `%s'\n", stringBool );
     178
     179    return b;
     180}
     181//}}}
     182
    143183//{{{ void ftestPrintResult ( const char * resultName, const CanonicalForm & result )
    144184//{{{ docu
Note: See TracChangeset for help on using the changeset viewer.