summaryrefslogtreecommitdiff
path: root/src/util/Table.c
Commit message (Collapse)AuthorAge
* Replace Cactus complex number type with C/C++ complex numberseschnett2013-03-08
| | | | | | | | | | | | | | | | Map CCTK_COMPLEX to "double complex" in C, and "complex<double>" in C++. (It is already mapped to "double complex" in Fortran.) Update type definitions. Re-implement Cactus complex number math functions by calling the respective C functions. Update thorn that access real and imaginary parts of complex numbers to use standard-conforming methods instead. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4979 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Make table printing functions publicly accessibleeschnett2011-11-09
| | | | | | | | | | | | The table data types (util_Table.h) have internal routines that print the table contents to screen. This can be helpful for debugging. This patch makes these functions publicly available. Add a routine Util_TablePrintPretty that converts a table to a nice, human-readable string. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4769 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fix for the erroneuously lablelled memory corruption. It seems what was just ↵yye002006-01-10
| | | | | | needed was more checking. This checked out alright on lemieux. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4231 17b73243-c579-4c4c-a9d2-2d5706c11dac
* minor fix for complex numbersyye002006-01-06
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4230 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Untabifying.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4163 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Renaming min macro to MIN to avoid a conflict on windows.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4162 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add Cactus variable type CCTK_POINTER_TO_CONSTschnetter2005-08-25
| | | | | | | | | | Complete the implementation of the Cactus variable type CCTK_POINTER_TO_CONST. Define a constant CCTK_VARIABLE_POINTER_TO_CONST. Handle this variable when asking for its name and its size. Allow values of this type in tables. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4113 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Declare variables at the beginning of a function block.tradke2005-03-21
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4017 17b73243-c579-4c4c-a9d2-2d5706c11dac
* update header comment description of where more docs can be foundjthorn2005-03-18
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4014 17b73243-c579-4c4c-a9d2-2d5706c11dac
* move some debug printf() calls closer to the start of their functionsjthorn2005-03-18
| | | | | | | (all inside #ifdef UTIL_TABLE_TEST) git-svn-id: http://svn.cactuscode.org/flesh/trunk@4010 17b73243-c579-4c4c-a9d2-2d5706c11dac
* split Table.c test driver out into a separate thorn (CactusTest/TestTable)jthorn2005-03-18
| | | | | | | | | | | also add another error check in insert_table_entry() to catch the case where the type code is invalid and hence CCTK_VarTypeSize() returns -1 --> this gives a new error return from this function, and hence from all the Util_TableSet* functions git-svn-id: http://svn.cactuscode.org/flesh/trunk@4008 17b73243-c579-4c4c-a9d2-2d5706c11dac
* * untabifyjthorn2005-03-17
| | | | | | | | | * add a bunch of debug printing to the standalone test drivers (which still core-dumps on my laptop after corrupting the malloc heap; I'm in the process of tracking down what's wrong...) git-svn-id: http://svn.cactuscode.org/flesh/trunk@4006 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Make CCTK_BYTE and CCTK_CHAR be distinct types. CCTK_BYTE is for gridschnetter2005-01-29
| | | | | | | | | | | | variables, and CCTK_CHAR (like CCTK_STRING) only for other purposes, e.g. tables. * Introduce unique integer constants for them * Add missing conversion functions from and to strings * Add table functions for CCTK_BYTE. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3972 17b73243-c579-4c4c-a9d2-2d5706c11dac
* The Fortran wrappers for Util_Table{Get,Set}Char are broken; removeschnetter2005-01-27
| | | | | | | | | them. Technically, Fortran has no character type, but only strings, hence the interface to that routine needs to be different from C. Util_TableSetString is still there, used, and works. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3967 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
* * introduce new #define UTIL_TABLE_FORTRAN_WRAPPERS to controljthorn2004-04-15
| | | | | | | | | | whether we compile the Fortran wrapper functions, and put all Fortran wrappers inside this --> standalone test driver now compiles again (& passes) git-svn-id: http://svn.cactuscode.org/flesh/trunk@3665 17b73243-c579-4c4c-a9d2-2d5706c11dac
* add comment explaining last commit :)jthorn2004-03-26
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3604 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Do not report an error when allocating 0-sized arrays on certainschnetter2004-03-26
| | | | | | | systems. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3603 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Use the correct macros to determine which CCTK_* types are defined.schnetter2004-03-08
| | | | | | | Fix wrong prototype. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3585 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce the new Cactus variable type CCTK_INT1.schnetter2003-10-13
| | | | | | | Extend routines to handle the new type. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3431 17b73243-c579-4c4c-a9d2-2d5706c11dac
* renamejthorn2003-07-20
| | | | | | | | | | | | | | | | | Util_Table{Set,Get}FnPointer() --> Util_Table{Set,Get}FPointer() Util_Table{Set,Get}FnPointerArray() --> Util_Table{Set,Get}FPointerArray() (and keep old names as aliases for backwards compatability) this fixes bug Cactus/1308 also add test routines for Util_Table{Set,Get}PointerArray() Util_Table{Set,Get}FPointer() Util_Table{Set,Get}FPointer_Array() so there are now test routines for all the CCTK_POINTER and CCTK_FPOINTER routines (both scalar and array) git-svn-id: http://svn.cactuscode.org/flesh/trunk@3321 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fix a memory leak in Util_TableCreateFromString():jthorn2003-07-19
| | | | | | | | | | | | | This routine first tries to create a table (if this fails it returns an error code). Then it tries to add entries to the table via Util_TableSetFromString(). If this fails it previously returned without destroy the table, thus leaking memory. The fix is to destroy the table before returning the error code. This fixes bug Cactus/1561. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3317 17b73243-c579-4c4c-a9d2-2d5706c11dac
* add standalone-test-driver tests for Util_Table{Set,Get}Pointerjthorn2003-07-19
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3316 17b73243-c579-4c4c-a9d2-2d5706c11dac
* put all Fortran-wrapper routines insidejthorn2003-07-19
| | | | | | | | | | | | | | | #ifndef UTIL_TABLE_TEST #endif /* !UTIL_TABLE_TEST */ since they use CCTK_FCALL and CCTK_FNAME, both of which are only expanded by the perl preprocessor, and thus won't be defined when compiling this (C) file directly for standalone tests. With this change (and my just-committed changes to the standalone-test makefile), the standalone test driver in Table.c now compiles ok, and passes all its tests. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3315 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added fortran wrappers for most of the table API routines.tradke2003-01-20
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3092 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added fortran wrappers for Util_TableCreateFromString() and Util_TableDestroy().tradke2002-12-11
| | | | | | | More to come. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3041 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
* Completed Util_TableSetFromString() to also parse string values and arrays.tradke2002-05-23
| | | | | | | See its Function Reference entry in the User's Guide for details. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2850 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed grdoc.tradke2002-05-16
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2819 17b73243-c579-4c4c-a9d2-2d5706c11dac
* From Jonathan Thornburg:allen2002-05-09
| | | | | | | | | | | | | | Change our fake version of the C99/C++ "bool" type from typedef enum { false = 0, true = 1 } bool; to typedef int bool; #define true 1 #define false 0 so we can assign an int to a bool without triggering compiler warnings on the origin. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2804 17b73243-c579-4c4c-a9d2-2d5706c11dac
* CCTK_FN_POINTER -> CCTK_FPOINTERallen2002-04-28
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2770 17b73243-c579-4c4c-a9d2-2d5706c11dac
* [[from Jonathan Thornburg]]rideout2002-04-03
| | | | | | | | | | | | | | | | | | | | src/util/Table.c src/include/util_Table.h * add new functions (cf my E-mail of 30 Mar 2002) Util_TableClone() Util_TableItClone() * add new functions (cf Erik Schnetter's E-mails of 5 Feb 2002) Util_Table{Set,Get}Generic() Util_Table{Set,Get}GenericArray() * add tests for new functions * fix a memory leak in Util_TableDestroy() * fixed some assert( variable = value ) bugs (yikes!!) * refactor some code to better modularize the implementation * add some more const qualifiers to local vars * reformat code to match flesh standard indentation and { } conventions git-svn-id: http://svn.cactuscode.org/flesh/trunk@2683 17b73243-c579-4c4c-a9d2-2d5706c11dac
* [[from Jonathan Thornburg]]tradke2002-02-04
| | | | | | | | | | | | | | | | | | Small fixes to Util_TableSetFromString(): * trap some error cases involving invalid keys which slipped by before * document UTIL_ERROR_BAD_KEY as a possible error code * accept trailing whitespace at end of string (this was rejected before) * revise BNF in grdoc comment to correctly describe what the code accepts [I've already revised it in the latex docs (doc/UsersGuide/FunctionReference.tex)] Also fix Util_TableCreateFromString(): * document UTIL_ERROR_BAD_KEY as a possible error code Thanks to Erik Schnetter for pointing out these problems! git-svn-id: http://svn.cactuscode.org/flesh/trunk@2606 17b73243-c579-4c4c-a9d2-2d5706c11dac
* [[message actually from Jonathan Thornburg, checkin by David Rideoutrideout2002-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | since JT doesn't have the appropriate CVS karma]] src/util/Table.c * by popular (or at least semi-popular :) demand..... add new function int Util_TableSetFromString(int handle, const char *string) to set a sequence of key/value entries in an existing table, based on a parameter-file-style string. [[This functionality was present before in Util_TableCreateFromSTring(), but bundled together with creating a new table. This change splits out the "scan through a string doing the table assignments it specifies" functionality into a separate function, since it seems useful in various contextx.]] * change Util_TableCreateFromString() to call the new Util_TableSetFromString() to do most of the work * change the test suite to test the new function a bit src/util/makefile * new file, makefile to build standalone test driver for table routines src/include/util_Table.h * add prototype for new Util_TableSetFromString() function git-svn-id: http://svn.cactuscode.org/flesh/trunk@2588 17b73243-c579-4c4c-a9d2-2d5706c11dac
* A revised version of the tables source code with auto-destroytradke2002-01-17
| | | | | | | | completely removed. (I also changed the standalone test suite correspondingly.) git-svn-id: http://svn.cactuscode.org/flesh/trunk@2581 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Forgot the 'return' statement in my last commit.tradke2001-12-04
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2482 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added return statement to prevent compiler warning 'function should return a ↵tradke2001-12-04
| | | | | | value'. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2480 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Undefine CCODE before it is redefined. Fixes a gcc warning.tradke2001-11-27
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2469 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Stuff for utility table routines, implemented by Jonathon Thornburg.goodale2001-11-13
Documentation should follow shortly... Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2462 17b73243-c579-4c4c-a9d2-2d5706c11dac