OSSP CVS Repository

ossp - History for /ossp-pkg/var/var_test.c
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Directory]  [Show Milestones

DateVersion Description
2005-Oct-02 18:58    1.53    Check-in [5197]: Fix some sprintf(3) parameter passing. By rse. (diff)
2005-Jan-20 21:29    1.52    Check-in [4963]: Bumped year in copyright messages for new year 2005 By rse. (diff)
2004-Oct-29 21:42    1.51    Check-in [4791]: o Various code comment cleanups. o Fixed dmalloc support. By rse. (diff)
2004-Apr-04 10:07    1.50    Check-in [4487]: adjust copyrights By rse. (diff)
2003-Oct-25 21:56    1.49    Check-in [3648]: use 'expect' instead of 'exp' because most systems have a exp(3) function and so the symbols shadow By rse. (diff)
2003-Feb-14 22:17    1.48    Check-in [3257]: final polishing for release 1.0.0 By rse. (diff)
2003-Feb-10 16:37    1.47    Check-in [3193]: cosmetics: strip trailing whitespaces By rse. (diff)
2003-Feb-10 16:27    1.46    Check-in [3192]: fix memory leak in OSSP var test suite (under error conditions only) By rse. (diff)
2002-Mar-08 13:57    1.45    Check-in [1977]: more copyright/license polishing By rse. (diff)
2002-Mar-07 15:58    1.44    Check-in [1968]: - use our standard ts.[ch] test suite library - add support for Dmalloc facility By rse. (diff)
2002-Mar-07 13:11    1.43    Check-in [1964]: New API functions var_format and var_formatv which provide a convinience interface to printf-style expansion and variable expansion. var_format is like a combination of snprintf(3) and var_expand().

Example: Assume the variable value context gives "bar" for ${ARRAY[7]}, then the call..

    var_format(var, &tmp, 1, "foo${ARRAY[%d]}quux", 7);o

..results in tmp containing the malloc(3)'ed string "foobarquux". Thanks to Thomas L. for providing the hint to this functionality. By rse. (diff)

2002-Mar-07 10:14    1.42    Check-in [1959]: Major bugfixing and enhancing of search & replace operation: - finally fix ${name:s/$/foo/} type substitutions (zero-length matching!) - add s/.../.../mg matching support (Perl-style multiline) - make non-multiline matching the default By rse. (diff)
2002-Mar-06 12:09    1.41    Check-in [1953]: cleanup output of test suite By rse. (diff)
2002-Mar-04 13:01    1.40    Check-in [1940]: Fix regex problem by no longer allowing variables in the pattern part of s/pattern/subst/. Because it is far more common that one needs '$' there instead of a variable. By rse. (diff)
2002-Mar-04 12:53    1.39    Check-in [1938]: Add new important feature: user-supplied post-operation functions. This allows one to configure a var_cb_operation_t callback in the var_t context and allow it to implement functions triggered by ${name:%func[(arg)]}. This is especially intended for application-specific encoding and post-adjustment functions. By rse. (diff)
2002-Feb-28 21:27    1.38    Check-in [1928]: always print on testing, not just on debugging By rse. (diff)
2002-Feb-28 13:40    1.37    Check-in [1918]: prepare for API finally passing "val_t *" to callback, currently pass NULL By thl. (diff)
2002-Feb-28 10:29    1.36    Check-in [1910]: Try to solve the expansion problem with invalid name characters we encountered in OSSP lmtp2nntp if we expand in two passed with different name character sets. We want that the variable constructs which are not valid in the first pass to be correctly kept (assuming deactivated force_expand!) instead of an error produced.

According to Peter Simons, this might be not the correct solution, although THL and RSE are sure it is, because we tried it in detail and it seems to be correct. Nevertheless Peter's comment (in german) for reference:

| Ich weiß nicht, ob das unbedingt eine gute Idee ist? Der Fehler | "incomplete variable spec" wird immer dann ausgelöst, wenn innerhalb | der "${...}"-Umgebung ein Zeichen auftritt, das dort nicht sein | dürfte. Einmal kommt das natürlich vor, wenn die gültigen Zeichen für | Variablen von Pass 1 zu Pass 2 verschieden sind ... Aber eine andere | Ursache kann auch sein, daß beispielsweise die schließende "}"-Klammer | fehlt. | IMHO ist die Tatsache, daß libvar an dieser Stelle einen Fehler | liefert kein Softwarefehler, sondern liegt in der Natur der Sache. Die | "richtige" Lösung für das Problem wäre meiner Meinung nach, in beiden | Pässen die Vereinigung beider Zeichenmengen zuzulassen und dann im | jeweiligen Callback zu testen, ob der Variablenname richtig war oder | nicht. | Genaugenommen sollte man ohnehin überlegen, ob es nicht günstiger | wäre, mit einem Callback das ganze in einem Pass zu parsen, und | diesen dann einfach zwischen Callback A und B entscheiden zu lassen, | um die tatsächliche Auflösung durchzuführen.
 By rse. (diff)

2002-Feb-28 09:48    1.35    Check-in [1909]: URL fixing and additional documents By rse. (diff)
2002-Feb-28 09:08    1.34    Check-in [1908]: HEADS UPS: Mega-commit, revamping the whole library! - completely new API - completely new manual page By rse. (diff)
2002-Feb-27 14:44    1.33    Check-in [1907]: style and text cleanups By rse. (diff)
2002-Jan-09 12:23    1.32    Check-in [1529]: Added test case that verifies the correct behavior of search_and_replace() when zero-length matches occur. By rse. (diff)
2002-Jan-09 12:17    1.31    Check-in [1528]: Fixed a test case where the expected result was incorrect. Thus, the test didn't not fail even though search_and_replace() contained a bug. By rse. (diff)
2002-Jan-02 18:12    1.30    Check-in [1494]: bump copyright year By rse. (diff)
2001-Dec-17 11:29    1.29    Check-in [1441]: Finally adjust return code semantics of var_cb_t to use var_rc_t only. By rse. (diff)
2001-Dec-17 00:40    1.28    Check-in [1438]: Implemented loops with explicit start, stop, and step values. By rse. (diff)
2001-Dec-14 14:49    1.27    Check-in [1431]: Manual OSSP coding style adjustments. By rse. (diff)
2001-Dec-14 14:47    1.26    Check-in [1430]: Get rid of the following warnings under "gcc -O2 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long":

var.h:91: warning: declaration of `index' shadows global declaration var.c: In function `expression': var.c:693: warning: declaration of `index' shadows global declaration var.c: At top level: var.c:1769: warning: declaration of `varname' shadows global declaration var.c:1769: warning: declaration of `index' shadows global declaration var.c: In function `lookup_wrapper': var.c:1772: warning: declaration of `index' shadows global declaration var.c:1772: warning: declaration of `varname' shadows global declaration var_test.c:13: warning: declaration of `index' shadows global declaration var_test.c: In function `var_lookup': var_test.c:16: warning: declaration of `index' shadows global declaration By rse. (diff)

2001-Dec-13 17:03    1.25    Check-in [1424]: Implemented correct termination and recursion for loop constructs. By simons. (diff)
2001-Dec-12 18:18    1.24    Check-in [1421]: Guarantee that the buffer returned by var_expand() is terminated with a null byte. By simons. (diff)
2001-Dec-12 17:51    1.23    Check-in [1419]: Implemented the looping construct. However, there are still some semantical issues that need to be clarified before the code is stable. By simons. (diff)
2001-Dec-08 17:28    1.22    Check-in [1412]: Fixed test case for division-by-zero error with force_expand mode. By simons. (diff)
2001-Dec-08 17:27    1.21    Check-in [1411]: Implemented division-by-zero error. By simons. (diff)
2001-Dec-08 17:17    1.20    Check-in [1410]: Implemented force_expand mode in num_exp(). By simons. (diff)
2001-Dec-08 17:02    1.19    Check-in [1409]: Added support for variables as operands in index specifications. By simons. (diff)
2001-Dec-08 16:31    1.18    Check-in [1408]: Implemented the semantic for negative index yielding the length of the variable or the length of the array. By simons. (diff)
2001-Dec-08 16:14    1.17    Check-in [1407]: Implemented array-lookups in the callback and customized test cases appropriately. By simons. (diff)
2001-Dec-04 14:35    1.16    Check-in [1400]: Added test cases for array lookups. By simons. (diff)
2001-Dec-03 11:51    1.15    Check-in [1396]: Extended the interface of var_cb_t to support variable arrays. To customize your already existing lookup functions quickly to the new interface, just add the "int index" parameter to the function's prototype and add the lines

    if (index != 0)
        return VAR_ERR_ARRAY_LOOKUPS_ARE_UNSUPPORTED;

to the function itself. By simons. (diff)

2001-Nov-20 16:46    1.14    Check-in [1385]: Changed semantics of the :o operation so that the specified end-offset is included in the result. Updated documentation and test cases appropriately. By simons. (diff)
2001-Nov-20 12:49    1.13    Check-in [1374]: Renamed callback from env_lookup to var_lookup(). By simons. (diff)
2001-Nov-20 12:41    1.12    Check-in [1371]: Rewrote env_lookup callback to use an internal array of variables rather than the system environment, because setenv() and unsetenv() are not really portable. Also, these routines lose memory, which is not a good thing for a test program. By simons. (diff)
2001-Nov-14 16:55    1.11    Check-in [1345]: Minor corrections. By ms. (diff)
2001-Nov-14 13:21    1.10    Check-in [1333]: Fix indentation. By ms. (diff)
2001-Nov-14 12:11    1.9    Check-in [1329]: Rename the return codes VAR_XXX to VAR_ERR_XXX (except for VAR_OK) to be consistent with other OSSP libraries like L2. By rse. (diff)
2001-Nov-14 11:47    1.8    Check-in [1327]: Expanded tabs. By ms. (diff)
2001-Nov-13 15:42    1.7    Check-in [1318]: Reformatted the sources to Kernighan & Ritchie style according to the wishes of Ralf. By simons. (diff)
2001-Nov-13 15:36    1.6    Check-in [1317]: Implemented submatching in regular expressions and added the appropriate test cases. By simons. (diff)
2001-Nov-13 14:33    1.5    Check-in [1314]: The test program will print the data in each step to stdout when compiled with a DEBUG define. By simons. (diff)
2001-Nov-13 14:29    1.4    Check-in [1312]: Changed the semantics of var_unescape(): It will only recognize a named character as being an octal if there are three digits following the backslash. Anything else will be interpreted as an ordinary quoted character that's copied verbatimly. Added a test case to verify that behavior. By simons. (diff)
2001-Nov-13 14:25    1.3    Check-in [1311]: Implemented the unescape_all-behavior and added modified the test program to make use of var_unescape(). Also added a test case, which verifies hex and octal characters are handled correctly. By simons. (diff)
2001-Nov-13 13:46    1.2    Check-in [1307]: The callback will now return a proper error code in case of failure, rather than using exit(1). By simons. (diff)
2001-Nov-13 13:08    1.1    Check-in [1297]: - Moved all routines into a single source file var.c. - Renamed varexp.h to var.h. - Removed odin-based build system. - Moved test cases into var_test.c. - Adapted build system. By simons.

CVSTrac 2.0.1