OSSP CVS Repository

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

DateVersion Description
2005-Mar-29 21:31    1.107    Check-in [5042]: annotate with lint message By rse. (diff)
2005-Jan-20 21:29    1.106    Check-in [4963]: Bumped year in copyright messages for new year 2005 By rse. (diff)
2004-Oct-29 21:42    1.105    Check-in [4791]: o Various code comment cleanups. o Fixed dmalloc support. By rse. (diff)
2004-Apr-04 11:57    1.104    Check-in [4490]: flush more pending changes after some more platform checks By rse. (diff)
2004-Apr-04 10:07    1.103    Check-in [4487]: adjust copyrights By rse. (diff)
2004-Apr-04 10:04    1.102    Check-in [4486]: Provide Autoconf check (AC_CHECK_VA_COPY) for va_copy(d,s) macro and fallback implementations and now that we can be sure that va_copy() exists for us, use it in var_formatv() and ts.c instead of the direct assignments (which are not sufficiently portable). By rse. (diff)
2004-Feb-17 10:21    1.101    Check-in [4435]: correct spelling: privileges, convenient; By thl. (diff)
2003-Jul-31 09:29    1.100    Check-in [3523]: va_list is not comparable against NULL (import from ¤http://cvs.openpkg.org/chngview?cn=11246) By thl. (diff)
2003-Feb-14 22:17    1.99    Check-in [3257]: final polishing for release 1.0.0 By rse. (diff)
2003-Feb-14 20:46    1.98    Check-in [3256]: add space to make code-style checkers happy, too By rse. (diff)
2003-Feb-14 19:19    1.97    Check-in [3255]: allow a strict C++ compiler to compile this C code, too By rse. (diff)
2003-Feb-10 22:15    1.96    Check-in [3200]: get rid of warning message because of constness By rse. (diff)
2003-Feb-10 22:12    1.95    Check-in [3199]: fix final memory leak By rse. (diff)
2003-Feb-10 21:50    1.94    Check-in [3198]: fix one more memory leak and simplify tokenbuf operations By rse. (diff)
2003-Feb-10 21:38    1.93    Check-in [3197]: fix one more memory leak By rse. (diff)
2003-Feb-10 21:21    1.92    Check-in [3196]: fix first set of memory leaks By rse. (diff)
2003-Feb-10 16:37    1.91    Check-in [3193]: cosmetics: strip trailing whitespaces By rse. (diff)
2002-Jul-05 22:17    1.90    Check-in [2249]: bugfix hex decoding By rse. (diff)
2002-Mar-08 13:55    1.89    Check-in [1976]: polishing and copyright extension (add natural person) By rse. (diff)
2002-Mar-08 13:37    1.88    Check-in [1973]: ops, remove left-over fixme hint By rse. (diff)
2002-Mar-07 15:03    1.87    Check-in [1967]: Shit happens! Our tokenbuf_copy() function was a good idea, but cannot be used for the loop construct expansion, because an intermediate tokenbuf_append() can realloc(3) the underlying buffer, so the backuped token buffer would point to no longer valid data. We really have to re-introduce the original trick of Peter Simons where an offset is used only. By rse. (diff)
2002-Mar-07 13:11    1.86    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.85    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-07 10:08    1.84    Check-in [1958]: be even more carefully: regex(3) says rm_so and rm_eo are -1 if a back-reference is not available. So we could match with "&&" here. But because we want to be very carefully we match also rm_eo for -1 and use "||" here. That is, we use a weaker condition to gain stronger safety. By rse. (diff)
2002-Mar-06 12:45    1.83    Check-in [1954]: cleanup the code a little bit more before trying to fix it By rse. (diff)
2002-Mar-06 11:33    1.82    Check-in [1952]: One more bugfix to the search & replace stuff. Manual page regex(3) says:

| Normally, regexec() returns 0 for success and the non-zero code | REG_NOMATCH for failure. Other non-zero error codes may be returned | in exceptional situations; see DIAGNOSTICS.

So we have to check for "!= 0" and not just "== REG_NOMATCH" or we would perform substitutions with uninitialized data structures. By rse. (diff)

2002-Mar-06 11:18    1.81    Check-in [1949]: Change semantics of ${name:-word} from "If $name is not empty string, then $name, else word" to: "If $name is not empty string and not undefined, then $name, else word". This provides a more intuitive usage of ${name:-word} because it allows the user to turn an undefined variable (as returned with VAR_ERR_UNDEFINED_VARIABLE by the callback) into a defined one. This is important because changing the callback to return undefined variables as empty variables is incorrect because it usually breaks the array loop construct. By rse. (diff)
2002-Mar-06 11:05    1.80    Check-in [1948]: typo By rse. (diff)
2002-Mar-06 11:04    1.79    Check-in [1947]: Fix a soon to occur bug in advance:

a search and replace operation on an empty token buffer has to result again in an empty token buffer and not an undefined token buffer.

I do not know why this worked and only crashes with the forthcoming changed ${name:-default} behaviour (because this is totally unrelated I would say). But nevertheless, this is a bug. So fix it, although it works before and after the fix as good as it could ;) By rse. (diff)

