cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_state.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*ParseState save or recover previous state of the code */
4 #include "cddefines.h"
5 #include "parse.h"
6 #include "state.h"
7 
8 /*ParseState save or recover previous state of the code */
9 void ParseState(char *chCard)
10 {
11  char chFilename[INPUT_LINE_LENGTH];
12 
13  DEBUG_ENTRY( "ParseState()" );
14 
15  /*
16  * get file name for this punch output.
17  * GetQuote does the following -
18  * first copy original version of file name into chLabel,
19  * string does include null termination.
20  * set filename in OrgCard and second parameter to spaces so
21  * that not picked up below as keyword
22  * last parameter says to abort if no quote found
23  */
24  GetQuote( chFilename , chCard , true );
25 
26  /* option to print all contents of arrays - BIG PRINTOUT! */
27  if( nMatch("PRIN",chCard) )
28  state.lgState_print = true;
29 
30  if( nMatch(" GET",chCard) )
31  {
32 # if 0
33  state.ioGET_STATE = open_data( chFilename, "rb", AS_LOCAL_ONLY );
34 # endif
35  state.lgGet_state = true;
36  strcpy( state.chGetFilename , chFilename );
37  }
38  else if( nMatch(" PUT",chCard) )
39  {
40 # if 0
41  state.ioPUT_STATE = open_data( chFilename , "wb", AS_LOCAL_ONLY );
42 # endif
43  state.lgPut_state = true;
44  strcpy( state.chPutFilename , chFilename );
45  /* look for keyword ALL - says want to save state for all iterations,
46  * default is last iteration */
47  if( nMatch(" ALL",chCard) )
48  {
49  state.lgPutAll = true;
50  }
51  else
52  {
53  state.lgPutAll = false;
54  }
55  }
56 
57  else
58  {
59  fprintf( ioQQQ, " The STATE command has two keywords, GET and PUT. One must appear - I did not see it.\n Sorry.\n" );
60  cdEXIT(EXIT_FAILURE);
61  }
62  return;
63 }

Generated for cloudy by doxygen 1.8.4