/[public]/psiconv/trunk/lib/psiconv/list.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/list.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 98 Revision 196
1/* 1/*
2 list.c - Part of psiconv, a PSION 5 file formats converter 2 list.c - Part of psiconv, a PSION 5 file formats converter
3 Copyright (c) 1999, 2000 Frodo Looijaard <frodol@dds.nl> 3 Copyright (c) 1999-2004 Frodo Looijaard <frodol@dds.nl>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
20 20
21#include "config.h" 21#include "config.h"
22#include "compat.h" 22#include "compat.h"
23#include <stddef.h> 23#include <stddef.h>
24#include <stdlib.h> 24#include <stdlib.h>
25#include <string.h>
25#include <stdio.h> 26#include <stdio.h>
26#include "general.h" 27#include "general.h"
27#include "list.h" 28#include "list.h"
28#include "error.h" 29#include "error.h"
30
31#ifdef DMALLOC
32#include <dmalloc.h>
33#endif
34
29 35
30static int psiconv_list_resize(psiconv_list l,psiconv_u32 nr); 36static int psiconv_list_resize(psiconv_list l,psiconv_u32 nr);
31 37
32struct psiconv_list_s { 38struct psiconv_list_s {
33 psiconv_u32 cur_len; 39 psiconv_u32 cur_len;
51 57
52void psiconv_list_free(psiconv_list l) 58void psiconv_list_free(psiconv_list l)
53{ 59{
54 if (l->max_len) 60 if (l->max_len)
55 free(l->els); 61 free(l->els);
56 l->max_len = 0; 62 free(l);
57 l->cur_len = 0;
58 l->els = NULL; 63 l = NULL;
59} 64}
60 65
61void psiconv_list_free_el(psiconv_list l, void free_el(void *el)) 66void psiconv_list_free_el(psiconv_list l, void free_el(void *el))
62{ 67{
63 psiconv_list_foreach_el(l,free_el); 68 psiconv_list_foreach_el(l,free_el);

Legend:
Removed from v.98  
changed lines
  Added in v.196

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26