many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
void dlist::insert_before(void *item, void *where)
{
- dlink *where_link = (dlink *)((char *)where+loffset);
+ dlink *where_link = get_link(where);
set_next(item, where);
set_prev(item, where_link->prev);
void dlist::insert_after(void *item, void *where)
{
- dlink *where_link = (dlink *)((char *)where+loffset);
+ dlink *where_link = get_link(where);
set_next(item, where_link->next);
set_prev(item, where);
void dlist::remove(void *item)
{
void *xitem;
- dlink *ilink = (dlink *)(((char *)item)+loffset); /* item's link */
+ dlink *ilink = get_link(item); /* item's link */
if (item == head) {
head = ilink->next;
if (head) {
}
}
-void * dlist::next(const void *item) const
+void *dlist::next(void *item)
{
if (item == NULL) {
return head;
}
- return ((dlink *)(((char *)item)+loffset))->next;
+ return get_next(item);
}
-void * dlist::prev(const void *item) const
+void *dlist::prev(void *item)
{
if (item == NULL) {
return tail;
}
- return ((dlink *)(((char *)item)+loffset))->prev;
+ return get_prev(item);
}
void dlist::destroy()
{
for (void *n=head; n; ) {
- void *ni = ((dlink *)(((char *)n)+loffset))->next;
+ void *ni = get_next(n);
free(n);
n = ni;
}
* it.
*/
dlist chain;
- dlistString *node;
+ chain.append(new_dlistString("This is a long test line"));
#define CNT 26
printf("append %d dlistString items\n", CNT*CNT*CNT);
strcpy(buf, "ZZZ");
if ((count & 0x3FF) == 0) {
Dmsg1(000, "At %d\n", count);
}
- node = new_dlistString(buf);
- chain.append(node);
+ chain.append(new_dlistString(buf));
buf[1]--;
}
buf[1] = 'Z';
buf[0]--;
}
printf("dlistString items appended, walking chain\n");
+ dlistString *node;
foreach_dlist(node, &chain) {
printf("%s\n", node->c_str());
}