/[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 65 Revision 71
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/ 18*/
19 19
20 20
21#include "config.h" 21#include "config.h"
22#include "compat.h"
22#include <stddef.h> 23#include <stddef.h>
23#include <stdlib.h> 24#include <stdlib.h>
24#include <stdio.h> 25#include <stdio.h>
25#include "list.h" 26#include "list.h"
26#include "error.h" 27#include "error.h"
78 return NULL; 79 return NULL;
79 else 80 else
80 return ((char *) (l->els)) + indx * l->el_size; 81 return ((char *) (l->els)) + indx * l->el_size;
81} 82}
82 83
83int psiconv_list_add(psiconv_list l, void *el) 84int psiconv_list_add(psiconv_list l, const void *el)
84{ 85{
85 if (psiconv_list_resize(l,l->cur_len + 1)) 86 if (psiconv_list_resize(l,l->cur_len + 1))
86 return -PSICONV_E_NOMEM; 87 return -PSICONV_E_NOMEM;
87 memcpy(((char *) (l->els)) + l->cur_len * l->el_size, el, l->el_size); 88 memcpy(((char *) (l->els)) + l->cur_len * l->el_size, el, l->el_size);
88 l->cur_len ++; 89 l->cur_len ++;

Legend:
Removed from v.65  
changed lines
  Added in v.71

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