Top   Types   Functions   Classes   Options   Index   Sources 

Changes


2.1.x
2.1.89795
2.1.88591
2.1.79937
2.1.58633
2.1.53837
2.0.280
2.0.279
2.0.278
2.0.277
2.0.276
untemplatize/Makefile
erwin-cgen
General
2.0.275
2.0.274
2.0.273
2.0.272
2.0.271
2.0.270
2.0.269
2.0.267 and 2.0.268
2.0.266
2.0.265
2.0.264
2.0.263 - 2.0.264
2.0.262
2.0.259 - 2.0.261
2.0.258 - 2.0.259
2.0.257
2.0.255 - 2.0.256
2.0.254
2.0.253
2.0.252
2.0.251
2.0.250
2.0.249
2.0.248
2.0.246
2.0.245
2.0.244
2.0.242
2.0.241
2.0.239
2.0.235
2.0.231
2.0.230
2.0.229
2.0.220
2.0.218
2.0.205
2.0.200
2.0.197
2.0.195
2.0.183
2.0.181
2.0.180
2.0.179
2.0.178
2.0.177
2.0.176
2.0.175
2.0.173
BIG CHANGES HERE!
Big change 1
Big change 2
Big change 3
2.0.172
Arrays
2.0.165
Vectors
2.0.156
Somewhere around version 2.0.156
Version 2.0.155
Version 2.0.152
Version 2.0.146
Version 2.0.142
Around Version 2.0.100
Version 2.0.0
Bug Fixes
New Features and Other Changes
C C++
Changes to untemplatize concerning C++
Porting from version 1 to version 2
Array_forall macro
Vector_forall macro

2.1.x

2.1.89795

2.1.88591

2.1.79937

2.1.58633

2.1.53837

2.0.280

2.0.279

- added erase_if

2.0.278

- serious bug in vector.cd: 'unsigned ERWIN_LONG_LONG' is bad and should be 'ERWIN_UNSIGNED_LONG_LONG', since on systems with a 'typedef long long int64_t', the former does not work.

2.0.277

2.0.276

untemplatize/Makefile

- move installed helper binaries from ${libdir}/erwin/bin to ${libexecdir}/erwin to be more compliant with the file system standard.

If you upgrade, you may type 'make uninstall' before 'make install', to get rid of the files under ${libdir}/erwin/bin.

erwin-cgen

General

2.0.275

- the _errno bug in _copy was also fixed in List.

2.0.274

erwin-cgen improvements
--gcc-option=...

adds --extra-options-gcc: ... to the output file

--c-map... options

reading, writing, modifying C interface maps and checking the current interface against them.

@FILE

read file contents as options

Maps

- on-the fly creating of values improved: It is not possible to store pointers to other maps or vectors as values in a map, while still having a non-pointer result from operator[].

This provides maximal efficiency: together with oType_ENSURE_VALUE you can generate the maps.

Old:

*(a[5]->find_ensure_ptr(6))= 7;

or

*a[5]->set (6,7)

New:

a[5][6]= 7;

To use this, use an additional oTypeIndex:

Old:

untemplatize iType=int oType='map_int_int *' \
             -DoType_ENSURE_VALUE(X)='map_int_int_new()' \
             -DoType_OFREE(X)='map_int_int_delete(X)'

New:

untemplatize iType=int oType='map_int_int *' \
             oTypeIndex='map_int_int' \
             -DoType_ENSURE_VALUE(X)='map_int_int_new()' \
             -DoType_OFREE(X)='map_int_int_delete(X)'
some 'const' versions of C++ functions

in vectors, the operator+(int) was not overloaded in a const version so a[5] would not work if a was 'VectorChar const &'.

