version 1.11, 2011/03/28 19:44:31 |
version 1.12, 2012/07/10 11:53:01 |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/time.h> |
#include <sys/time.h> |
|
|
|
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <vis.h> |
#include <vis.h> |
|
|
|
|
pb = ARRAY_FIRST(ps); |
pb = ARRAY_FIRST(ps); |
ARRAY_REMOVE(ps, 0); |
ARRAY_REMOVE(ps, 0); |
|
|
xfree(pb->data); |
free(pb->data); |
xfree(pb); |
free(pb); |
|
|
return (0); |
return (0); |
} |
} |
|
|
pb = ARRAY_ITEM(ps, idx); |
pb = ARRAY_ITEM(ps, idx); |
ARRAY_REMOVE(ps, idx); |
ARRAY_REMOVE(ps, idx); |
|
|
xfree(pb->data); |
free(pb->data); |
xfree(pb); |
free(pb); |
|
|
return (0); |
return (0); |
} |
} |
|
|
|
|
while (ARRAY_LENGTH(ps) >= limit) { |
while (ARRAY_LENGTH(ps) >= limit) { |
pb = ARRAY_LAST(ps); |
pb = ARRAY_LAST(ps); |
xfree(pb->data); |
free(pb->data); |
xfree(pb); |
free(pb); |
ARRAY_TRUNC(ps, 1); |
ARRAY_TRUNC(ps, 1); |
} |
} |
|
|
|
|
return (-1); |
return (-1); |
|
|
pb = ARRAY_ITEM(ps, idx); |
pb = ARRAY_ITEM(ps, idx); |
xfree(pb->data); |
free(pb->data); |
|
|
pb->data = data; |
pb->data = data; |
pb->size = size; |
pb->size = size; |