2002-Mar-04 14:12    1.78    Check-in [1941]: fix error description handling By rse. (diff)
2002-Mar-04 13:01    1.77    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.76    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-Mar-04 12:37    1.75    Check-in [1937]: Code Cleanup Phase V (too much details to describe) By rse. (diff)
2002-Mar-02 13:29    1.74    Check-in [1936]: Code Cleanup Phase IV (too much details to describe) By rse. (diff)
2002-Mar-01 23:02    1.73    Check-in [1934]: more comments By rse. (diff)
2002-Mar-01 22:59    1.72    Check-in [1933]: Code Cleanup Phase III (too much details to describe) By rse. (diff)
2002-Mar-01 21:28    1.71    Check-in [1932]: Code Cleanup Phase II (too much details to describe) By rse. (diff)
2002-Feb-28 21:28    1.70    Check-in [1929]: Code Cleanup Phase I (too much details to describe) By rse. (diff)
2002-Feb-28 13:40    1.69    Check-in [1918]: prepare for API finally passing "val_t *" to callback, currently pass NULL By thl. (diff)
2002-Feb-28 13:10    1.68    Check-in [1917]: merge old internal_expand() into new var_expand() By rse. (diff)
2002-Feb-28 12:59    1.67    Check-in [1916]: shorten table By rse. (diff)
2002-Feb-28 12:54    1.66    Check-in [1915]: Start internal code and logic cleanups: - move the name class table generation from var_expand() to var_config() by moving the table into var_t. - move inital parts of internal_expand to var_expand(). By rse. (diff)
2002-Feb-28 12:08    1.65    Check-in [1912]: typo By rse. (diff)
2002-Feb-28 10:29    1.64    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.63    Check-in [1909]: URL fixing and additional documents By rse. (diff)
2002-Feb-28 09:08    1.62    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.61    Check-in [1907]: style and text cleanups By rse. (diff)
2002-Jan-30 20:37    1.60    Check-in [1727]: add optional OSSP ex based exception handling support By rse. (diff)
2002-Jan-09 12:27    1.59    Check-in [1530]: - Compile regular expressions with REG_NEWLINE flag so that '^' and '$' match in the middle of the string where appropriate.

- Fixed incorrect results of search_and_replace() with zero-length matches, such as '^'. By rse. (diff)