The same 'const' overloading was added to nth_ptr, nth_ref, nth_ptr_char, nth_ref_char, nth_ptr_check, nth_ref_check. It is currently missing for first_ptr, first_ref, last_ptr, last_ref (and it's also missing in C). This overloading is not present with operator[](int) const, since that returns no reference at all.

Unfortunately, one of the prototypes did not work under Microsoft C++, since the overloading does not work properly. I had to disable:

oType const *Vector::operator+(int) const

(Note that the non-const version is enabled and works.)

In order to keep the interface identical under Linux and Windows, that function was disabled independently of the OS. The same functionality is provided by:

oType const *Vector::nth_ptr_check(int) const

or

oType const *Vector::nth_ptr_char(int) const

(depending on type)

If you want it, because you don't want to program under MS, use:

#define ERWIN_IGNORE_BROKEN_MS_COMPILER 1
BUG FIX

unbelievable this has never been found: Vector_copy and Map_copy had bugs: Vector_copy did not set e_errno in case of NULL, and Map_copy did not allow NULL and raised an assertion failure(!)

It's fixed now: both allow NULL and set (vector/map)_errno to (VECTOR/MAP)_OK in that case.

2.0.273

- Freshmeat release

2.0.272

2.0.271

2.0.270

2.0.269

From the targzs, I reconstructed the following for 2.0.267 to 2.0.269:

2.0.267 and 2.0.268

No idea -- cannot easily be reconstructed since the CVS was lost between 2.0.264 and 2.0.269.

2.0.266

- made quotation work for %c, too. I hope this does not break things.

Multibyte characters are quoted in their multibyte form (so that the multibyte conversion cannot break the quotation). I think that is what people expect.

2.0.265

2.0.264

2.0.263 - 2.0.264

2.0.262

- fixed severe bug in operator=

2.0.259 - 2.0.261

(definitely in 2.0.260 -> 2.0.261):

2.0.258 - 2.0.259

2.0.257

- Added Map_erase_if.

2.0.255 - 2.0.256

?? FIXME: find out what has changed - Bug fixed in Vector_to_lower which did the same as Vector_to_upper...

2.0.254

- Bug fixed in vector_delete (thanks to nico!): NULL is always a valid input to _delete due to calling conventions of _delete handlers for all data types.

2.0.253

2.0.252

2.0.251

2.0.250

Added 'explicit' to most unary constructors. This might cause problems if you relied on that feature. There is no compatibility define. Add the necessary casts to your program. (FIXME: add a compatibility define).

CANCELLED BECAUSE OF INVISIBLE INCOMPATIBILITIES CANCELLED: Added an 'operator int()' to maps and vectors. Together with CANCELLED: the added 'explicit', this changes the behaviour of e.g. the CANCELLED: operator == on a map: CANCELLED: CANCALLED: Let m be a map. CANCELLED: Before: m == MAP_OK => m == Map(1) This is a horrible misinterpretation! CANCELLED: After: m == MAP_OK => m.get_errno() == MAP_OK

Started to write acerwin.m4 which will become a replacement for configure.def and configure.erwin. The two will vanish in version 2.1.x of Erwin, but for now, they will be frozen, installed, etc, but have a feature freeze.

Changed --with-cpp to --with-cxx to reduce confusion. This is an incompatible change, however, but the old option had a bad name.

Renamings: BOOL -> Global_ERWIN_BOOL TRUE -> Global_ERWIN_TRUE FALSE -> Global_ERWIN_FALSE

There is a compatibility #define to get back to old behaviour:

#define Global_ERWIN_COMPAT_2_0_249


You can pass the options --include and --xinclude to untemplatize during --init. The first one will be put at the very beginning of the include hierarchie: at the beginning of defs.h. So --init --include=... is suitable for defining e.g. compatibility #defines, error handling (ERWIN_ERROR_STREAM) or determinism (ERWIN_REQUIRE_DETERMINISM).

The --xinclude is put at the end of the basic include hierarchie, namely to the end of erwin/base.h. So --init --xinclude=... is suitable for declaring types needed by the data structures (e.g. typedef char const *symbol_t) with all the configuration data already available.


untemplatize has new options:

-D..., -U... If the names you define or undefine start with _, iType_ or oType_, this will be replaced by the name of the data structure (with the replacements made by --name, see below), by the iType or the oType. Note that no substitutions are visible to that part of untemplatize. This might need to be fixed some time.

--name=.... renames the data structures. This is a bit more than replacing the names by standard substitutions. Additionally, it also effects the substitution of the -D and -U names.

These options simplify e.g. the declaration of a symbol table:

> untemplatize map \ iType='char const ' oType='int' iTypeVar='char ' \ -DiType_ICOPY=string_dup \ -DiType_IFREE=string_free \ -DiType_CMP=string_cmp \ -DiType_EQUAL=string_hash \ --name=symtab

If you have a prefix,

> untemplatize --init --global-prefix=special_

this is especially handy:

> untemplatize vector oType=int -D_ALLOW_OUTOFRANGE=1 --name=my_v_int

This is like:

> untemplatize vector oType=int \ -DMY_V_INT_ALLOW_OUTOFRANGE=1 \ special_vector_int=my_v_int \ SPECIAL_VECTOR_INT=MY_V_INT

2.0.249

The types are defined differently:

typedef struct _X_t X_t -> typedef struct X_t X_t class X -> struct X

(The latter in order to enable usage of class pointers in C).

There is a compatibility define to change this back to old behaviour:

#define Global_ERWIN_COMPAT_2_0_248

An additional include file exists: erwin/forwards.h. This declares all types defined by the Erwin library without the need of the basic header files. All Erwin data structures include this file, so you can use at least all the pointers of Erwin structures in other Erwin structures without having to use --include=.... with untemplatize.

2.0.248

Map::errno renamed to Map::get_errno because <errno.h>::errno may be a macro. Unfornately, this will break compatibility.

2.0.246

2.0.245

Improvements of map iterators:

Other changes:

2.0.244

2.0.242

Reformation of C++ vector iterators. In 2.0.241 so many nice map iterators were introduced that I wanted some of them for vectors as well.

Completed support for determinism by fixing Map_get_(entries|keys|values).

Renamings: Map_delete_flat -> Map_delete_flags Map_clear_flat -> Map_clear_flags Map_destroy_flat -> Map_destroy_flags

Done for consistency with vectors. There is a compatibility #define.

ERWIN_TMALLOC is used in addition to ERWIN_TCALLOC. The library warns if you pre-defined ERWIN_TCALLOC but not ERWIN_TMALLOC (and if you have gcc, because otherwise, there is #warning) so you can add a #define for ERWIN_TMALLOC as well. In this case, ERWIN_TCALLOC is also used for ERWIN_TMALLOC.

The compatibility #define switches back to use if ERWIN_TCALLOC.

2.0.241

Renaming: ERWIN_RANDOM -> Global_ERWIN_RANDOM (No compatibility define. If you developed libraries with Erwin2, rename your function)

Added support for deterministic data structures: Global_ERWIN_REQUIRE_DETERMISM

Added many forall-macros. Most of them are generated with a Perl script because their definitions are very similar and there are many of them. The forall-reformation was done because of determinism issues that now play an important role.

2.0.239

Features for vectors:

Vector_NO_AUTO_SHRINK : added Vector_ALLOW_OUTOFRANGE : completed Vector_MINIMAL_SIZE == 0 : special case optimised and documented

Hopefully these work now.

Incompatibilities: Vector_subvector has an additional argument now. This has to be set to Global_ERWIN_TRUE to get old behaviour.

Renamed Vector_NULL_ALLOWED to Vector_ALLOW_NULL. This is more consistent with Vector_ALLOW_OUTOFRANGE.

2.0.235

A hell of a configure skript we have now...

Map_mean_line_length was renamed to Map_deviation_line_length.

2.0.231

Changes (char const) parameters back to (char) in base.h. I hate this VC++6.0. The new prototypes are nicer now. Compiling under Windows, things might break now.

2.0.230

Serious bug found in vector function that erase elements. When specifying that the vector should not be re-allocated (resize == Global_ERWIN_FALSE), the vector would not even adjust its size. This is fixed.

If you relied on this bug, your code will unfortunately break. No compatibility #define was introduced.

Serious bug in vector::fread which was completely broken and caused SIGSEGV.

2.0.229

Vector

cut renamed to erase

Vector

cut_if added

2.0.220

vector::nthptr returns a pointer. Not a reference. This will create incompatibilities but the name is misleading.

BTW: There was a bug in vector_u.h (.hpp) which will lead to compiler errors because vector_u.h(pp) is not included. To change: either delete vector_u.hpp and re-untemplatize or edit and change #ifndef VECTOR_H to #ifndef VECTOR_U_H

2.0.218

Hash values can be calculated from maps and vectors. To use them, you have to supply hash functions for oTypes of vectors and maps.


untemplatize -init -cpp will memoize the -cpp setting. Therefore, now you need to give -no-cpp when instantiating non-cpp structures.
The use of the `symbol' data structure is now deprecated. This is because hash tables can now store char * although iType is const char*. A hash table from char const * to int (or anything else) that copies its keys and has hashval and cmp then implements a symbol table. The function map_char_const_p_ensure() is equivalent to string2symbol().

untemplatize should be invoked like this for a symbol table: untemplatize map \ iType='char const ' iTypeVar='char ' \ oType='int' \ -DCHAR_CONST_P_ICOPY=string_dup \ -DCHAR_CONST_P_IFREE=string_free \ -DCHAR_CONST_P_HASH=hash_string \ -DCHAR_CONST_P_CMP=string_cmp

There will be an abbreviation for this. It will probably be called `untemplatize symbol_table'.

Note

Suppose you declare the following in C++: MapCharConstPInt string2symbol; Then you can write string2symbol("hello") to call string2symbol.ensure("hello").

The advantage of this symbol table is that you can store additional data for each symbol in the same hash table (the oType does not matter for this to work) by mixing the usage of _ensure(), _insert() and _set().

However, `untemplatize symbol' will be supported for back-ward compatibility reasons. It does not hurt at all to have it.

2.0.205

Speed up of untemplatize by a jump table.

2.0.200

Restructuring of Makefiles, Documentation subdirectory merged from two development versions.

-DERWINMM_COMPAT1 is untested for at least a hundred subversions now. It is not at all guaranteed to work anymore.

2.0.197

A settings file is written into the Erwin subdirectory. From here, some important settings that affect the -init command and the normal untemplatisation commands are read. These settings are:

-I= --global-prefix= --subdir= --cpp-support=

The default has not changed. It is still:

-I= --global-prefix= --subdir=src,include,.. --cpp-support=1 # depending on configuration of package.

These should now be defined during the -init phase and not during untemplatisations. untemplatize will read the settings from that settings file.

Futhermore, -init will not be done automatically by default. You really should do it as a separate initial step now.

Note

The settings of --erwin-lib is NOT stored in the settings file because the global installation directory might change although it is still the same version. Incompatibilities will be warned about via the version file of the installation and the local copy.

--cpp now implies --cpp-only. To force old behaviour, use

-cpp=... -cpp-only=0

(Replace ... by your favorite C++ file extensions. The default is -cpp=.cpp,.hpp)

2.0.195

Very much has changed although Erwin should be compatible with old versions in most aspects.

A few things were renamed. All of these are not prefixable since they only depend on the compiler, not the user:

old new ERWININLINE ERWIN_INLINE ERWINLONGLONG ERWIN_LONG_LONG ERWINUNSIGNEDLONGLONG ERWIN_UNSIGNED_LONG_LONG BLOCK_BEGIN ERWIN_BLOCK_BEGIN BLOCK_END ERWIN_BLOCK_END E_RANDOM ERWIN_RANDOM PROFILE ERWIN_PROFILE

An the prefixable ones: PRINT_iType iType_PRINT PRINT_oType oType_PRINT

Additional macros were behaviour changed due to fixes of cross compilation: interim name name now ERWINDOS ERWIN_DOS ERWINMSVC ERWIN_MSVC ERWINCROSS ERWIN_CROSS <none> ERWIN_NEW_ASM_SYNTAX (gcc only)

Addtional macros: ERWIN_GENSYM(X) generates the symbol (X_LINE_). This is useful for local variables of for() loops in macros on broken compilers.

Naming conventions:

The new changes had to be done to almost every file of the Erwin library. The identifier names in template files and Erwin source files are even more different than before so the following sections should clarify the usage now.

The are three kinds of exported symbols:

  1. Symbols shared by all versions of Erwin. These are derived from the compiler settings only and are considered not to be subject to changes except for bug fixes. These symbols will not change their name when the --global-prefix option is used with untemplatize. Only macro names are gathered in this category.

    Some examples are: ERWIN_INLINE ERWIN_LONG_LONG etc.

    The definitions of these symbols can be found in defs.h, which does not not contain any prefixable identifiers.

  2. Symbols which are shared by all data structures of Erwin. These symbols usually start with ERWIN_, MAP_, map_, VECTOR_, vector_ or the like (uniform capitalisation of letters).

    These symbols are prefixable and must therefore be prefixed with Global_ in the sources. Note that `Global_' is replaced by the user prefix without regard of the context, thus even in something like `MYGlobal_var'.

    Examples

    With an unset --global-prefix: library source local copy Global_MAP_OK MAP_OK Global_vector_errno vector_errno Global_map_iterator_t map_iterator_t

    With --global-prefix=abc_ library source local copy Global_MAP_OK ABC_MAP_OK Global_vector_errno abc_vector_errno Global_map_iterator_t abc_map_iterator_t

    Note that the library name also changes with the global prefix. All underscores will be deleted there. In the above example this would result in a library file called libabcerwin.a.

  3. Symbols belonging to an instatiated data structure. In the template files, these begin with Vector_, Map_ or the like (mixed lower and upper case). Because the prefixes like `Vector_' are replaced anyway, the --global-prefix is also automatically replaced.

    The class names belong to this group as well.

    Examples

    For a map from int to char*:

    With an unset --global-prefix: library source local copy Map_new map_int_charp_new Map_class MapIntCharpNew

    With --global-prefix=abc_ library source local copy Map_new abc_map_int_charp_new Map_class AbcMapIntCharpNew

2.0.183

Changes to fix cross compilation with djgpp (tested: Linux -> DOS32)

Added nmakefile support. This was quiet complex. At the same time, no GNUMake should be required anymore.

Started to make file names 8.3 conform. (asm_gen.h, confdos.h).

Managed to make library compile with MS VC++ under NT.

2.0.181

MAP_OK and VECTOR_OK were changed to 1 and all others to different values. This will create problems if you tested for 0, but I want compile time errors when the result of e.g. Vector::insert is compared to VECTOR_OK.

Additional macros are introduced: X_IS_WARNING(X), X_IS_ERROR(X), X_IS_OK(X) for X \in \{ MAP, VECTOR \}

2.0.180

FEATURES: Vectors now accept NULL as an empty string and as a table if the table size is 0 when inserting and constructing.

BUGS: Something like the following linker error occured in objects which had static vector or map declarations. I don't know why. I think it's a compiler bug. However, this means the linker tricks usually don't work. Until I come up with a good idea of how to make this work and protect the user from problems concerning #define, I will sadly disable the link trick check for compile time settings.

shelf.o: In function `global constructors keyed to vector_char_constant_zero_element_expected': /home/ht/project/c/X/xcdshelf/shelf.cpp:42: multiple definition of `global constructors keyed to vector_char_constant_zero_element_expected' M_mergedia.o:/home/ht/project/c/X/xcdshelf/M_mergedia.cpp:71: first defined here ld: Warning: size of symbol `GLOBAL.I.vector_char_constant_zero_element_expected' changed from 23 to 18 in shelf.o make: * [xcdshelf] Error 1

PS: I tried to use extern inline instead of _attribute_((weak)) but then gcc does not generate any definition for the functions in question, again causing linker errors.

2.0.179

Renamed oType &Vector_class::nth() to nthptr because that stupid, silly, brain(!)dead compiler unnecessarily chose this one over the nth() const one, ending up in a SIGSEGV when automatically deferencing the result. Who programmed that stupid choice into the compiler? (Ok, perhaps that's the standard choice, but I don't want that).

This can cause incompatibilities with old versions.

2.0.178

Because the linker tricks to prevent inconsistent compilation of the library and your application sometimes might cause problems, I included a #define to prevent those games. Simply globally

#define ERWIN_NO_LINKER_TRICKS

if you know for sure that you compile the library and your application with the same #define settings and you still get very strange linker errors and warnings.

Note

With NDEBUG, the linker tricks aren't played anyway. The same holds for compilers other than gcc.

2.0.177

parray works again. There were serious bugs in pmap.ht which I oversaw, which was the reason for the compilation failures.

2.0.176

How to use maps instead of arrays.

After porting some programs by a quick hack from pre-2.0.173 to 2.0.176, this is a report of what to do.

  1. If you have lines in your Makefile which generate links from erwin/include/vector_u.h to ./vector_u.h to keep them in the application directory and make it possible to simple rm -Rf the whole erwin sub-directory, then remove these links. The default place for _u.h(pp) files is now in the application directory.

  2. If you don't mind warnings, you can still use `array' instead of the new type `map'. untemplatize will enter a compatibility mode.

  3. If you use `parray' it is not easy. For a quick hack, I used `array' to have the same naming but multiple implementations. There is not easy way to implement a compatibility mode, otherwise I would have done. (It does work in in 2.0.277 above!)

  4. Delete the Erwin-directory completely (after ensuring you did not change any _u.h files there). If you changed _u files there, put them in the directory just above the erwin sub-directory.

  5. untemplatize all data structures.

  6. Re-configure, re-make.

This worked for quite large projects for me and was not too much work.

2.0.175

Changed #ifndefs and #ifdefs to #ifs. This makes it possible to globally define a property to be true and locally undefine it (#define to 0). This was not possible before. If you set properties like this:

#define VECTOR_CHAR_NO_RANGE_CHECK

you will now get compile time errors. Change these to

#define VECTOR_CHAR_NO_RANGE_CHECK 1 .

This does not affect the global values for which an #define is ok:

#define VECTOR_CONSTANT_ZERO

is therefore ok. However, for consistency reasons, you should change this to

#define VECTOR_CONSTANT_ZERO 1

2.0.173

BIG CHANGES HERE!

Big change 1

Arrays were renamed to Maps. You should change your applications as well. Alternatively, you can use the following untemplatisation command to generate the old naming.

Instead of untemplatize array ..

write

untemplatize map map=array MAP=ARRAY ...

An you will hopefully get the old names.

If you simply type `make install' now on a system which already has an old Erwin2 library installed, the (old) array implementation will be kept and not be overwritten or deleted.

However, you should think about removing it soon as it does not fit the current version of Erwin.

Big change 2

The default sub-directory for user definition files is now `..'. This means instead of writing to erwin/include, untemplatize will put them into the current directory. This makes many ugly hacks with links unnecessary. If you want the old behaviour, invoke untemplatize with the following option:

--subdir=src,include,include

This puts them back in the right place again.

Big change 3

There is an additional include file now, belonging to the implementation alone. It is called Array_d.h (for `definitions'). It was included by splitting Array_u.h into two files. One only containing comments (new _u.h file), the other (_d.h) the default definitions.

2.0.172

Arrays

PS: When reading the implementation of arrays, I was astonished of how small it is. Hashing is by far more complicated than resized arrays. However, vector has grown a lot in the past and has provided many, many convenience functions which are unsuitable for arrays.

PPS: Array::erase is still missing. This is a shame. A very embarassing fact to notice.

2.0.165

Vectors

2.0.156

bfind changed the order of parameters. This will cause compile errors. Simply swap the second and third parameter. This was done to allow for a NULL default value in C++ for the comparison function.

Somewhere around version 2.0.156

Because untemplatize fixes the Makefile.in and Makefiles depending on the C++ feature, you should now always use untemplatize -init -cpp... when you intend to mix C and C++ usage. This is because if you have untemplatize initialise the directory automatically when not using the -cpp option, your later untemplatized C++ files will not be compiled because there is no rule in the Makefile.

This was an important change that was necessary to make the Makefile with when .cpp was NOT the C++ file ending.

Version 2.0.155

a) Vector_format was redesigned to use ANSI conformant format strings. This was done in order to enable the format string warning feature of gcc. Unfortunately, you might need to fix your software for this to work. Earlier, you wrote (C++ style):

v.format ("%:s", a)

Now you do: v.format (FO_QUOTE_C_STRING, "%s", a)

Because the options are valid for the whole format string, you might need to split formats like "%:s %s" or something.

Note that some features where temporarily removed because the interface would be very complicated. E.g. the loops and if-statements in format strings are not valid anymore. See templates/vector.hd for details.

b) The configure call has been enhanced to support subdir calls. For this, an additional file file `configure.erwin' will be generated which you can paste into your toplevel configure file to recurse into the erwin directory. There are mechanisms to pass additional options (see configure.erwin for details).

c) There is support for library use of Erwin now. The make target `objects' generates the .o files and then a file libobjs containing the names of the .o files you must add to your ar call. See README for details. Another details is that erwin_init() may now safely be called several times. By this you can call erwin_init from your library's initialisation function.

Version 2.0.152

New data types `pvector' and `parray'.

These provide exactly the same functionality as `vector' and `array'. But instead of implementing the functions, wrappers around the functions of another vector or array are generated. There will only a header file, not an implementation file. All functions will be declared inline and will only be one-liners.

The reason for this: Suppose you want to have many array from `Symbol' to some pointer type but do not want to have implementations of arrays for every pointer type since the compiler will generate the same code anyway because all pointer types are handled in exactly the same way. You could therefore come up with the idea of having one array form Symbol to char* (don't use void* because the implementation uses pointers to oType and void** is not portable!) and use this for all your other pointer types using casts. This method prevents you from enjoying the type mismatch error messages the compiler can generate. Therefore, the necessary casts should be capsulated by generating inline functions. This is what pvector and parray do.

E.g.: You have one array for char*:

untemplatize array iType='Symbol' oType='char*'

For the pointer type `int*', `FILE*' and `SomeData*' you can generate wrapper implementations around this. By piType and poType you specify which will be the underlying implementation.

untemplatize parray iType='Symbol' oType='int*' ipType='Symbol' opType='char*' untemplatize parray iType='Symbol' oType='FILE*' ipType='Symbol' opType='char*' untemplatize parray iType='Symbol' oType='SomeData*' ipType='Symbol' opType='char*'

The interface is exactly the same, you should not be able to feel the difference. Of course, that the derived implementations inherit all settings like hash and comparison functions.

If you have a good compiler, not a single byte of additional code will be generated for these implementations in most cases.

(Note to developers: The files parray.hd and pvector.hd are automatically generated from array.hd, vector.hd, parray.ht, and pvector.ht by the Perl script makewrapper.pl. For this to work, you must not do ugly things in array.hd and vector.hd).

Version 2.0.146

For consistency reasons, the `size' and `clone' members were renamed to be called `nentries' and `copy' like in C again. Erwin 2 was not publicly released in between so this should not be noticed by anyone other than the developers.

Version 2.0.142

The library was changed to support all functions in one C file. No conflicts will occur. Do do this, #define IMPLEMENTATION before #including the header files.

You can additionally define STATIC to change the storage from `extern' to `static' for all functions.

And you can additionally define INLINING to add the storage modifier `inline' to all functions usually not inlined.

This currently only works for vectors. Arrays will support this soon.

Around Version 2.0.100

The library is not compiled anymore. Instead, the source files will be copied to where the template files are instantiated to. A configure script is included.

This makes the library incompatible again with prior versions. You need to change for Makefile to used this library. All the rest should not be touched.

The default directory layout is as follows: ./erwin - Everything this library installs will go here by default.

./erwin/include - include files

./erwin/lib/liberwin.a - the library which needs to be linked

./erwin/src - the implementation of the data structures

To use the new library, call ./erwin/configure from your configure script. In your make file, add:

erwin: dummy (cd erwin ; $(MAKE))

Ensure that your `distclean' and `clean' targets do (cd erwin ; $(MAKE) distclean) and (cd erwin ; $(MAKE) clean)

Compile with `-I erwin/include'. Link with `-L erwin/lib -lm -lerwin'.

You can change the whole directory layout, but this is not very well tested. See `untemplatize -h' for instructions how to change dirs.

Version 2.0.0

All changes were done in such a way that it is still possible to compile version 1 applications (although with compiler warnings). To do this, read the section on porting below.

Bug Fixes

- string_cmp has a corrected behaviour for NULL strings now. It was documented that NULL < "", but the result was exactly the opposite in version 1. Now the functions works according to its specified semantics.

This might cause problems for upgraders.

New Features and Other Changes

Porting from version 1 to version 2

THE COMPATIBILITY MODE IS NOT YET IMPLEMENTED.

Step 1) untemplatize all the needed files to make them match version 2 of the library. You can take array_u.h and vector_u.h from version 1. You should, however, not use the {array,vector}_*_u.h files anymore but you should transfer your changes to these files to a freshly untemplatized copy of version 2.

Step 2)

  1. If you want to compile your version 1 files without thinking about changes, give the compiler flag

    -DERWINMM_COMPAT1

    when you compile your application.

    Note

    YOU MUST COMPILE THE WHOLE APPLICATION WITH THIS #DEFINE! INCLUDING THE UNTEMPLATIZED DATA STRUCTURE IMPLEMENTATIONS.

    Note

    You cannot make use of some features of version 2.

    If you switch on pointer type conversion warnings, you will get warnings for all source code incompatibilities between version 1 and 2.

  2. If you want to port your code to version 2, the following things have to be changed:

    Array_forall macro

    In version 1 you wrote:

    array_charp_int_forall (ar, key, val) { printf ("a[%s]=%d\n", key, val); }

    Now in version 2 you have to declare an iterator and then change the forall call:

    { array_iterator_t iter; array_charp_int_forall (ar, iter, key, val) { printf ("a[`%s']=%d\n", key, val); } }

    Vector_forall macro

    In version 1 you wrote:

    vector_charp_forall (index, val, vec) { printf ("v[%d]=`%s'\n", index, val); }

    Now in version 2 you have to write:

    vector_charp_forall (vec, index, val) { printf ("v[%d]=`%s'\n", index, val); }

    Analogous changes have to be made to all other forall macros.

Step 3) If you have problems with const modifiers, your compiler should hopefully still only issue warnings. If you get errors, add -Dconst= to the compiler invokation if you need to compile now or better remove the deficiencies of your code.

Step 4) If you have problems with oTypes equal to int, you need to define something like the following in your user headers:

#define VECTOR_INT_NO_INT_CONSTRUCTOR

This will prevent the generation of an additional ambiguous constructor.

Step 5) If you need it, put an #include <assert.h> into your files. This include was removed from the Erwin-- header files.

Step 6) All other changes will not be switched back to version 1 behaviour. Currently, only the behaviour of string_cmp is known to have changed noticeably.

Step 7) To enforce version 2 in a configure script, you can do something like this (note the symbol used to determine the appropriateness of the library):

AC_CHECK_LIB(erwin, erwin_version_2, LIBS="$LIBS -lerwin", echo "This library is needed."; exit 1)

Index

Stoppt die Vorratsdatenspeicherung
November 26th, 2007
Comments? Suggestions? Corrections? You can drop me a line.
zpentrabvagiktu@theiling.de
Schwerpunktpraxis