C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

#pragma function C_GETPOOL (tal, alias("C^GETPOOL"))
short *pool_alloc ( short *my_pool, long size )
{
_cc_status c_code;
long blk_addr;
c_code = C_GETPOOL(my_pool, size, &blk_addr);
if (_status_eq(c_code))
return( (short *)blk_addr );
else
return( NULL );
}
4. This function prototype and FUNCTION pragma:
void segment_allocate (short, long, short *, short);
...
#pragma function segment_allocate (tal, alias
(SEGMENT_ALLOCATE_), variable)
is equivalent to this interface declaration:
_tal _variable short SEGMENT_ALLOCATE_ (short, long,
short *, short);
5. This declarations of external routines are written in both of the styles described in this section
for calling pTAL procedures:
void c_name (short *);
#pragma function c_name (tal, alias (tal^name))
/* function declaration...*/
_tal _variable _cc_status SEGMENT_DEALLOCATE_ (short, short);
_tal _variable _cc_status READ (short, short *, short,
short *, long);
_tal _extensible _cc_status READX (short, char *,
short, short *, long);
Considerations When Interfacing to pTAL
This subsection provides guidelines for writing programs composed of pTAL and native C or C++
modules. All the discussion that pertains to native C also pertains to native C++, unless otherwise
noted. The discussion assumes that you have a working knowledge of pTAL and C, and are familiar
with the contents of the:
pTAL Conversion Guide
pTAL Reference Manual
Using Identifiers
pTAL and C identifiers differ:
pTAL and C have independent sets of reserved keywords.
pTAL identifiers can include circumflexes (^); C identifiers cannot.
The C language is case-sensitive; the pTAL language is not case-sensitive.
To declare variable identifiers that satisfy both compilers:
Avoid using reserved keywords in either language as identifiers.
Specify pTAL identifiers without circumflexes.
Specify C identifiers in uppercase.
For C or C++, you can use the _alias attribute specifier to describe the name of an external
pTAL routine that does not have a valid C name.
Considerations When Interfacing to pTAL 125