2002-Jan-02 18:12    1.58    Check-in [1494]: bump copyright year By rse. (diff)
2001-Dec-17 13:57    1.57    Check-in [1442]: allow result_len to be NULL By rse. (diff)
2001-Dec-17 11:29    1.56    Check-in [1441]: Finally adjust return code semantics of var_cb_t to use var_rc_t only. By rse. (diff)
2001-Dec-17 10:03    1.55    Check-in [1440]: silence gcc By rse. (diff)
2001-Dec-17 10:00    1.54    Check-in [1439]: remove debugging messages By rse. (diff)
2001-Dec-17 00:40    1.53    Check-in [1438]: Implemented loops with explicit start, stop, and step values. By rse. (diff)
2001-Dec-14 15:40    1.52    Check-in [1433]: remove debugging stuff By rse. (diff)
2001-Dec-14 15:06    1.51    Check-in [1432]: Cleanup post-processing code by reducing redundancy. Nevertheless the error result_len is still incorrect IMHO! By rse. (diff)
2001-Dec-14 14:47    1.50    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-14 14:42    1.49    Check-in [1429]: Manual OSSP coding style adjustments. By rse. (diff)
2001-Dec-13 17:25    1.48    Check-in [1425]: Fixed syntax error. By simons. (diff)
2001-Dec-13 17:03    1.47    Check-in [1424]: Implemented correct termination and recursion for loop constructs. By simons. (diff)
2001-Dec-13 15:34    1.46    Check-in [1423]: Variables that have no index specified are always looked up with index zero now; the default index does no longer apply. By simons. (diff)
2001-Dec-12 18:18    1.45    Check-in [1421]: Guarantee that the buffer returned by var_expand() is terminated with a null byte. By simons. (diff)
2001-Dec-12 17:52    1.44    Check-in [1420]: Support the loop construct only if startindex has been set. By simons. (diff)
2001-Dec-12 17:51    1.43    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:27    1.42    Check-in [1411]: Implemented division-by-zero error. By simons. (diff)
2001-Dec-08 17:17    1.41    Check-in [1410]: Implemented force_expand mode in num_exp(). By simons. (diff)
2001-Dec-08 17:02    1.40    Check-in [1409]: Added support for variables as operands in index specifications. By simons. (diff)
2001-Dec-04 15:25    1.39    Check-in [1404]: We support the current_index and startindex tokens only when they're not zero. By simons. (diff)
2001-Dec-04 14:36    1.38    Check-in [1401]: Added support for indexed variables to expression(). By simons. (diff)
2001-Dec-03 11:51    1.37    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.36    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 16:36    1.35    Check-in [1384]: Rather than to hard-code the size of the buffer required for format an integer into a string in the ':#' operation, use approximation based on 'sizeof(int)'. By simons. (diff)
2001-Nov-20 15:04    1.34    Check-in [1381]: THLs review By thl. (diff)
2001-Nov-20 14:44    1.33    Check-in [1380]: THLs review By thl. (diff)
2001-Nov-20 14:33    1.32    Check-in [1379]: THLs review By thl. (diff)
2001-Nov-20 13:45    1.31    Check-in [1377]: THLs review By thl. (diff)
2001-Nov-20 13:24    1.30    Check-in [1376]: THLs review By thl. (diff)
2001-Nov-20 13:22    1.29    Check-in [1375]: THLs review By thl. (diff)
2001-Nov-20 12:46    1.28    Check-in [1373]: Removed comment from Thomas in accordance with Ralf: We don't want to add further consistency checks, because they're somewhat mood anyway. If a user does not understand the implications of his choice of tokens, there's no way we can guarantee the parser will still work. On the other hand, additional consistency checks might hinder users who know what they're doing from doing it. By simons. (diff)
2001-Nov-20 12:44    1.27    Check-in [1372]: Removed comment from Thomas in accordance with Ralf: We don't want to introduce a context for the library at this point, because this would complicate the API quite a bit without bringing significant benefits. By simons. (diff)
2001-Nov-19 17:30    1.26    Check-in [1370]: THLs review By thl. (diff)
2001-Nov-19 17:07    1.25    Check-in [1367]: Implemented var_strerror(). By simons. (diff)
2001-Nov-19 17:05    1.24    Check-in [1366]: THLs review By thl. (diff)
2001-Nov-19 16:56    1.23    Check-in [1365]: THLs review By thl. (diff)
2001-Nov-19 16:15    1.22    Check-in [1363]: Added early initialization of the "result" pointer so that we never leave it unitialized when var_expand() failes. By simons. (diff)
2001-Nov-19 15:10    1.21    Check-in [1362]: Implemented the error-reporting semantics specified in the man page: If var_expand() fails with an error, "result" will contain a pointer to the construct in the input buffer, which's expansion caused the failure. By simons. (diff)
2001-Nov-16 17:01    1.20    Check-in [1352]: Added support for the PCRE library: If HAVE_PCREPOSIX is defined at compile time, the PCRE POSIX wrapper functions will be used rather than the system's regular expression engine. By simons. (diff)
2001-Nov-15 16:36    1.19    Check-in [1349]: Replaced the use of the explicit character class type "char class[256]" by an abstract data type "char_class_t". By simons. (diff)
2001-Nov-14 13:57    1.18    Check-in [1335]: ops, lookup_context is allowed to be NULL, of course By rse. (diff)
2001-Nov-14 13:52    1.17    Check-in [1334]: one more hard-coded value vs. symbolic name By rse. (diff)
2001-Nov-14 13:21    1.16    Check-in [1332]: be pedantic and use the symbol instead of hard-coded value By rse. (diff)
2001-Nov-14 13:02    1.15    Check-in [1330]: Safe time by cleaning up var_expand() myself instead of first writing down the wishes and having Peter do it himself afterwards: - use tokenbuf_init() instead of doing it manually - perform additional argument sanity checks - some minor coding style adjustments By rse. (diff)
2001-Nov-14 12:11    1.14    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 10:47    1.13    Check-in [1326]: Cleanup code of token buffer stuff to be consistent with our general style in our OSSP libraries: - rename all xxx_tokenbuf functions to tokenbuf_xxx ("grouping by prefix") - rename tokenbuf to tokenbuf_t (POSIX-like type namespace) - move variable definitions to top of functions (group them together). - glue code comments directly to code (no extra newline) - use the combined "assign and check" style ('if ((var = ...) != NULL)..) By rse. (diff)
2001-Nov-13 20:32    1.12    Check-in [1324]: be consistent: every function has at least one 'return' By rse. (diff)
2001-Nov-13 20:28    1.11    Check-in [1323]: use consistent style for pointers By rse. (diff)
2001-Nov-13 20:25    1.10    Check-in [1322]: Quickly get rid of tabs before reviewing and editing starts By rse. (diff)
2001-Nov-13 15:56    1.9    Check-in [1321]: Added cast to int for isdigit() parameter to avoid compile-time warning. By simons. (diff)
2001-Nov-13 15:42    1.8    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.7    Check-in [1317]: Implemented submatching in regular expressions and added the appropriate test cases. By simons. (diff)
2001-Nov-13 14:32    1.6    Check-in [1313]: Removed all debug output except for that in search_and_replace(). By simons. (diff)
2001-Nov-13 14:29    1.5    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.4    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:45    1.3    Check-in [1305]: Renamed expand_named_characters() to var_unescape while adding the flag telling the function whether to expand anything or only constructs it knows. By simons. (diff)
2001-Nov-13 13:16    1.2    Check-in [1301]: - Fixed copyright header to show the right description. - Removed assertions. 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