2 ** Copyright (C) 2002 by Kevin L. Mitchell <klmitch@mit.edu>
4 ** This library is free software; you can redistribute it and/or
5 ** modify it under the terms of the GNU Library General Public
6 ** License as published by the Free Software Foundation; either
7 ** version 2 of the License, or (at your option) any later version.
9 ** This library is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ** Library General Public License for more details.
14 ** You should have received a copy of the GNU Library General Public
15 ** License along with this library; if not, write to the Free
16 ** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 #include "dbprim_int.h"
26 /** \ingroup dbprim_link
27 * \brief Dynamically initialize a linked list element.
29 * This function dynamically initializes a linked list element.
31 * \param elem A pointer to a #link_elem_t to be initialized.
33 * A pointer to \c void used to represent the object
34 * associated with the element. May not be \c NULL.
36 * \retval DB_ERR_BADARGS A \c NULL pointer was passed for \p
40 le_init(link_elem_t *elem, void *object)
42 initialize_dbpr_error_table(); /* initialize error table */
44 if (!elem || !object) /* verify arguments */
45 return DB_ERR_BADARGS;
47 elem->le_next = 0; /* initialize the element */
49 elem->le_object = object;
53 elem->le_magic = LINK_ELEM_MAGIC; /* set the magic number */