Top   Types   Functions   Classes   Options   Index   Sources 

list.hd


   1  #REM /* -*- Mode: C++ -*-
   2  #REM  *  Author: Henrik Theiling <theiling@cs.uni-sb.de>
   3  #REM  *
   4  #REM  *  @@Begin: Licencing and Copying@@
   5  #REM  *  
   6  #REM  *  Copyright (c) Henrik Theiling
   7  #REM  *  Licence Version 2, Special Version for Erwin.
   8  #REM  *  
   9  #REM  *  The term 'this software' used in the following, additional to its
  10  #REM  *  usual usage, also includes the instantiated source files generated by
  11  #REM  *  tools of this package.
  12  #REM  *  
  13  #REM  *  This software is provided 'as-is', without warranty of any kind,
  14  #REM  *  express or implied.  In no event will the authors or copyright holders
  15  #REM  *  be held liable for any damages arising from the use of this software.
  16  #REM  *  
  17  #REM  *  Permission is granted to anyone to use this software for any purpose,
  18  #REM  *  including commercial applications, and to alter it and redistribute it
  19  #REM  *  freely, subject to the following restrictions:
  20  #REM  *  
  21  #REM  *  1. The origin of this software must not be misrepresented; you must
  22  #REM  *  not claim that you wrote the original software. If you use this
  23  #REM  *  software in a product, an acknowledgment in the product documentation
  24  #REM  *  would be appreciated.
  25  #REM  *  
  26  #REM  *  2. Altered source versions must be plainly marked as such, and must
  27  #REM  *  not be misrepresented as being the original software.
  28  #REM  *  
  29  #REM  *  3. You must not use any of the names of the authors or copyright
  30  #REM  *  holders of the original software for advertising or publicity
  31  #REM  *  pertaining to distribution without specific, written prior permission.
  32  #REM  *  
  33  #REM  *  4. If you change this software and redistribute parts or all of it in
  34  #REM  *  any form, you must make the source code of the altered version of this
  35  #REM  *  software available.  As an exception, files that were generated by
  36  #REM  *  tools of this package may be used freely, including modification.
  37  #REM  *  
  38  #REM  *  5. This notice must not be removed or altered from any source
  39  #REM  *  distribution.
  40  #REM  *  
  41  #REM  *  This licence is governed by the Laws of Germany.  Disputes shall be
  42  #REM  *  settled by Saarbruecken City Court.
  43  #REM  *  
  44  #REM  *  @@End: Licencing and Copying@@
  45  #REM  *
  46  #REM  */
  47  #PARAMETER(oType)
  48  #DESCRIPTION(Type of values stored)
  49  #CHECK
  50  #REPLACE_PERHAPS_START(oT###ypeVar,oType)
  51  #REPLACE_PERHAPS_START(oT###ypeSuffix,)
  52  #REPLACE_PERHAPS_START(oT###ypeParamSuffix,oTypeSuffix)
  53  #REPLACE_PERHAPS_START(oT###ypeParam,oType oTypeParamSuffix)
  54  #REPLACE_PERHAPS_START(oT###ypeTouched,oTypeParam)
  55  #REPLACE_PERHAPS_START(oT###ypeVarParam,oTypeVar oTypeParamSuffix)
  56  #REPLACE_PERHAPS_START(oT###ypeResultSuffix,oTypeSuffix)
  57  #REPLACE_PERHAPS_START(oT###ypeResult,oType oTypeResultSuffix)
  58  #REPLACE(List,Global_list_oType)
  59  #REPLACE(NSList,nslist_oType)
  60  #FILES(list.cd list_i.hd list_u.hd)
  61  #GENERAL(Global_list_u.ErwinHExt List_u.ErwinHExt)
  62  #HEADER(List.ErwinHExt List_i.ErwinHExt List_d.ErwinHExt List_f.ErwinHExt List_ti.ErwinHExt List_n.ErwinHExt)
  63  #CLASS_IDENTIFIER(List_class)
  64  #CLASS_IDENTIFIER(NSList_class)
  65  #SPLIT_TARGET(List)
  66  #REM *****************************************************************************************
  67  #OUTPUT(List_f.ErwinHExt)
  68  
  69  #ifndef ERWIN_List_f_ErwinHExt
  70  #define ERWIN_List_f_ErwinHExt
  71  
  72  struct List_t;
  73  #TYPEDEF_GLOBAL(aggregate List_t NSList_t)
  74  
  75  #ifndef __cplusplus
  76  /* This #ifndef is a VC++ hack.  That compiler is too braindead to (de-)mangle the
  77   * function names correctly with the following typedef. */
  78  typedef struct List_t List_t;
  79  #endif
  80  typedef List_t List_class;
  81  
  82  #TYPEDEF_GLOBAL(aggregate List_class NSList_class)
  83  
  84  typedef List_t *List_t_p;
  85  #TYPEDEF_GLOBAL(List_t_p NSList_t_p)
  86  
  87  typedef List_t const *List_t_const_p;
  88  #TYPEDEF_GLOBAL(List_t_const_p NSList_t_const_p)
  89  
  90  #define List_SIG __gen_sig__
  91  
  92  ErwinGlobalDefines
  93  
  94  #TYPEDEF_GLOBAL(Global_list_key_t list_key_t)
  95  
  96  /* Get the all-purpose key_t: */
  97  #ifndef Global_list_key_t
  98  typedef void *Global_list_key_t;
  99  #define Global_list_key_t Global_list_key_t
 100  #define Global_LIST_KEY_ZERO ((Global_list_key_t)NULL)
 101  #endif
 102  
 103  #DEEPDECLS(List,HASH_RAW,CMP/NULL,ZERO,ICOPY,OCOPY,IFREE,OFREE,CONSTRUCTOR,DESTRUCTOR)
 104  #REM HACK:  currently, HAS_CONSTANT_ZERO is removed.  It should be put back!
 105  #REM
 106  #REM These deep decls must be put into the _f file, otherwise the implementation might not see them.
 107  #REM Probably some programs will not require some defines to be moved from the decls.h to the
 108  #REM settings.h file because of the change, but otherwise, we might get very hard to find run-time
 109  #REM problems when the application has different sized objects than the library.
 110  #REM THIS BUG WAS VERY HARD TO FIND!
 111  
 112  #endif /* defined ERWIN_List_f_ErwinHExt */
 113  
 114  #REM *****************************************************************************************
 115  #OUTPUT(List_n.ErwinHExt)
 116  
 117  #CHECKINCLUDE(List)
 118  
 119  #ifdef List_NEED_HEADER
 120  #include "#List.ErwinHExt"
 121  #endif
 122  
 123  #REM *****************************************************************************************
 124  #OUTPUT(List_ti.ErwinHExt)
 125  
 126  #ifndef ERWIN_List_ti_ErwinHExt
 127  #define ERWIN_List_ti_ErwinHExt
 128  
 129  #define List_elt_t_KIND STRUCT
 130  #define List_elt_t_TYPE_INFO  TYPE_INFO_NAME(List_elt_t)
 131  extern TYPE_INFO_T(List_elt_t);
 132  
 133  #define List_elt_t_p_KIND POINTER
 134  #define List_elt_t_p_TYPE_INFO  TYPE_INFO_NAME(List_elt_t_p)
 135  extern  TYPE_INFO_T(List_elt_t_p);
 136  
 137  #define List_elt_t_const_p_KIND POINTER
 138  #define List_elt_t_const_p_TYPE_INFO  TYPE_INFO_NAME(List_elt_t_const_p)
 139  extern  TYPE_INFO_T(List_elt_t_const_p);
 140  
 141  #define List_t_KIND STRUCT
 142  #define List_t_TYPE_INFO  TYPE_INFO_NAME(List_t)
 143  extern  TYPE_INFO_T(List_t);
 144  
 145  #define List_t_p_KIND POINTER
 146  #define List_t_p_TYPE_INFO  TYPE_INFO_NAME(List_t_p)
 147  extern  TYPE_INFO_T(List_t_p);
 148  
 149  #define List_t_const_p_KIND POINTER
 150  #define List_t_const_p_TYPE_INFO  TYPE_INFO_NAME(List_t_const_p)
 151  extern  TYPE_INFO_T(List_t_const_p);
 152  
 153  #define List_class###_TYPE_INFO          List_t_TYPE_INFO
 154  #define List_class_p###_TYPE_INFO        List_t_p_TYPE_INFO
 155  #define List_class_const_p###_TYPE_INFO  List_t_const_p_TYPE_INFO
 156  
 157  #endif /* defined ERWIN_List_ti_ErwinHExt */
 158  
 159  #REM *****************************************************************************************
 160  #OUTPUT(List.ErwinHExt)
 161  /* -*- Mode: C -*- */
 162  #DATE
 163  /*
 164   * Author: Henrik Theiling
 165   * Description:
 166   *     Public header file for doubly linked lists with arbitrary value types.
 167   */
 168  #LICENCE
 169  
 170  #ifdef ERWIN_DEBUG_INCLUDE
 171  #warning "Including List.ErwinHExt"
 172  #endif
 173  
 174  #ifndef ERWIN_List_ErwinHExt
 175  #define ERWIN_List_ErwinHExt
 176  
 177  #ifdef ERWIN_DEBUG_INCLUDE
 178  #warning "First inclusion of List.ErwinHExt"
 179  #endif
 180  
 181  /* Include basic configuration */
 182  #ifdef Global_ERWIN_COMPILING
 183  #  include "erwin/defs.h"
 184  #else
 185  #  include <erwin/defs.h>
 186  #endif
 187  
 188  /* Include definitions */
 189  #include "#List_d.ErwinHExt"
 190  
 191  /* Include basic definitions */
 192  #ifdef Global_ERWIN_COMPILING
 193  #  include "erwin/base.h"
 194  #else
 195  #  include <erwin/base.h>
 196  #endif
 197  
 198  /* Include forward declarations */
 199  #ifdef Global_ERWIN_COMPILING
 200  #  include "erwin/forwards.h"
 201  #else
 202  #  include <erwin/forwards.h>
 203  #endif
 204  
 205  #ifdef HAVE_STDIO_H
 206  #  include <stdio.h>
 207  #endif
 208  
 209  #include "#List_i.ErwinHExt"
 210  /* For efficient implementation, the compiler needs to know
 211   * the list structure. */
 212  
 213  #IFCPPONLY
 214  #ELSE
 215  #ifdef __cplusplus
 216  extern "C" {
 217  #endif
 218  #ENDIF
 219  
 220  #undef  Global_list_errno
 221  
 222  #if Global_ERWIN_GLOBAL_ERRNO
 223  #  define Global_list_errno Global_erwininternallisterrno
 224    /* If you compiled Erwin without the Global_ERWIN_THREAD_SAFE flag,
 225     * this variable holds global status code for vectors.
 226     */
 227  #endif
 228  
 229  #undef  Global_list_strerror
 230  #define Global_list_strerror(X) Global_erwininternalliststrerror(X)
 231    /* Returns a textual description of a given error.  This description
 232     * starts with `Error: ' or `Warning: ' or something the like
 233     * to indicate the status level.  This is then followed by a
 234     * short description phrase.
 235     */
 236  
 237  /*! enum: Global_LIST_OK, Global_LIST_ERR_*, Global_LIST_WARN_* */
 238  #undef  Global_LIST_OK
 239  #define Global_LIST_OK Global_ERWININTERNALLISTOK
 240    /* No error occurred. */
 241  
 242  #undef  Global_LIST_IS_OK
 243  #define Global_LIST_IS_OK(X) Global_ERWININTERNALLISTISOK(X)
 244    /* Find out whether the status code list_errno indicates that everything is fine. */
 245  
 246  #undef  Global_LIST_IS_ERROR
 247  #define Global_LIST_IS_ERROR(X) Global_ERWININTERNALLISTISERROR(X)
 248    /* Find out whether the status code list_errno indicates that an error occured. */
 249  
 250  #undef  Global_LIST_IS_WARNING
 251  #define Global_LIST_IS_WARNING(X) Global_ERWININTERNALLISTISWARNING(X)
 252    /* Find out whether the status code list_errno indicates that an error occured. */
 253  
 254  #undef  Global_LIST_ERR_NOMEM
 255  #define Global_LIST_ERR_NOMEM Global_ERWININTERNALLISTERRNOMEM
 256    /* Memory exhausted.  If you think this is a fatal error and should be
 257     * treated like a failed assertion, #define Global_ERWIN_NOMEM_IS_FATAL.
 258     */                     
 259  
 260  #undef  Global_LIST_ERR_OUTOFRANGE
 261  #define Global_LIST_ERR_OUTOFRANGE Global_ERWININTERNALLISTERROUTOFRANGE
 262    /* Returned whenever an argument has a value that cannot be handled. */
 263  
 264  #undef  Global_LIST_ERR_ASSERTIONFAILED
 265  #define Global_LIST_ERR_ASSERTIONFAILED Global_ERWININTERNALLISTERRASSERTIONFAILED
 266    /* Whenever an axiomatic assertion failed, this error is occured.
 267     *
 268     * Note: Something really went wrong in this case, so do not expect that
 269     *       every failed assertion allows normal control flow to continue.
 270     *       This error means the program is broken and would have crashed
 271     *       or done something bad if the assertion had not been checked.
 272     */
 273  
 274  #undef  Global_LIST_ERR_NOTCOMPILED
 275  #define Global_LIST_ERR_NOTCOMPILED Global_ERWININTERNALLISTERRNOTCOMPILED
 276    /* If some compile time flags prevented compilation of parts a function needs
 277     * at run-time, this is returned.  Currently only the `V' argument specifier
 278     * of the format functions return this if the files where compiled with
 279     * a C compiler instead of a C++ compiler.
 280     */
 281  
 282    /*
 283     * The following are warnings only. */
 284  #undef  Global_LIST_WARN_OUTOFRANGE
 285  #define Global_LIST_WARN_OUTOFRANGE       Global_ERWININTERNALLISTWARNOUTOFRANGE
 286    /* If a value is out of range, this warning is returned. */
 287  
 288  /*
 289   * Some types */
 290  typedef int List_index_t;
 291  #TYPEDEF(List_index_t NSList_index_t)
 292  typedef oType List_value_t;
 293  #TYPEDEF(List_value_t NSList_value_t)
 294  
 295  typedef int  (*List_cmp_t) (oType const *, oType const *);
 296  #TYPEDEF(List_cmp_t NSList_cmp_t)
 297  
 298  typedef Global_ERWIN_BOOL (*List_feature_t)(oTypeParam);
 299  #TYPEDEF(List_feature_t NSList_feature_t)
 300  
 301  #ifndef List_MAP_T_DEFINED
 302  #define List_MAP_T_DEFINED
 303  /* In order to have oTypeResult as a result type for List_map_t, declare that
 304   * function yourself and define List_MAP_T_DEFINED.
 305   */
 306  typedef oType (*List_map_t)(oTypeParam);
 307  #TYPEDEF(List_map_t NSList_map_t)
 308  
 309  #endif
 310  #define List_CMP_T_NULL ((List_cmp_t)NULL)
 311  
 312  #ifdef __cplusplus
 313  typedef bool (*List_cpp_feature_t)(oTypeParam);
 314  #endif
 315  #TYPEDEF_CXX(List_cpp_feature_t NSList_cpp_feature_t)
 316  
 317  
 318  #TYPEDEF(List_element_ptr_t NSList_element_ptr_t)
 319  #TYPEDEF_CXX(List_element_ref_t NSList_element_ref_t)
 320  
 321  #IFEQ(oType,oTypeVar)
 322  typedef oType *List_element_ptr_t;
 323  #ifdef __cplusplus
 324  typedef oType &List_element_ref_t;
 325  #endif
 326  #ELSE
 327  typedef oType const *List_element_ptr_t;
 328  #ifdef __cplusplus
 329  typedef oType const &List_element_ref_t;
 330  #endif
 331  #ENDIF
 332  
 333  typedef int  (*List_combine_t) (List_element_ptr_t, oType const *);
 334  #define List_COMBINE_T_NULL ((List_combine_t)NULL)
 335  
 336  #TYPEDEF(List_combine_t NSList_combine_t)
 337  
 338  /*
 339   * ***** handling `list' objects: ***** */
 340  /*--BEGIN-C--*/
 341  
 342  Global_ERWIN_EXPORT
 343  List_t *List_new (void) ATTR_MALLOC;
 344     /* Create a new list with default values.   I.e., with the
 345     * default zero element List_ZERO and the default initial hash table
 346     * size of List_INITIAL_SIZE.
 347     *
 348     */
 349  
 350  #if List_DYN_ZERO
 351  Global_ERWIN_EXPORT
 352  List_t *List_new_with_zero (oTypeTouched /*zero*/) ATTR_MALLOC;
 353    /* Create a list specifying the zero element. */
 354  #endif
 355  
 356  Global_ERWIN_EXPORT
 357  oTypeResult List_zero (List_t const * /*self*/) ATTR_PURE;
 358  
 359  #if !Global_ERWIN_GLOBAL_ERRNO
 360  
 361  Global_ERWIN_EXPORT
 362  int List_errno(List_t const *) ATTR_PURE;
 363    /* If you compiled Erwin with Global_ERWIN_THREAD_SAFE, this is the way
 364     * to get the status code of a given list.
 365     *
 366     * If you do not
 367     * have a thread-safe Erwin library, there is a macro with the same name as
 368     * this function.
 369     *
 370     * \noerrno
 371     */
 372  
 373  Global_ERWIN_EXPORT
 374  void List_clear_errno(List_t const * /*self*/);
 375    /* If you compiled Erwin with Global_ERWIN_THREAD_SAFE, this is the way
 376     * to get the status code of a given list.
 377     *
 378     * If you do not
 379     * have a thread-safe Erwin library, there is a macro with the same name as
 380     * this function.
 381     *
 382     * \errno(OK)
 383     */
 384  
 385  #else
 386  
 387  #define List_errno(X) Global_list_errno
 388    /* If you compiled Erwin without Global_ERWIN_THREAD_SAFE, List_errno
 389     * is just a synonym for Global_list_errno.
 390     *
 391     * If you
 392     * have a thread-safe Erwin library, there is a function with the same name as
 393     * this macro.
 394     *
 395     * \noerrno
 396     */
 397  
 398  #define List_clear_errno(X)    ((void)(Global_map_errno= Global_MAP_OK))
 399    /* If the library was not compiled with Global_ERWIN_THREAD_SAFE, List_clear_errno(X)
 400     * is a small macro that resets the status code to Global_LIST_OK.
 401     *
 402     * If you
 403     * have a thread-safe Erwin library, there is a function with the same name as
 404     * this macro.
 405     *
 406     * \errno(OK)
 407     */
 408  #endif
 409  
 410  
 411  Global_ERWIN_EXPORT
 412  List_t *List_copy (List_t const* /*self*/);
 413    /* Copies a list with all its elements and returns that copy.
 414     */
 415  
 416  Global_ERWIN_EXPORT
 417  List_t *List_copy_err (List_t const* /*self*/, int * /*err*/);
 418    /* Like List_copy but sets *\p err to 1 on failure.
 419     */
 420  
 421  Global_ERWIN_EXPORT
 422  void List_delete (List_t* /*self*/);
 423    /* Deletes everything in the list and the list structure itself.
 424     * List_delete is NULL safe (\p self may be NULL without crash or failed
 425     * assertion).
 426     */
 427  
 428  Global_ERWIN_EXPORT
 429  void List_clear (List_t* /*self*/);
 430    /* Deletes everything in the list and the list structure itself.
 431     * List_delete is NULL safe (\p self may be NULL without crash or failed
 432     * assertion).
 433     */
 434  
 435  Global_ERWIN_EXPORT
 436  Global_list_key_t List_front (List_t const * /*self*/) ATTR_PURE;
 437    /* Returns the position of the first element or List_KEY_ZERO if the list is empty */
 438  
 439  Global_ERWIN_EXPORT
 440  Global_list_key_t List_back (List_t const * /*self*/) ATTR_PURE;
 441    /* Returns the position of the last element or List_KEY_ZERO if the list is empty
 442     */
 443  
 444  Global_ERWIN_EXPORT
 445  Global_list_key_t List_previous (List_t const * /*self*/, Global_list_key_t /*key*/) ATTR_PURE;
 446    /* Returns the previous element in the list or NULL if non exists.
 447     *
 448     * If key == Global_LIST_KEY_ZERO, List_back() is returned.
 449     */
 450  
 451  Global_ERWIN_EXPORT
 452  Global_list_key_t List_previous_raw (Global_list_key_t /*key*/) ATTR_PURE;
 453    /* Returns the previous element in the list or NULL if non exists.
 454     *
 455     * If key == Global_LIST_KEY_ZERO, this function cannot return
 456     * List_back(), because the list pointer is not given.  Instead,
 457     * it returns Global_LIST_KEY_ZERO again.
 458     */
 459  
 460  Global_ERWIN_EXPORT
 461  Global_list_key_t List_next (List_t const * /*self*/, Global_list_key_t /*key*/) ATTR_PURE;
 462    /* Returns the next element in the list or NULL if non exists
 463     *
 464     * If key == Global_LIST_KEY_ZERO, List_front() is returned.
 465     */
 466  
 467  Global_ERWIN_EXPORT
 468  Global_list_key_t List_next_raw (Global_list_key_t /*key*/) ATTR_PURE;
 469    /* Returns the next element in the list or NULL if non exists
 470     *
 471     * If key == Global_LIST_KEY_ZERO, this function cannot return
 472     * List_front(), because the list pointer is not given.  Instead,
 473     * it returns Global_LIST_KEY_ZERO again.
 474     */
 475  
 476  Global_ERWIN_EXPORT
 477  oTypeResult List_value (List_t const * /*self*/, Global_list_key_t /*key*/) ATTR_PURE;
 478    /* Returns the value for the given key or the zero element.
 479     *
 480     * Invocation is only valid for key != Global_LIST_KEY_ZERO.
 481     */
 482  
 483  Global_ERWIN_EXPORT
 484  oTypeResult List_value_raw (Global_list_key_t /*key*/) ATTR_PURE;
 485    /* Returns the value for the given key or the zero element.
 486     *
 487     * Invocation is only valid for key != Global_LIST_KEY_ZERO.
 488     */
 489  
 490  Global_ERWIN_EXPORT
 491  void List_overwrite (List_t * /*self*/, Global_list_key_t /*key*/, oTypeTouched /*value*/);
 492    /* Sets the values of the given key.  This overwrites the old value.
 493     *
 494     * Invocation is only valid for key != Global_LIST_KEY_ZERO.
 495     */
 496  
 497  Global_ERWIN_EXPORT
 498  oTypeResult List_first (List_t const * /*self*/) ATTR_PURE;
 499    /* Returns the first element or the zero element if no first element exists. */
 500  
 501  Global_ERWIN_EXPORT
 502  oTypeResult List_last (List_t const * /*self*/) ATTR_PURE;
 503    /* Returns the last element or the zero element. */
 504  
 505  Global_ERWIN_EXPORT
 506  Global_list_key_t List_nth_key (List_t const * /*self*/, int /*index*/) ATTR_PURE;
 507    /* Returns the key of the nth element or the zero element.
 508     * Returns LIST_ZERO if the element does not exist.
 509     */
 510  
 511  Global_ERWIN_EXPORT
 512  oTypeResult List_nth (List_t const * /*self*/, int /*index*/) ATTR_PURE;
 513    /* Returns the nth element or the zero element. */
 514  
 515  Global_ERWIN_EXPORT
 516  List_element_ptr_t List_value_ptr (List_t const * /*self*/, Global_list_key_t /*key*/) ATTR_PURE;
 517    /* Returns a pointer to the value for the given key or NULL.
 518     *
 519     * Invocation is only valid for key != Global_LIST_KEY_ZERO.
 520     */
 521  
 522  Global_ERWIN_EXPORT
 523  void List_erase (List_t * /*self*/, Global_list_key_t /*key*/);
 524    /* Erases an new element from the list.  NEVER use this function
 525     * to modify a list you are currently iterating!  Use
 526     * List_erase_in_loop for that.
 527     *
 528     * Invocation is only valid for key != Global_LIST_KEY_ZERO.
 529     *
 530     * After this invocation, the key handle becomes invalid.  Do not use
 531     * it anymore!
 532     */
 533  
 534  Global_ERWIN_EXPORT
 535  void List_erase_in_loop (
 536     Global_list_key_t * /*iterator*/,
 537     List_t * /*self*/, Global_list_key_t /*key*/,
 538     Global_ERWIN_BOOL /*reverse*/);
 539    /* Erases an new element from the list when you are inside an iterator.
 540     * A pointer to an iterator is provided to this function for changing if
 541     * necessary.  The 'reverse' argument specifies whether you are running
 542     * forward (false) or backward (true) over the list.
 543     *
 544     * The pointer to the iterator must be != NULL.
 545     *
 546     * Invocation is only valid for key != Global_LIST_KEY_ZERO.
 547     *
 548     * Note that this function not only works in the standard iterators defined
 549     * in this file, but also in your own loops that you implement using e.g.
 550     * List_front(), List_next() or List_back(), List_previous().  In these lists,
 551     * too, you can pass the iterator to List_erase_in_loop().
 552     *
 553     * After this invocation, the key handle becomes invalid.  Do not use
 554     * it anymore!
 555     */
 556  
 557  Global_ERWIN_EXPORT
 558  Global_list_key_t List_append (List_t * /*self*/, oTypeTouched /*value*/);
 559     /* Appends a new element to the list (and copies it if necessary) */
 560  
 561  Global_ERWIN_EXPORT
 562  Global_list_key_t List_prepend (List_t * /*self*/, oTypeTouched /*value*/);
 563     /* Preprends a new element to the list (and copies it if necessary) */
 564  
 565  Global_ERWIN_EXPORT
 566  Global_list_key_t List_insert_after (List_t * /*self*/, Global_list_key_t /*pos*/, oTypeTouched /*value*/);
 567     /* Inserts a new element into the list after the given one.
 568      * If pos is List_KEY_ZERO, then List_append is invoked.
 569      */
 570  
 571  Global_ERWIN_EXPORT
 572  Global_list_key_t  List_insert_before (List_t * /*self*/, Global_list_key_t /*pos*/, oTypeTouched /*value*/);
 573     /* Inserts a new element into the list after the given one.
 574      * If pos is List_KEY_ZERO, then List_prepend is invoked.
 575      */
 576  
 577  Global_ERWIN_EXPORT
 578  Global_list_key_t List_insert (
 579      List_t * /*self*/,
 580      Global_list_key_t /*pos*/, oTypeTouched /*value*/, Global_ERWIN_BOOL /*backward*/);
 581     /* Inserts a new element into the list after or before a given one.
 582      * If pos is List_KEY_ZERO, then List_append or List_prepend is invoked.
 583      * This is the combined functionality of append, prepend, insert_after, insert_before.
 584      */
 585  
 586  Global_ERWIN_EXPORT
 587  void List_append_list (List_t * /*self*/, List_t const * /*values*/);
 588     /* Appends a new element to the list (and copies it if necessary) */
 589  
 590  Global_ERWIN_EXPORT
 591  void List_prepend_list (List_t * /*self*/, List_t const * /*values*/);
 592     /* Preprends a new element to the list (and copies it if necessary) */
 593  
 594  Global_ERWIN_EXPORT
 595  void List_insert_list_after (List_t * /*self*/, Global_list_key_t /*pos*/, List_t const * /*values*/);
 596     /* Inserts a new element into the list after the given one.
 597      * If pos is List_KEY_ZERO, then List_append is invoked.
 598      */
 599  
 600  Global_ERWIN_EXPORT
 601  void List_insert_list_before (List_t * /*self*/, Global_list_key_t /*pos*/, List_t const * /*values*/);
 602     /* Inserts a new element into the list after the given one.
 603      * If pos is List_KEY_ZERO, then List_prepend is invoked.
 604      */
 605  
 606  Global_ERWIN_EXPORT
 607  void List_insert_list (
 608      List_t * /*self*/,
 609      Global_list_key_t /*pos*/, List_t const * /*values*/, Global_ERWIN_BOOL /*backward*/);
 610     /* Inserts a new element into the list after the given one.
 611      * If pos is List_KEY_ZERO, then List_prepend is invoked.
 612      */
 613  
 614  /* ***** iteration: ***** */
 615  /* Iteration operator for lists.
 616   *
 617   * In C++, use list_forall.
 618   *
 619   * Iterators are nestable without restriction (even on the same list).
 620   * During iteration, the list may not be changed.
 621   * If you use C++, the *_copy and *_sorted iterators allow changing during iteration.
 622   *
 623   * You may freely use break and continue in the loop.
 624   *  : int i;
 625   *  : char *s;
 626   *  : list_char_p_forall (v, i, s) {
 627   *  :     printf ("v[%d]=%s\n", i, s);
 628   *  : }
 629   */
 630  
 631  #define List_forall(v,i,h)                     \
 632          for(List_init_iterator(v,&(i));        \
 633              List_next_iteration(v,&(i),&(h));)
 634  
 635  #define List_forall_reverse(v,i,h)                    \
 636          for(List_init_iterator_reverse(v,&(i));       \
 637              List_next_iteration_reverse(v,&(i),&(h));)
 638  
 639  #define List_forall_ptr(v,i,h)                     \
 640          for(List_init_iterator((v),&(i));          \
 641              List_next_iteration_ptr(v,&(i),&(h));) \
 642  
 643  #define List_forall_ptr_reverse(v,i,h)                 \
 644          for(List_init_iterator_reverse(v,&(i));        \
 645              List_next_iteration_ptr_reverse((i),&(h));)
 646  
 647  #define List_forall_keys(v,i)                  \
 648          for(List_init_iterator(v,&(i));        \
 649              List_next_iteration(v,&(i),NULL);)
 650  
 651  #define List_forall_keys_reverse(v,i)                  \
 652          for(List_init_iterator_reverse(v,&(i));        \
 653              List_next_iteration_reverse(v,&(i),NULL);)
 654  
 655  #define List_init_iterator(v,i)              *(i)= NULL
 656  #define List_init_iterator_reverse(v,i)      *(i)= NULL
 657  
 658  /*! doc-ignore */
 659  Global_ERWIN_EXPORT
 660  Global_ERWIN_BOOL List_next_iteration (
 661        List_t const * /*self*/, Global_list_key_t * /*key*/, oType * /*valuep*/);
 662  
 663  /*! doc-ignore */
 664  Global_ERWIN_EXPORT
 665  Global_ERWIN_BOOL List_next_iteration_reverse (
 666        List_t const * /*self*/, Global_list_key_t * /*key*/, oType * /*valuep*/);
 667  
 668  /*! doc-ignore */
 669  Global_ERWIN_EXPORT
 670  Global_ERWIN_BOOL List_next_iteration_ptr (
 671        List_t * /*self*/, Global_list_key_t * /*key*/, oTypeVar ** /*valuepp*/);
 672  
 673  /*! doc-ignore */
 674  Global_ERWIN_EXPORT
 675  Global_ERWIN_BOOL List_next_iteration_ptr_reverse (
 676        List_t * /*self*/, Global_list_key_t * /*key*/, oTypeVar ** /*valuepp*/);
 677  
 678  /* ***** access to all entries: ***** */
 679  
 680  Global_ERWIN_EXPORT
 681  int List_nentries (List_t const * /*self*/);
 682     /* Returns the number of entries in the list.
 683      *
 684      * NOTE: If you compile lists to use minimal space, then
 685      * no element counter is implemented.  In this case,
 686      * this is slow, it has to iterate the whole list.
 687      *
 688      * The #define to determine whether an element counter
 689      * is not implemented is List_SLOW_NENTRIES, which is 0 by
 690      * default.
 691      */
 692  
 693  Global_ERWIN_EXPORT
 694  Global_ERWIN_BOOL List_empty (List_t const * /*self*/);
 695     /* Returns whether the list contains no elements. */
 696  
 697  #if 0
 698  /* NOT YET IMPLEMENTED */
 699  Global_ERWIN_EXPORT
 700  void List_map (List_t * /*self*/, List_map_t /*map*/);
 701     /* Applies a given function to all elements of the list. */
 702  
 703  Global_ERWIN_EXPORT
 704  int List_cmp (List_t const *, List_t const *, List_cmp_t /*cmp*/) ATTR_PURE;
 705      /* Returns a comparison value for lexical sort order.
 706       *
 707       * This function is NULL safe.  NULL is smaller than any
 708       * other list.  By this you can easily sort a list in reverse order and then
 709       * rtrim_if(is_NULL) to get rid of NULL elements.
 710       *
 711       * If cmp is NULL, Global_oType_CMP will be used.  If that is not defined, an error
 712       * will occur.
 713       */
 714  
 715  #endif /* NOT YET IMPLEMENTED */
 716  
 717  Global_ERWIN_EXPORT
 718  Global_hashval_t List_hash_raw (List_t const *) ATTR_PURE;
 719      /* Returns a hash value, which is derived from hash values for oType.
 720       *
 721       * Note: Usually you want hash values if you work with maps.  So you
 722       *       should define the hash value in such a way that both the map
 723       *       header as well as the list header find them.
 724       *
 725       * Further Note: This will only be implemented if Global_oType_HASH_RAW
 726       *       is defined.
 727       */
 728  
 729  ERWIN_WRAPPER
 730  Global_hashval_t List_hash (List_t const *);
 731      /* Same as List_hash_raw() now that hash_raw() is good enough. */
 732  
 733  ERWIN_WRAPPER
 734  Global_hashval_t List_hash (List_t const *x)
 735  {
 736      return List_hash_raw(x);
 737  }
 738  
 739  /*--END-C--*/
 740  
 741  #IFCPPONLY
 742  #ELSE
 743  #ifdef __cplusplus
 744  }
 745  #endif
 746  #ENDIF
 747  
 748  struct List_t
 749  #ifdef List_SUPER_CLASS
 750     : List_SUPER_CLASS_ACCESS List_SUPER_CLASS
 751  #endif
 752  {
 753      /*
 754       * The List Class
 755       * ==============
 756       * Implements doubly or singly linked lists.
 757       *
 758       * Throughout the documentation, the following prefixes will be used:
 759       *   - Global_:
 760       *       The library prefix: for applications, this is typically
 761       *       empty, for an xyz-Library, this is either \tt(XYZ_), \tt(xyz_) or
 762       *       \tt(Xyz), depending on the identifier in occurs in.
 763       *       +---------------------+-----------------+
 764       *       |! Template           |! Instantiation  |
 765       *       | Global_LIST_OK      | XYZ_LIST_OK     |
 766       *       | Global_list_new     | xyz_list_new    |
 767       *       +---------------------+-----------------+
 768       *
 769       *   - List_:
 770       *       This is equivalent to Global_list_oType, or the name
 771       *       that was set with \tt(-name=...) for this data structure.
 772       *       The case and underbar convention is adjusted, too.
 773       *
 774       *       Assuming a library prefix \tt(xyz) and oType == int, you get:
 775       *       +-----------------+--------------------------+
 776       *       |! Template       |! Instantiation           |
 777       *       | List_t          | xyz_list_int_t           |
 778       *       | List_ALLOW_NULL | XYZ_LIST_INT_ALLOW_NULL  |
 779       *       +-----------------+--------------------------+
 780       *   - List_class:
 781       *       This is the name of the data structure type in C++: capitalised
 782       *       and with underbars removed:
 783       *       +-----------------+---------------+
 784       *       |! List_t         |! List_class   |
 785       *       | list_int_t      | ListInt       |
 786       *       +-----------------+---------------+
 787       */
 788  
 789      List_STD_MEMBERS(List_t)
 790  
 791  #ifdef __cplusplus
 792  public:
 793  #endif
 794  
 795      List_record
 796  
 797  #ifdef __cplusplus
 798      /*! doc-ignore */
 799      List_t *it()             { return this; }
 800  
 801      /*! doc-ignore */
 802      List_t const *it() const { return this; }
 803  
 804  /*--BEGIN-CLASS--*/
 805  public:
 806  #ifdef __cplusplus
 807  #if !Global_ERWIN_DEFAULT_NEW_DELETE
 808      static void *operator new(size_t);
 809      static void operator delete(void *, size_t);
 810      static void *operator new[](size_t);
 811      static void operator delete[](void *, size_t);
 812  #endif
 813  #endif
 814  
 815      /* Creation */
 816      List_t (void);
 817  
 818      static List_t const &static_zero();
 819  
 820  #if List_DYN_ZERO
 821      Global_ERWIN_EXPLICIT List_t (oTypeTouched);
 822  #endif /* List_DYN_ZERO */
 823  
 824      void _constructor (void);
 825      void _destructor  (void);
 826  
 827      /*
 828       * Check for NULL pointers */
 829  protected:
 830  #ifndef NDEBUG
 831      void cn() const;
 832      void cn(void const *) const;
 833  #else
 834      /* Hopefully optimised away: */
 835      static void cn() {}
 836      static void cn(void const *) {}
 837  #endif
 838  
 839  public:
 840      /* Status code */
 841  #if !Global_ERWIN_GLOBAL_ERRNO
 842      int get_errno(void) const        { return it()->m_errno; }
 843      void clear_errno(void) const { List_clear_errno (it()); }
 844  #else
 845      static int get_errno(void)        { return Global_list_errno; }
 846      static void clear_errno(void) { Global_list_errno= Global_LIST_OK; }
 847  #endif
 848  
 849      List_t &clear() { cn(); List_clear (it()); return *this; }
 850  
 851      /* Assignment */
 852      List_t &operator=(List_t const &);
 853      List_t &operator=(List_t const *);
 854  
 855      /* Destruction */
 856      ~List_t ();
 857  
 858      /* Conversion to C type */
 859      operator List_t const *() const { cn(); return it(); }
 860      operator List_t *()             { cn(); return it(); }
 861  
 862      Global_list_key_t front () const
 863          { cn(); return List_front (it()); }
 864  
 865      Global_list_key_t back () const
 866          { cn(); return List_back (it()); }
 867  
 868      Global_list_key_t previous (Global_list_key_t k) const
 869          { cn(); return List_previous (it(), k); }
 870  
 871      Global_list_key_t prev (Global_list_key_t k) const
 872          { return previous(k); }
 873  
 874      Global_list_key_t next (Global_list_key_t k) const
 875          { cn(); return List_next (it(), k); }
 876  
 877      Global_list_key_t nth_key (int k) const
 878          { cn(); return List_nth_key (it(), k); }
 879  
 880      oTypeResult nth (int k) const
 881          { return List_nth (it(), k); }
 882  
 883      void erase (Global_list_key_t k)
 884          { cn(); List_erase (it(), k); }
 885  
 886      void erase (Global_list_key_t &iter, Global_list_key_t k, bool reverse List_DEFAULT_ARG(false))
 887          { cn(); List_erase_in_loop (&iter, it(), k, reverse); }
 888  
 889      void erase_in_loop (Global_list_key_t &iter, Global_list_key_t k,
 890                          bool reverse List_DEFAULT_ARG (false))
 891          { cn(); List_erase_in_loop (&iter, it(), k, reverse); }
 892  
 893      oTypeResult value(Global_list_key_t k) const
 894          { return List_value (it(), k); }
 895  
 896      oTypeResult first() const
 897          { return List_first (it()); }
 898  
 899      oTypeResult last() const
 900          { return List_last (it()); }
 901  
 902      List_element_ptr_t value_ptr(Global_list_key_t k)
 903          { cn(); return List_value_ptr (it(), k); }
 904  
 905      List_element_ref_t value_ref(Global_list_key_t k)
 906          { cn(); return *List_value_ptr (it(), k); }
 907  
 908      Global_list_key_t append  (oTypeTouched o)
 909          { cn(); return List_append (it(), o); }
 910  
 911      Global_list_key_t prepend (oTypeTouched o)
 912          { cn(); return List_prepend (it(), o); }
 913  
 914      Global_list_key_t insert_before  (Global_list_key_t k, oTypeTouched o)
 915          { cn(); return List_insert_before (it(), k, o); }
 916  
 917      Global_list_key_t insert_after  (Global_list_key_t k, oTypeTouched o)
 918          { cn(); return List_insert_after (it(), k, o); }
 919  
 920      void overwrite  (Global_list_key_t k, oTypeTouched o)
 921          { cn(); List_overwrite (it(), k, o); }
 922  
 923      Global_list_key_t insert  (Global_list_key_t k, oTypeTouched o, bool backwards)
 924          { cn(); return List_insert (it(), k, o, backwards); }
 925  
 926      List_t &operator<<(oTypeTouched o)
 927          { cn(); List_append (it(), o); return *this; }
 928  
 929      List_t &append_list (List_t const *x)
 930          { cn(x); List_append_list (it(), x->it()); return *this; }
 931      List_t &append_list (List_t const &x)
 932          { cn(x); List_append_list (it(), x.it()); return *this; }
 933  
 934      List_t &prepend_list (List_t const *x)
 935          { cn(x); List_prepend_list (it(), x->it()); return *this; }
 936      List_t &prepend_list (List_t const &x)
 937          { cn(x); List_prepend_list (it(), x.it()); return *this; }
 938  
 939      List_t &insert_list_before (Global_list_key_t k, List_t const *x)
 940          { cn(x); List_insert_list_before (it(), k, x->it()); return *this; }
 941      List_t &insert_list_before (Global_list_key_t k, List_t const &x)
 942          { cn(x); List_insert_list_before (it(), k, x.it()); return *this; }
 943  
 944      List_t &insert_list_after (Global_list_key_t k, List_t const *x)
 945          { cn(x); List_insert_list_after (it(), k, x->it()); return *this; }
 946      List_t &insert_list_after (Global_list_key_t k, List_t const &x)
 947          { cn(x); List_insert_list_after (it(), k, x.it()); return *this; }
 948  
 949      List_t &insert_list (Global_list_key_t k, List_t const *x, bool backwards)
 950          { cn(); List_insert_list (it(), k, x->it(), backwards); return *this; }
 951      List_t &insert_list (Global_list_key_t k, List_t const &x, bool backwards)
 952          { cn(); List_insert_list (it(), k, x.it(), backwards); return *this; }
 953  
 954  #if List_DIRECT_RECURSION == 0
 955      List_t &append (List_t const *x)
 956          { cn(x); List_append_list (it(), x->it()); return *this; }
 957      List_t &append (List_t const &x)
 958          { cn(x); List_append_list (it(), x.it()); return *this; }
 959  
 960      List_t &prepend (List_t const *x)
 961          { cn(x); List_prepend_list (it(), x->it()); return *this; }
 962      List_t &prepend (List_t const &x)
 963          { cn(x); List_prepend_list (it(), x.it()); return *this; }
 964  
 965      List_t &insert_before (Global_list_key_t k, List_t const *x)
 966          { cn(x); List_insert_list_before (it(), k, x->it()); return *this; }
 967      List_t &insert_before (Global_list_key_t k, List_t const &x)
 968          { cn(x); List_insert_list_before (it(), k, x.it()); return *this; }
 969  
 970      List_t &insert_after (Global_list_key_t k, List_t const *x)
 971          { cn(x); List_insert_list_after (it(), k, x->it()); return *this; }
 972      List_t &insert_after (Global_list_key_t k, List_t const &x)
 973          { cn(x); List_insert_list_after (it(), k, x.it()); return *this; }
 974  
 975      List_t &insert (Global_list_key_t k, List_t const *x, bool backwards)
 976          { cn(); List_insert_list (it(), k, x->it(), backwards); return *this; }
 977      List_t &insert (Global_list_key_t k, List_t const &x, bool backwards)
 978          { cn(); List_insert_list (it(), k, x.it(), backwards); return *this; }
 979  #endif
 980  
 981  /*
 982   * #if List_MANY_CASTS != 0
 983   *    operator bool () const          { cn(); return !empty(); }
 984   * #endif
 985   */
 986  
 987      Global_list_key_t init_iterator () const
 988      {
 989          cn();
 990          Global_list_key_t a;
 991          List_init_iterator (it(), &a);
 992          return a;
 993      }
 994  
 995      Global_list_key_t init_iterator_reverse () const
 996      {
 997          cn();
 998          Global_list_key_t a;
 999          List_init_iterator_reverse (it(), &a);
1000          return a;
1001      }
1002  
1003      bool next_iteration (Global_list_key_t *a, oType *b) const
1004      {
1005          cn();
1006          return Global_ERWIN_TO_BOOL (List_next_iteration (this, a, b));
1007      }
1008  
1009  
1010      bool next_iteration_ptr (Global_list_key_t *a, oTypeVar **b)
1011      {
1012          cn();
1013          return Global_ERWIN_TO_BOOL (List_next_iteration_ptr (this, a, b));
1014      }
1015  
1016      bool next_iteration_reverse (Global_list_key_t *a, oType *b) const
1017      {
1018          cn();
1019          return Global_ERWIN_TO_BOOL (List_next_iteration_reverse (this, a, b));
1020      }
1021  
1022  
1023      bool next_iteration_ptr_reverse (Global_list_key_t *a, oTypeVar **b)
1024      {
1025          cn();
1026          return Global_ERWIN_TO_BOOL (List_next_iteration_ptr_reverse (this, a, b));
1027      }
1028  
1029      int  nentries () const                    { return List_nentries (it()); }
1030      bool empty () const                       { return Global_ERWIN_TO_BOOL(List_empty (it())); }
1031      bool non_empty () const                   { return !List_empty (it()); }
1032  
1033  #if 0
1034  /* not yet implemented */
1035      int cmp (List_t const *other,
1036               List_cmp_t cmp List_DEFAULT_ARG(List_CMP_T_NULL)) const
1037      {
1038          if (this == NULL)
1039              return other == NULL ? 0 : -1;
1040          if (other == NULL)
1041              return +1;
1042          return List_cmp(it(), other->it(), cmp);
1043      }
1044  
1045      int cmp (List_t const &other,
1046               List_cmp_t cmp_func List_DEFAULT_ARG(List_CMP_T_NULL)) const
1047      {
1048          return cmp (&other, cmp_func);
1049      }
1050  
1051      bool operator== (List_t const &b) const { return cmp(b,List_CMP_T_NULL) == 0; }
1052      bool operator== (List_t const *b) const { return cmp(b,List_CMP_T_NULL) == 0; }
1053  
1054      bool operator!= (List_t const &b) const { return cmp(b,List_CMP_T_NULL) != 0; }
1055      bool operator!= (List_t const *b) const { return cmp(b,List_CMP_T_NULL) != 0; }
1056  
1057      bool operator<= (List_t const &b) const { return cmp(b,List_CMP_T_NULL) <= 0; }
1058      bool operator<= (List_t const *b) const { return cmp(b,List_CMP_T_NULL) <= 0; }
1059  
1060      bool operator>= (List_t const &b) const { return cmp(b,List_CMP_T_NULL) >= 0; }
1061      bool operator>= (List_t const *b) const { return cmp(b,List_CMP_T_NULL) >= 0; }
1062  
1063      bool operator<  (List_t const &b) const { return cmp(b,List_CMP_T_NULL) < 0; }
1064      bool operator<  (List_t const *b) const { return cmp(b,List_CMP_T_NULL) < 0; }
1065  
1066      bool operator>  (List_t const &b) const { return cmp(b,List_CMP_T_NULL) > 0; }
1067      bool operator>  (List_t const *b) const { return cmp(b,List_CMP_T_NULL) > 0; }
1068  #endif
1069  
1070  /*--END-CLASS--*/
1071  #endif /* defined __cplusplus */
1072  };
1073  
1074  #undef List_LOCAL_WRAPPER
1075  
1076  #ifdef __cplusplus
1077  
1078  #IFEQ(0,0)
1079  
1080  /* Some nasty global functions that are useful e.g. for forall.  Note that these
1081   * are not local to one list but will be overloaded by all different list
1082   * instantiations. */
1083  extern "C++" {
1084  ERWIN_WRAPPER
1085  List_t *Global_erwin_ptr_of(List_t *x) { return x;  }
1086  
1087  ERWIN_WRAPPER
1088  List_t *Global_erwin_ptr_of(List_t &x) { return &x; }
1089  
1090  ERWIN_WRAPPER
1091  List_t const *Global_erwin_ptr_const_of (List_t const *x) { return x;  }
1092  
1093  ERWIN_WRAPPER
1094  List_t const *Global_erwin_ptr_const_of (List_t const &x) { return &x; }
1095  }
1096  
1097  #ELSE
1098  
1099  #ifndef Global_erwin_ptr_of
1100  #define Global_erwin_ptr_of(x) x
1101  #endif
1102  
1103  #ifndef Global_erwin_ptr_const_of
1104  #define Global_erwin_ptr_const_of(x) x
1105  #endif
1106  
1107  #ENDIF
1108  
1109  /* Forall macros for C++ */
1110  #ifndef Global_list_forall
1111  #define Global_list_forall(v,i,h)                                  \
1112          for ((i)= Global_erwin_ptr_const_of(v)->init_iterator();   \
1113               Global_erwin_ptr_const_of(v)->next_iteration(&(i),&(h));)
1114  #endif
1115  
1116  
1117  #ifndef Global_list_forall_ptr
1118  #define Global_list_forall_ptr(v,i,h)                        \
1119          for ((i)= Global_erwin_ptr_of(v)->init_iterator();   \
1120               Global_erwin_ptr_of(v)->next_iteration_ptr(&(i),&(h));)
1121  #endif
1122  
1123  #ifndef Global_list_forall_reverse
1124  #define Global_list_forall_reverse(v,i,h)                                  \
1125          for ((i)= Global_erwin_ptr_const_of(v)->init_iterator();           \
1126               Global_erwin_ptr_const_of(v)->next_iteration_reverse(&(i),&(h));)
1127  #endif
1128  
1129  #ifndef Global_list_forall_ptr_reverse
1130  #define Global_list_forall_ptr_reverse(v,i,h)                        \
1131          for ((i)= Global_erwin_ptr_of(v)->init_iterator();           \
1132               Global_erwin_ptr_of(v)->next_iteration_ptr_reverse(&(i),&(h));)
1133  #endif
1134  
1135  #ifndef Global_list_forall_keys
1136  #define Global_list_forall_keys(v,i)                               \
1137          for ((i)= Global_erwin_ptr_const_of(v)->init_iterator();   \
1138               Global_erwin_ptr_const_of(v)->next_iteration(&(i),NULL);)
1139  #endif
1140  
1141  #ifndef Global_list_forall_keys_reverse
1142  #define Global_list_forall_keys_reverse(v,i)                                     \
1143          for ((i)= Global_erwin_ptr_const_of(v)->init_iterator();                 \
1144               Global_erwin_ptr_const_of(v)->next_iteration_reverse(&(i),NULL);)
1145  #endif
1146  
1147  #ifndef Global_list_forall_values
1148  #define Global_list_forall_values(v,h)                          \
1149          for (Global_list_key_t ERWIN_GENSYM(erwin_local_j)=     \
1150                   Global_erwin_ptr_const_of(v)->init_iterator(); \
1151               Global_erwin_ptr_const_of(v)->next_iteration(      \
1152                   &ERWIN_GENSYM(erwin_local_j),&(h));)
1153  #endif
1154  
1155  #ifndef Global_list_forall_values_ptr
1156  #define Global_list_forall_values_ptr(v,h)                  \
1157          for (Global_list_key_t ERWIN_GENSYM(erwin_local_j)= \
1158                   Global_erwin_ptr_of(v)->init_iterator();   \
1159               Global_erwin_ptr_of(v)->next_iteration_ptr(        \
1160                   &ERWIN_GENSYM(erwin_local_j),&(h));)
1161  #endif
1162  
1163  #ifndef Global_list_forall_values_reverse
1164  #define Global_list_forall_values_reverse(v,h)                     \
1165          for (Global_list_key_t ERWIN_GENSYM(erwin_local_j)=        \
1166                   Global_erwin_ptr_const_of(v)->init_iterator();    \
1167               Global_erwin_ptr_const_of(v)->next_iteration_reverse( \
1168                   &ERWIN_GENSYM(erwin_local_j),&(h));)
1169  #endif
1170  
1171  #ifndef Global_list_forall_values_ptr_reverse
1172  #define Global_list_forall_values_ptr_reverse(v,h)           \
1173          for (Global_list_key_t ERWIN_GENSYM(erwin_local_j)=  \
1174                   Global_erwin_ptr_of(v)->init_iterator();    \
1175               Global_erwin_ptr_of(v)->next_iteration_ptr_reserve( \
1176                   &ERWIN_GENSYM(erwin_local_j),&(h));)
1177  #endif
1178  
1179  #endif /* __cplusplus */
1180  
1181  #endif /* ERWINMM_List_ErwinHExt */

Index

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