Changeset d09e5a1 for list.c


Ignore:
Timestamp:
May 31, 2003, 3:33:42 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5e53c4a
Parents:
c86a35c
Message:
Added libfaim
Added basic AIM support, including the "aimlogin", "aimwrite" and
   "aimlogout" commands
File:
1 edited

Legend:

Unmodified
Added
Removed
  • list.c

    r1aee7d9 rd09e5a1  
    2626
    2727int owl_list_append_element(owl_list *l, void *element) {
     28  void *ptr;
     29 
    2830  if ((l->size+1) > (l->avail/GROWAT)) {
    29     l->list=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *));
     31    ptr=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *));
     32    if (ptr==NULL) return(-1);
     33    l->list=ptr;
    3034    l->avail=l->avail*GROWBY;
    31     if (l->list==NULL) return(-1);
    3235  }
    3336
     
    3841
    3942int owl_list_prepend_element(owl_list *l, void *element) {
     43  void *ptr;
    4044  int i;
    4145 
    4246  if ((l->size+1) > (l->avail/GROWAT)) {
    43     l->list=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *));
     47    ptr=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *));
     48    if (ptr==NULL) return(-1);
     49    l->list=ptr;
    4450    l->avail=l->avail*GROWBY;
    45     if (l->list==NULL) return(-1);
    4651  }
    4752
Note: See TracChangeset for help on using the changeset viewer.