summaryrefslogtreecommitdiff
path: root/src/util/ParseFile.c
Commit message (Collapse)AuthorAge
* (1) Fix compilation issues on Pandorasbrandt2013-02-26
| | | | | | | | | | | | (2) Disallow setting multiple parameters on one line (3) Allow sign in floating point format to be optional (4) Use package piraha (5) change PirahaParser to cctk_PirahaParser (6) remove size.py git-svn-id: http://svn.cactuscode.org/flesh/trunk@4966 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Change the parameter parser to Pirahasbrandt2013-02-25
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4960 17b73243-c579-4c4c-a9d2-2d5706c11dac
* ParseFile.c: Change semantics of call to fread so that error check makes sensehinder2012-11-20
| | | | | | fread takes an "item size" and a "number of items" and returns the number of items successfully read. Previously, we asked for 1 item of the size of the file, to read the entire file. The error check which was added in r4915 assumed that the returned value of fread was the number of bytes read, which is not correct since only one item is returned, and causes Cactus to fail with a fatal error when any parameter file is loaded. The present commit changes the fread call to ask for file_size items of size 1, for which the error-checking code makes sense, as there are now file_size items returned. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4917 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Check file size while readingeschnett2012-11-19
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4915 17b73243-c579-4c4c-a9d2-2d5706c11dac
* allow ${parfile} in parameter files to allow ${parfile}/subdirknarf2012-10-24
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4892 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add missing #includeeschnett2012-04-16
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4800 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Simplify two routines in ParseFile.ceschnett2012-04-13
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4799 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Accept comments in multi-line strings in parameter fileseschnett2011-07-02
| | | | | | | | | | Modify the parameter file parser to accept comments in multi-line strings. These comments extend from a "#" character to the end of the line. This makes it much easier to comment out variables in output strings. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4710 17b73243-c579-4c4c-a9d2-2d5706c11dac
* from Ian Hinder:knarf2011-01-06
| | | | | | | | | | | | | | | Correctly load parameter files with DOS line-endings Before this commit, when a parameter file with DOS line-endings was used, certain features of Cactus did not work correctly. For example, setting an output directory of $parfile would create an output directory named "$parfile" instead of expanding the parameter filename. This commit converts any CR-LF sequences to LF immediately after the parameter file is loaded. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4663 17b73243-c579-4c4c-a9d2-2d5706c11dac
* The function can get confused with detecting the end of the bufferschnetter2010-01-18
| | | | | | | | | | | | | | when the last line is in a comment or in a string, and may overrun the end of the buffer. The symptoms are error messages past the last line of the parameter file, because the memory after the buffer end is interpreted as (probably mal-formed) parameter file content. Since the paring routine is quite complex, this patch works around this problem by increasing the size of the buffer by a few characters and setting these to NUL. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4594 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Use size_t instead of char as index variable into the parse bufferschnetter2009-11-11
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4576 17b73243-c579-4c4c-a9d2-2d5706c11dac
* This patch improves the parser used by Cactus to prepocess parameterknarf2009-09-25
| | | | | | | | | | | | | | | | | | | files. The main changes are: - when reading a parameter file do not parse the file while reading, but read it first into a buffer, preprocess that and parse the buffer after that - replace the code which changes $parfile into the parameter file name to use this buffer preprocessing - replace $ENV{'*'} "defines" by environment variable values (*), e.g. $ENV{'HOME'} with $HOME. Frank git-svn-id: http://svn.cactuscode.org/flesh/trunk@4573 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Make the parameter file parser preserve newlines in multi-line string parametertradke2006-08-31
| | | | | | | | | | values. This makes its behaviour consistent with the flesh API routine CCTK_ParameterSet(). This closes PR Cactus/2050: preserve newlines in quoted string parameter values. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4371 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct typographical error in warning messageschnetter2006-03-21
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4272 17b73243-c579-4c4c-a9d2-2d5706c11dac
* As discussed in today's Cactus call, applying patches from 14 Febswhite2006-03-02
| | | | | | | Patches mailing list. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4263 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Don't highlight parameter parser warning messages about newlines in quotedtradke2005-08-04
| | | | | | | | strings. This applies patch http://www.cactuscode.org/pipermail/patches/2005-June/000061.html. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4102 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Revert accidental changes from the last commit.schnetter2004-12-28
| | | | | | | Sorry. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3945 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Rename "round" to "myround". Otherwise, the function "round" has theschnetter2004-12-28
| | | | | | | | same name as the one from <math.h> (which is #included) but has a different return type, which is an error for gcc 4.0. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3944 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Yaakoub to support parameter files with <CR><LF> at ends of lines.goodale2004-05-10
| | | | | | | Fixes PR 1596. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3713 17b73243-c579-4c4c-a9d2-2d5706c11dac
* When stripping the directory part off the parameter file name, do notschnetter2004-02-06
| | | | | | | | forget to also strip the "/" that separates the directory name and the file name. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3571 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Putting semicolons at the end of the CCTK_FILEVERSIONs.goodale2002-11-12
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@3028 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed parsing of undocumented $PARFILE variable.tradke2002-05-13
| | | | | | | This closes PR Cactus/1041. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2809 17b73243-c579-4c4c-a9d2-2d5706c11dac
* The callback routine, CCTKi_SetParameter(), passed to the ParseFile() routinetradke2002-01-02
| | | | | | | | | | now takes the current line number in the parameter file as a third argument. CCTKi_SetParameter() is now able to tell you what line in the parameter file was erroneous. This closes PR Cactus-838. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2555 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixes for Cactus/833,828,825allen2001-12-04
| | | | | | | | | | | | | | | Parsing errors from Parameter file are fatal errors Report all parameter errors before terminating simulation (actually this isn't quite true, it will report all parsing errors and then stop if necessary and then report all parameter setting errors and stop if necessary) In parsing the parameter file omitting the "=" and ommiting the "= value" are fatal errors. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2478 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Increased parse buffer size to 8 kB. Also allocate buffers dynamicallytradke2001-09-07
| | | | | | | | | instead of reserving them on the function stack (might cause stack overflow). This closes PR Cactus-784. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2345 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Making rcsid strings constant - PR 669.goodale2001-05-10
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2159 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Changing the name of a shadowed local variableallen2001-02-24
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2053 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fix to CCTK_ParameterFilename, and freeing some memory I'd missed whenallen2001-02-11
| | | | | | | the $PARAMETER_FILE directive is used. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2015 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Replacing hard-coded (and wrong) filename with __FILE__ macro in errorgoodale2001-01-14
| | | | | | | | | message. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1993 17b73243-c579-4c4c-a9d2-2d5706c11dac
* grdoc, style-guidelines, ...goodale2000-10-05
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1854 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed $PARAMETER_FILE to strip off directory in par fileallen2000-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@1847 17b73243-c579-4c4c-a9d2-2d5706c11dac
* (Nasty) little hack to add the old Cactus 3 nameofparfile functionality ...allen2000-06-29
| | | | | | | | | | | | | | | | | | anywhere that $PARAMETER_FILE appears it will be replaced by the name of the parameter file that was used, without the last 4 characters. This is so you can say IO::outdir = $PARAMETER_FILE so that ./cactus_exe mypar.par will put output in a directory mypar (using the standard IO thorns). This feature won't be documented until it is added properly, and the notation may change slightly. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1707 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Removing rcsid warningsallen2000-04-17
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@1559 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixing debug statements so that the file parser reports the line in the ↵allen2000-03-09
| | | | | | original parameter file with the error git-svn-id: http://svn.cactuscode.org/flesh/trunk@1450 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Removed tabs from files.goodale1999-11-24
| | | | | | | | | Added @version lines to various header files. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1170 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Now a "!" starts a directive in the parameter files, for now this isallen1999-09-25
| | | | | | | | | | | | | just for adding a description of the par file !DESC "Black hole evolution with ADM" which is parsed by runtest Needs to be changed so that it only picks up a ! at the start of the line, git-svn-id: http://svn.cactuscode.org/flesh/trunk@993 17b73243-c579-4c4c-a9d2-2d5706c11dac
* If there is no = before the end of the line discards the tokensgoodale1999-07-07
| | | | | | | | | | | | collected so far. This stops it continuing collecting the name of a parameter across newlines. Note that this bug will also be there in Cactus 3.0. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@686 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Routine to parse a parameter file and pass the resulting tokens togoodale1999-01-12
an arbitrary function. Nicked from Paul's Cactus parser. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@46 17b73243-c579-4c4c-a9d2-2d5706c11dac