Ignore:
Timestamp:
Dec 9, 2000, 8:19:42 PM (25 years ago)
Author:
umoeller
Message:

Major updates; timers, LVM, miscellaneous.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/linklist.c

    r8 r14  
    5757/*
    5858 *      Copyright (C) 1997-2000 Ulrich M”ller.
    59  *      This file is part of the XWorkplace source package.
    60  *      XWorkplace is free software; you can redistribute it and/or modify
     59 *      This file is part of the "XWorkplace helpers" source package.
     60 *      This is free software; you can redistribute it and/or modify
    6161 *      it under the terms of the GNU General Public License as published
    6262 *      by the Free Software Foundation, in version 2 as it comes in the
     
    8282
    8383/* ******************************************************************
    84  *                                                                  *
    85  *   List base functions                                            *
    86  *                                                                  *
     84 *
     85 *   List base functions
     86 *
    8787 ********************************************************************/
     88
     89/*
     90 *@@ lstMalloc:
     91 *      wrapper around malloc() to make sure memory is
     92 *      allocated from the C runtime the helpers were
     93 *      compiled with. This is useful for auto-free
     94 *      lists.
     95 *
     96 *@@added V0.9.7 (2000-12-07) [umoeller]
     97 */
     98
     99void* lstMalloc(size_t size)
     100{
     101    return (malloc(size));
     102}
     103
     104/*
     105 *@@ lstStrDup:
     106 *      wrapper around strdup() to make sure memory is
     107 *      allocated from the C runtime the helpers were
     108 *      compiled with. This is useful for auto-free
     109 *      lists.
     110 *
     111 *@@added V0.9.7 (2000-12-07) [umoeller]
     112 */
     113
     114void* lstStrDup(const char *pcsz)
     115{
     116    return (strdup(pcsz));
     117}
    88118
    89119/*
     
    111141 *      you're storing other objects, such as numbers
    112142 *      or other static items.
     143 *
     144 *      This of course will be a "flat" free(). If
     145 *      you store structures in the list using other
     146 *      heap pointers, auto-free would cause memory leaks.
     147 *
     148 *      Also, auto-free only works if the malloc() that
     149 *      has been used on the list item is in the same C
     150 *      runtime as with the linklist functions. If the
     151 *      caller uses a different runtime (e.g. from a DLL),
     152 *      it can use lstMalloc() for allocating the list
     153 *      item and still use auto-free.
    113154 *
    114155 *      Note: You better call lstInit only once per list,
     
    758799
    759800/* ******************************************************************
    760  *                                                                  *
    761  *   List sorting                                                   *
    762  *                                                                  *
     801 *
     802 *   List sorting
     803 *
    763804 ********************************************************************/
    764805
     
    933974
    934975/* ******************************************************************
    935  *                                                                  *
    936  *   List pseudo-stacks                                             *
    937  *                                                                  *
     976 *
     977 *   List pseudo-stacks
     978 *
    938979 ********************************************************************/
    939980
Note: See TracChangeset for help on using the changeset viewer.