Interstage Application Server リファレンスマニュアル(API編)
目次 索引 前ページ次ページ

第1章 C言語インタフェース> 1.11 その他の関数

1.11.3 CORBA_xx_alloc()

名前

 CORBA_xx_alloc − データ型のメモリ領域の獲得

形式

 #include <orb.h>
 CORBA_short              *CORBA_short_alloc( ) ;
 CORBA_long               *CORBA_long_alloc( ) ;
 CORBA_unsigned_short     *CORBA_unsigned_short_alloc( ) ;
 CORBA_unsigned_long      *CORBA_unsigned_long_alloc( ) ;
 CORBA_long_long          *CORBA_long_long_alloc( ) ;
 CORBA_float              *CORBA_float_alloc( ) ;
 CORBA_double             *CORBA_double_alloc( ) ;
 CORBA_long_double        *CORBA_long_double_alloc( ) ;
 CORBA_char               *CORBA_char_alloc( ) ;
 CORBA_wchar              *CORBA_wchar_alloc( ) ;
 CORBA_boolean            *CORBA_boolean_alloc( ) ;
 CORBA_octet              *CORBA_octet_alloc( ) ;
 CORBA_enum               *CORBA_enum_alloc( ) ;
 CORBA_any                *CORBA_any_alloc( ) ;
 CORBA_string             CORBA_string_alloc( CORBA_unsigned_long len );
 CORBA_wstring            CORBA_wstring_alloc( CORBA_unsigned_long len );
 CORBA_string             *CORBA_string_ptr_alloc( ) ;
 CORBA_wstring            *CORBA_wstring_ptr_alloc( ) ;
 CORBA_Object             CORBA_Object_alloc( ) ;

機能説明

 CORBA_string_alloc()およびCORBA_wstring_alloc()は、lenで指定された文字数+1バイトの文字列領域を獲得し、文字列の先頭ポインタを返します。
 CORBA_string_ptr_alloc()およびCORBA_wstring_ptr_alloc()は、それぞれCORBA_stringとCORBA_wstringのポインタの格納領域を獲得し、そのアドレスを返します。
 それ以外のCORBA_xx_alloc()については、各データ型xxのサイズの領域を獲得して、そのアドレスを返します。

 ここで獲得した領域を解放する場合は、CORBA_free()を使用します。

復帰値

 正常終了した場合は、獲得した領域のアドレスが返されます。
 異常終了した場合は、NULLが返されます。

注意事項

 CORBA_ORB_init()を呼び出していない場合、常にNULLが返されます。


目次 索引 前ページ次ページ

All Rights Reserved, Copyright(C) 富士通株式会社 2005