00001
00002
00003
00004 #include "cddefines.h"
00005 #include "parse.h"
00006 #include "state.h"
00007
00008
00009 void ParseState(char *chCard)
00010 {
00011 char chFilename[INPUT_LINE_LENGTH];
00012
00013 DEBUG_ENTRY( "ParseState()" );
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 GetQuote( chFilename , chCard , true );
00025
00026
00027 if( nMatch("PRIN",chCard) )
00028 state.lgState_print = true;
00029
00030 if( nMatch(" GET",chCard) )
00031 {
00032 # if 0
00033 if( (state.ioGET_STATE = fopen( chFilename , "rb" ))==NULL )
00034 {
00035 fprintf( ioQQQ, " ParseState cannot open %s for reading.\n Sorry.", chFilename );
00036 puts( "[Stop in ParseState]" );
00037 cdEXIT(EXIT_FAILURE);
00038 }
00039 # endif
00040 state.lgGet_state = true;
00041 strcpy( state.chGetFilename , chFilename );
00042 }
00043 else if( nMatch(" PUT",chCard) )
00044 {
00045 # if 0
00046 if( (state.ioPUT_STATE = fopen( chFilename , "wb" ))==NULL )
00047 {
00048 fprintf( ioQQQ, " ParseState cannot open %s for writing.\n Sorry.", chFilename );
00049 puts( "[Stop in ParseState]" );
00050 cdEXIT(EXIT_FAILURE);
00051 }
00052 # endif
00053 state.lgPut_state = true;
00054 strcpy( state.chPutFilename , chFilename );
00055
00056
00057 if( nMatch(" ALL",chCard) )
00058 {
00059 state.lgPutAll = true;
00060 }
00061 else
00062 {
00063 state.lgPutAll = false;
00064 }
00065 }
00066
00067 else
00068 {
00069 fprintf( ioQQQ, " The STATE command has two keywords, GET and PUT. One must appear - I did not see it.\n Sorry.\n" );
00070 puts( "[Stop in ParseState]" );
00071 cdEXIT(EXIT_FAILURE);
00072 }
00073
00074 DEBUG_EXIT( "ParseState()" );
00075 return;
00076 }
00077