view release on metacpan or search on metacpan
cbc/macros.c view on Meta::CPAN
#include "cbc/macros.h"
/*===== DEFINES ==============================================================*/
/*===== TYPEDEFS =============================================================*/
/*===== STATIC FUNCTION PROTOTYPES ===========================================*/
static void get_names_callback(const CMacroInfo *pmi);
static void get_defs_callback(const CMacroInfo *pmi);
/*===== EXTERNAL VARIABLES ===================================================*/
/*===== GLOBAL VARIABLES =====================================================*/
/*===== STATIC VARIABLES =====================================================*/
/*===== STATIC FUNCTIONS =====================================================*/
cbc/macros.c view on Meta::CPAN
struct get_names_cb_arg
{
#ifdef PERL_IMPLICIT_CONTEXT
void *interp;
#endif
size_t count;
LinkedList ll;
};
static void get_names_callback(const CMacroInfo *pmi)
{
struct get_names_cb_arg *a = pmi->arg;
if (a->ll)
{
dTHXa(a->interp);
LL_push(a->ll, newSVpv(pmi->name, 0));
}
else
{
cbc/macros.c view on Meta::CPAN
*******************************************************************************/
struct get_defs_cb_arg
{
#ifdef PERL_IMPLICIT_CONTEXT
void *interp;
#endif
LinkedList ll;
};
static void get_defs_callback(const CMacroInfo *pmi)
{
struct get_defs_cb_arg *a = pmi->arg;
dTHXa(a->interp);
LL_push(a->ll, newSVpv(pmi->definition, pmi->definition_len));
}
/*===== FUNCTIONS ============================================================*/
/*******************************************************************************
cbc/option.c view on Meta::CPAN
break;
void handle_option(pTHX_ CBC *THIS, SV *opt, SV *sv_val, SV **rval, HandleOptionResult *p_res)
{
START_OPTIONS
FLAG_OPTION(OrderMembers, order_members, 0, 0)
FLAG_OPTION(Warnings, cfg.issue_warnings, 0, 0)
FLAG_OPTION(HasCPPComments, cfg.has_cpp_comments, 0, 1)
FLAG_OPTION(HasMacroVAARGS, cfg.has_macro_vaargs, 0, 1)
FLAG_OPTION(UnsignedChars, cfg.unsigned_chars, 0, 0)
FLAG_OPTION(UnsignedBitfields, cfg.unsigned_bitfields, 0, 0)
IVAL_OPTION(PointerSize, cfg.layout.ptr_size, 1, 0)
IVAL_OPTION(EnumSize, cfg.layout.enum_size, 1, 0)
IVAL_OPTION(IntSize, cfg.layout.int_size, 1, 0)
IVAL_OPTION(CharSize, cfg.layout.char_size, 1, 0)
IVAL_OPTION(ShortSize, cfg.layout.short_size, 1, 0)
IVAL_OPTION(LongSize, cfg.layout.long_size, 1, 0)
IVAL_OPTION(LongLongSize, cfg.layout.long_long_size, 1, 0)
cbc/option.c view on Meta::CPAN
SV *get_configuration(pTHX_ CBC *THIS)
{
HV *hv = newHV();
SV *sv;
FLAG_OPTION(OrderMembers, order_members )
FLAG_OPTION(Warnings, cfg.issue_warnings )
FLAG_OPTION(HasCPPComments, cfg.has_cpp_comments )
FLAG_OPTION(HasMacroVAARGS, cfg.has_macro_vaargs )
FLAG_OPTION(UnsignedChars, cfg.unsigned_chars )
FLAG_OPTION(UnsignedBitfields, cfg.unsigned_bitfields)
IVAL_OPTION(PointerSize, cfg.layout.ptr_size )
IVAL_OPTION(EnumSize, cfg.layout.enum_size )
IVAL_OPTION(IntSize, cfg.layout.int_size )
IVAL_OPTION(CharSize, cfg.layout.char_size )
IVAL_OPTION(ShortSize, cfg.layout.short_size )
IVAL_OPTION(LongSize, cfg.layout.long_size )
IVAL_OPTION(LongLongSize, cfg.layout.long_long_size )
cbc/sourcify.c view on Meta::CPAN
static void add_enum_spec_string_rec(pTHX_ SourcifyConfig *pSC, SV *s,
EnumSpecifier *pES, int level, SourcifyState *pSS);
static void add_struct_spec_string_rec(pTHX_ SourcifyConfig *pSC, SV *str, SV *s,
Struct *pStruct, int level, SourcifyState *pSS);
static void add_typedef_list_decl_string(pTHX_ SV *str, TypedefList *pTDL);
static void add_typedef_list_spec_string(pTHX_ SourcifyConfig *pSC, SV *str, TypedefList *pTDL);
static void add_enum_spec_string(pTHX_ SourcifyConfig *pSC, SV *str, EnumSpecifier *pES);
static void add_struct_spec_string(pTHX_ SourcifyConfig *pSC, SV *str, Struct *pStruct);
static void pp_macro_callback(const CMacroInfo *pmi);
static void add_preprocessor_definitions(pTHX_ CParseInfo *pCPI, SV *str);
/*===== EXTERNAL VARIABLES ===================================================*/
/*===== GLOBAL VARIABLES =====================================================*/
/*===== STATIC VARIABLES =====================================================*/
/*===== STATIC FUNCTIONS =====================================================*/
cbc/sourcify.c view on Meta::CPAN
} END_STMT
struct macro_cb_arg
{
#ifdef PERL_IMPLICIT_CONTEXT
void *interp;
#endif
SV *string;
};
static void pp_macro_callback(const CMacroInfo *pmi)
{
struct macro_cb_arg *a = pmi->arg;
SV *s = a->string;
dTHXa(a->interp);
if (SvCUR(s) + pmi->definition_len + 10 >= SvLEN(s))
SvGROW(s, 2*SvLEN(s));
sv_catpvn(s, "#define ", 8);
sv_catpvn(s, pmi->definition, pmi->definition_len);
ctlib/ctparse.c view on Meta::CPAN
*
* ARGUMENTS:
*
* RETURNS:
*
*******************************************************************************/
struct macro_cb_arg
{
HashTable predef;
void (*func)(const CMacroInfo *);
CMacroInfo info;
};
static void macro_callback(const struct macro_info *pmi)
{
struct macro_cb_arg *a = pmi->arg;
if (a->predef == NULL || !HT_exists(a->predef, pmi->name, 0, 0))
{
CMacroInfo *p = &a->info;
p->name = pmi->name;
p->definition = pmi->definition;
p->definition_len = pmi->definition_len;
a->func(p);
}
}
/*******************************************************************************
ctlib/ctparse.c view on Meta::CPAN
********************************************************************************
*
* DESCRIPTION:
*
* ARGUMENTS:
*
* RETURNS:
*
*******************************************************************************/
void macro_iterate_defs(CParseInfo *pCPI, void (*func)(const CMacroInfo *),
void *arg, CMIFlags flags)
{
if (pCPI && pCPI->pp)
{
struct macro_cb_arg a;
unsigned long ppflags = 0;
if (flags & CMIF_WITH_DEFINITION)
ppflags |= MI_WITH_DEFINITION;
ctlib/ctparse.h view on Meta::CPAN
struct CPP *pp;
unsigned available : 1;
unsigned ready : 1;
} CParseInfo;
typedef struct {
void *arg;
const char *name;
const char *definition;
size_t definition_len;
} CMacroInfo;
#define CMIF_WITH_DEFINITION 0x00000001
#define CMIF_NO_PREDEFINED 0x00000002
typedef unsigned CMIFlags;
/*===== FUNCTION PROTOTYPES ==================================================*/
#define parse_buffer CTlib_parse_buffer
int parse_buffer(const char *filename, const Buffer *pBuf,
ctlib/ctparse.h view on Meta::CPAN
#define macro_is_defined CTlib_macro_is_defined
int macro_is_defined(CParseInfo *pCPI, const char *name);
#define macro_get_def CTlib_macro_get_def
char *macro_get_def(CParseInfo *pCPI, const char *name, size_t *plen);
#define macro_free_def CTlib_macro_free_def
void macro_free_def(char *p);
#define macro_iterate_defs CTlib_macro_iterate_defs
void macro_iterate_defs(CParseInfo *pCPI, void (*func)(const CMacroInfo *),
void *arg, CMIFlags flags);
#endif
lib/Convert/Binary/C.pm view on Meta::CPAN
Information about defined macros can be retrieved from the
preprocessor as long as its configuration isn't changed. The
preprocessor is implicitly reset if you change one of the
following configuration options:
Include
Define
Assert
HasCPPComments
HasMacroVAARGS
=head2 Supported pragma directives
Convert::Binary::C supports the C<pack> pragma to locally override
struct member alignment. The supported syntax is as follows:
=over 4
=item #pragma pack( ALIGN )
lib/Convert/Binary/C.pm view on Meta::CPAN
'Include' => [
'/usr/include'
],
'EnumType' => 'Integer',
'EnumSize' => 4,
'ShortSize' => 2,
'IntSize' => 4,
'StdCVersion' => 199901,
'HostedC' => 1,
'Alignment' => 1,
'HasMacroVAARGS' => 1,
'KeywordMap' => {},
'Define' => [
'DEBUGGING',
'FOO=123'
],
'LongLongSize' => 8,
'CharSize' => 1,
'FloatSize' => 4,
'Bitfields' => {
'Engine' => 'Generic'
lib/Convert/Binary/C.pm view on Meta::CPAN
two = 2;
which will obviously be a syntax error, but without
C++ comments, it will be interpreted as
one = 4 / 4;
two = 2;
which is correct.
=item C<HasMacroVAARGS> =E<gt> 0 | 1
Use this option to turn the C<__VA_ARGS__> macro expansion
on or off. If this is enabled (which is the default), you can use
variable length argument lists in your preprocessor macros.
#define DEBUG( ... ) fprintf( stderr, __VA_ARGS__ )
There's normally no reason to turn that feature off.
=item C<StdCVersion> =E<gt> undef | INTEGER
lib/Convert/Binary/C.pm view on Meta::CPAN
#if 1
# define DEFINED
#else
# define UNDEFINED
#endif
ENDC
for my $macro (qw( ADD DEFINED UNDEFINED )) {
my $not = $c->defined($macro) ? '' : ' not';
print "Macro '$macro' is$not defined.\n";
}
would print:
Macro 'ADD' is defined.
Macro 'DEFINED' is defined.
Macro 'UNDEFINED' is not defined.
You have to keep in mind that this works only as long as the preprocessor
is not reset. See L<"Preprocessor configuration"> for details.
=back
=head2 pack
=over 8
tests/101_basic.t view on Meta::CPAN
struct ints MYINTS( a, b, c );
CCODE
#-----------------------
# try to parse the code
#-----------------------
eval {
$q->HasMacroVAARGS( 0 );
$q->parse( $c99_code );
};
ok($@ =~ /invalid macro argument/);
eval { $p->parse( $c99_code ) };
ok($@,'');
#------------------------
# reconfigure the parser
#------------------------
tests/201_config.t view on Meta::CPAN
{ in => 'String', result => SUCCEED },
{ in => 'Both', result => SUCCEED },
{ in => 'None', result => FAIL },
@refs
);
check_config_bool( $_ ) for qw( UnsignedBitfields
UnsignedChars
Warnings
HasCPPComments
HasMacroVAARGS );
check_option_strlist( $_ ) for qw( Include
Define
Assert
DisabledKeywords );
check_option_strlist_args( $_ ) for qw( Include
Define
Assert);
tests/201_config.t view on Meta::CPAN
'ShortSize' => 2,
'EnumType' => 'Integer',
'EnumSize' => 4,
'Include' => [ '/usr/include' ],
'DoubleSize' => 4,
'FloatSize' => 4,
'HasCPPComments' => 1,
'Alignment' => 1,
'CompoundAlignment' => 1,
'Define' => [ 'DEBUGGING', 'FOO=123' ],
'HasMacroVAARGS' => 1,
'LongSize' => 4,
'Warnings' => 0,
'ByteOrder' => 'LittleEndian',
'Assert' => [],
'IntSize' => 4,
'PointerSize' => 4,
'LongLongSize' => 8,
'LongDoubleSize' => 12,
'OrderMembers' => 0,
'Bitfields' => { Engine => 'Simple', BlockSize => 2 },
tests/201_config.t view on Meta::CPAN
'ShortSize' => 4,
'EnumType' => 'Both',
'EnumSize' => 0,
'Include' => [ '/usr/local/include', '/usr/include', '/include' ],
'DoubleSize' => 8,
'FloatSize' => 8,
'HasCPPComments' => 1,
'Alignment' => 2,
'CompoundAlignment' => 4,
'Define' => [ 'DEBUGGING', 'FOO=123', 'BAR=456' ],
'HasMacroVAARGS' => 1,
'LongSize' => 4,
'Warnings' => 1,
'ByteOrder' => 'BigEndian',
'Assert' => [],
'IntSize' => 4,
'PointerSize' => 2,
'LongLongSize' => 8,
'LongDoubleSize' => 12,
'OrderMembers' => 0,
'Bitfields' => { Engine => 'Simple', BlockSize => 4 },
tests/202_misc.t view on Meta::CPAN
struct ints MYINTS( a, b, c );
CCODE
#-----------------------
# try to parse the code
#-----------------------
eval {
$q->HasMacroVAARGS( 0 );
$q->parse( $c99_code );
};
ok($@,qr/invalid macro argument/);
eval { $p->parse( $c99_code ) };
ok($@,'');
#------------------------
# reconfigure the parser
#------------------------
tests/239_macros.t view on Meta::CPAN
my $src = $c->sourcify({ Defines => 1 });
my @srcdef = $src =~ /^#define\s+(.*)$/gm;
is(join(',', sort map { trim_macro($_) } @srcdef),
join(',', sort @def), 'sourcify');
my @cfg = (
{ does_reset => 1, config => [ HasCPPComments => 1 ] },
{ does_reset => 0, config => [ PointerSize => 2 ] },
{ does_reset => 1, config => [ HasMacroVAARGS => 1 ] },
{ does_reset => 0, config => [ Warnings => 1 ] },
{ does_reset => 1, config => [ Include => ['a'] ] },
{ does_reset => 1, config => [ Define => ['b'] ] },
{ does_reset => 1, config => [ Assert => ['a(b)'] ] },
);
$c->configure(HasCPPComments => 0,
PointerSize => 4,
HasMacroVAARGS => 0,
Warnings => 0,
Include => [],
Define => [],
Assert => []);
my $d = $c->clone;
for my $t (@cfg) {
$c->clean->parse("#define DEFINED\n");
ok($c->defined('DEFINED'), 'DEFINED defined');
tests/include/pdclib/functions/_dlmalloc/malloc.c view on Meta::CPAN
#else /* !INSECURE */
#define RTCHECK(e) (1)
#endif /* !INSECURE */
/* macros to set up inuse chunks with or without footers */
#if !FOOTERS
#define mark_inuse_foot(M,p,s)
/* Macros for setting head/foot of non-mmapped chunks */
/* Set cinuse bit and pinuse bit of next chunk */
#define set_inuse(M,p,s)\
((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
/* Set cinuse and pinuse of this chunk and pinuse of next chunk */
#define set_inuse_and_pinuse(M,p,s)\
((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
tests/include/pdclib/functions/stdlib/qsort.c view on Meta::CPAN
{
_PDCLIB_memswp( i, j, size );
}
/* For small sets, insertion sort is faster than quicksort.
T is the threshold below which insertion sort will be used.
Must be 3 or larger.
*/
#define T 7
/* Macros for handling the QSort stack */
#define PREPARE_STACK char * stack[STACKSIZE]; char ** stackptr = stack
#define PUSH( base, limit ) stackptr[0] = base; stackptr[1] = limit; stackptr += 2
#define POP( base, limit ) stackptr -= 2; base = stackptr[0]; limit = stackptr[1]
/* TODO: Stack usage is log2( nmemb ) (minus what T shaves off the worst case).
Worst-case nmemb is platform dependent and should probably be
configured through _PDCLIB_config.h.
*/
#define STACKSIZE 64
void qsort( void * base, size_t nmemb, size_t size, int ( *compar )( const void *, const void * ) )
tests/include/pdclib/functions/stdlib/qsort_s.c view on Meta::CPAN
{
_PDCLIB_memswp( i, j, size );
}
/* For small sets, insertion sort is faster than quicksort.
T is the threshold below which insertion sort will be used.
Must be 3 or larger.
*/
#define T 7
/* Macros for handling the QSort stack */
#define PREPARE_STACK char * stack[STACKSIZE]; char ** stackptr = stack
#define PUSH( base, limit ) stackptr[0] = base; stackptr[1] = limit; stackptr += 2
#define POP( base, limit ) stackptr -= 2; base = stackptr[0]; limit = stackptr[1]
/* TODO: Stack usage is log2( nmemb ) (minus what T shaves off the worst case).
Worst-case nmemb is platform dependent and should probably be
configured through _PDCLIB_config.h.
*/
#define STACKSIZE 64
errno_t qsort_s( void * base, rsize_t nmemb, rsize_t size, int ( *compar )( const void *, const void *, void * ), void * context )
tests/include/pdclib/include/inttypes.h view on Meta::CPAN
#define _PDCLIB_INTTYPES_H _PDCLIB_INTTYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
typedef struct _PDCLIB_imaxdiv_t imaxdiv_t;
/* 7.8.1 Macros for format specifiers */
/* The various leastN_t, fastN_t, intmax_t, and intptr_t types are typedefs
to native types. But the user does not know which ones, which gives some
problems when trying to *printf() / *scanf() those types. The various
macros defined below allow to give the correct conversion specifiers
without knowing the actual native type they represent.
*/
#define PRIdLEAST8 _PDCLIB_value2string( _PDCLIB_concat( _PDCLIB_INT_LEAST8_PREFIX, d ) )
#define PRIdLEAST16 _PDCLIB_value2string( _PDCLIB_concat( _PDCLIB_INT_LEAST16_PREFIX, d ) )
tests/include/pdclib/include/stdint.h view on Meta::CPAN
#define SIZE_MAX _PDCLIB_SIZE_MAX
#define WCHAR_MIN _PDCLIB_WCHAR_MIN
#define WCHAR_MAX _PDCLIB_WCHAR_MAX
#define WINT_MIN _PDCLIB_WINT_MIN
#define WINT_MAX _PDCLIB_WINT_MAX
#endif
/* 7.18.4 Macros for integer constants */
#if defined( __cplusplus ) && __cplusplus < 201103L
#ifndef __STDC_CONSTANT_MACROS
#define _PDCLIB_NO_CONSTANT_MACROS
#endif
#endif
#ifndef _PDCLIB_NO_CONSTANT_MACROS
/* 7.18.4.1 Macros for minimum-width integer constants */
/* Expand to an integer constant of specified value and type int_leastN_t */
#define INT8_C _PDCLIB_INT_LEAST8_C
#define INT16_C _PDCLIB_INT_LEAST16_C
#define INT32_C _PDCLIB_INT_LEAST32_C
#define INT64_C _PDCLIB_INT_LEAST64_C
/* Expand to an integer constant of specified value and type uint_leastN_t */
#define UINT8_C _PDCLIB_INT_LEAST8_C
#define UINT16_C _PDCLIB_INT_LEAST16_C
#define UINT32_C _PDCLIB_INT_LEAST32_C
#define UINT64_C _PDCLIB_INT_LEAST64_C
/* 7.18.4.2 Macros for greatest-width integer constants */
/* Expand to an integer constant of specified value and type intmax_t */
#define INTMAX_C( value ) _PDCLIB_INTMAX_C( value )
/* Expand to an integer constant of specified value and type uintmax_t */
#define UINTMAX_C( value ) _PDCLIB_UINTMAX_C( value )
#endif
/* Annex K -- Bounds-checking interfaces */
tests/include/pdclib/include/stdlib.h view on Meta::CPAN
/* Return quotient (quot) and remainder (rem) of an integer division in one of
the structs above.
*/
_PDCLIB_PUBLIC div_t div( int numer, int denom );
_PDCLIB_PUBLIC ldiv_t ldiv( long int numer, long int denom );
_PDCLIB_PUBLIC lldiv_t lldiv( long long int numer, long long int denom );
/* TODO: Multibyte / wide character conversion functions */
/* TODO: Macro MB_CUR_MAX */
/*
_PDCLIB_PUBLIC int mblen( const char * s, size_t n );
_PDCLIB_PUBLIC int mbtowc( wchar_t * _PDCLIB_restrict pwc, const char * _PDCLIB_restrict s, size_t n );
_PDCLIB_PUBLIC int wctomb( char * s, wchar_t wc );
_PDCLIB_PUBLIC size_t mbstowcs( wchar_t * _PDCLIB_restrict pwcs, const char * _PDCLIB_restrict s, size_t n );
_PDCLIB_PUBLIC size_t wcstombs( char * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict pwcs, size_t n );
*/
/* Annex K -- Bounds-checking interfaces */
token/config.pl view on Meta::CPAN
Alignment
CompoundAlignment
Include
Define
Assert
DisabledKeywords
KeywordMap
ByteOrder
EnumType
HasCPPComments
HasMacroVAARGS
OrderMembers
Bitfields
StdCVersion
HostedC
);
@sourcify = qw(
Context
Defines
);
token/t_config.c view on Meta::CPAN
OPTION_Alignment,
OPTION_CompoundAlignment,
OPTION_Include,
OPTION_Define,
OPTION_Assert,
OPTION_DisabledKeywords,
OPTION_KeywordMap,
OPTION_ByteOrder,
OPTION_EnumType,
OPTION_HasCPPComments,
OPTION_HasMacroVAARGS,
OPTION_OrderMembers,
OPTION_Bitfields,
OPTION_StdCVersion,
OPTION_HostedC,
INVALID_OPTION
} ConfigOption;
static ConfigOption get_config_option( const char *option )
{
switch (option[0])
token/t_config.c view on Meta::CPAN
option[5] == 'c' &&
option[6] == 'r' &&
option[7] == 'o' &&
option[8] == 'V' &&
option[9] == 'A' &&
option[10] == 'A' &&
option[11] == 'R' &&
option[12] == 'G' &&
option[13] == 'S' &&
option[14] == '\0')
{ /* HasMacroVAARGS */
return OPTION_HasMacroVAARGS;
}
goto unknown;
default:
goto unknown;
}
default:
goto unknown;
ucpp/ucpp.1 view on Meta::CPAN
.BI \-Ma
do the same as
.B \-M
but also for system files.
.TP
.BI "\-o " file
direct the ouput to
.I file
instead of standard output.
.TP
.B Macro Options
.TP
.BI \-D macro
predefine
.I macro
with content
.B 1.
.TP
.BI \-D macro=def
predefine
.I macro
ucpp/ucppi.h view on Meta::CPAN
#define UCPP__UCPPI__
#include "tune.h"
#include "cpp.h"
#include "nhash.h"
#include "reent.h"
/*
* A macro represented in a compact form; simple tokens are represented
* by one byte, containing their number. Tokens with a string value are
* followed by the value (string finished by a 0). Macro arguments are
* followed by the argument number (in one byte -- thus implying a hard
* limit of 254 arguments (number 255 is for __VA_ARGS__).
*/
struct comp_token_fifo {
size_t length;
size_t rp;
unsigned char *t;
};
/* These declarations are used only internally by ucpp */
util/memalloc.h view on Meta::CPAN
*
* \param size Size of new memory block in bytes.
*
* \return A pointer to the reallocated memory block, or NULL
* if memory couldn't be reallocated.
*/
void *ReAlloc( void *ptr, size_t size );
/**
* Fast Alloc Macro
*
* Allocates a memory block of \a size bytes. If the files
* were compiled with the #ABORT_IF_NO_MEM preprocessor flag,
* the function aborts if no memory can be allocated.
*
* \param cast Pointer cast.
*
* \param ptr Pointer to memory block.
*
* \param size Size of the memory block in bytes.
*/
#define AllocF( cast, ptr, size )
/**
* Fast CAlloc Macro
*
* Allocates a memory block to hold \a nobj times
* \a size bytes. If the files were compiled with the
* #ABORT_IF_NO_MEM preprocessor flag, the function
* aborts if no memory can be allocated.
*
* \param cast Pointer cast.
*
* \param ptr Pointer to memory block.
*
* \param nobj Number of objects.
*
* \param size Size of one object in bytes.
*/
#define CAllocF( cast, ptr, nobj, size )
/**
* Fast ReAlloc Macro
*
* Reallocates a memory block of \a size bytes. If the files
* were compiled with the #ABORT_IF_NO_MEM preprocessor flag,
* the function aborts if no memory can be allocated.
*
* \param cast Pointer cast.
*
* \param ptr Pointer to memory block.
*
* \param size Size of new memory block in bytes.