FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
array_redimpresv_obj.c
Go to the documentation of this file.
1
/* redim preserve function */
2
3
#include "
fb.h
"
4
5
int
fb_ArrayRedimPresvObj
6
(
7
FBARRAY
*array,
8
size_t
element_len,
9
FB_DEFCTOR
ctor,
10
FB_DEFCTOR
dtor,
11
size_t
dimensions,
12
...
13
)
14
{
15
va_list ap;
16
int
res;
17
18
va_start( ap, dimensions );
19
20
/* new? */
21
if
( array->
ptr
==
NULL
)
22
{
23
res =
fb_hArrayAlloc
( array, element_len,
FB_FALSE
, ctor, dimensions, ap );
24
}
25
/* realloc.. */
26
else
27
{
28
FB_DTORMULT
dtor_mult = (dtor !=
NULL
? &
fb_hArrayDtorObj
:
NULL
);
29
30
res =
fb_hArrayRealloc
( array, element_len,
FB_FALSE
, ctor, dtor_mult, dtor, dimensions, ap );
31
}
32
33
va_end( ap );
34
35
return
res;
36
}
rtlib
array_redimpresv_obj.c
Generated on Thu Jan 23 2014 19:40:07 for FreeBASIC by
1.8.4