本文整理汇总了C++中TA_Free函数的典型用法代码示例。如果您正苦于以下问题:C++ TA_Free函数的具体用法?C++ TA_Free怎么用?C++ TA_Free使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TA_Free函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: freeFileIndexPriv
static TA_RetCode freeFileIndexPriv( void *toBeFreed )
{
TA_PROLOG;
TA_FileIndexPriv *asciiFileData;
TA_Libc *libHandle;
TA_StringCache *stringCache;
asciiFileData = (TA_FileIndexPriv *)toBeFreed;
libHandle = asciiFileData->libHandle;
TA_TRACE_BEGIN( libHandle, freeFileIndexPriv );
stringCache = TA_GetGlobalStringCache( libHandle );
if( !asciiFileData )
{
TA_TRACE_RETURN( TA_ALLOC_ERR );
}
if( freeListAndElement( libHandle, asciiFileData->listLocationToken, freeTokenInfo ) != TA_SUCCESS )
{
TA_TRACE_RETURN( TA_ALLOC_ERR );
}
if( freeListAndElement( libHandle, asciiFileData->listCategory, freeCategoryData ) != TA_SUCCESS )
{
TA_TRACE_RETURN( TA_ALLOC_ERR );
}
if( asciiFileData->root )
TA_FileIndexFreeValueTree( libHandle, asciiFileData->root );
if( asciiFileData->scratchPad )
TA_Free( libHandle, asciiFileData->scratchPad );
if( asciiFileData->wildOneChar )
TA_StringFree( stringCache, asciiFileData->wildOneChar );
if( asciiFileData->wildZeroOrMoreChar )
TA_StringFree( stringCache, asciiFileData->wildZeroOrMoreChar );
if( asciiFileData->wildOneOrMoreChar )
TA_StringFree( stringCache, asciiFileData->wildOneOrMoreChar );
if( asciiFileData->initialCategoryString )
TA_StringFree( stringCache, asciiFileData->initialCategoryString );
if( asciiFileData->initialCategoryCountryString )
TA_StringFree( stringCache, asciiFileData->initialCategoryCountryString );
if( asciiFileData->initialCategoryExchangeString )
TA_StringFree( stringCache, asciiFileData->initialCategoryExchangeString );
if( asciiFileData->initialCategoryTypeString )
TA_StringFree( stringCache, asciiFileData->initialCategoryTypeString );
TA_Free( libHandle, asciiFileData );
TA_TRACE_RETURN( TA_SUCCESS );
}
示例2: FUNCTION_CALL_STATE_FREE
/* Generated */ TA_LIB_API TA_RetCode TA_ACCBANDS_StateFree( struct TA_ACCBANDS_State** _state )
/* Generated */
/* Generated */ #endif
/**** END GENCODE SECTION 9 - DO NOT DELETE THIS LINE ****/
{
/* insert local variable here */
TA_RetCode retCode;
retCode = FUNCTION_CALL_STATE_FREE(SMA)( (struct TA_SMA_State**) &STATE_P.stateSMA1 );
if (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) return retCode;
retCode = FUNCTION_CALL_STATE_FREE(SMA)( (struct TA_SMA_State**) &STATE_P.stateSMA2 );
if (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) return retCode;
retCode = FUNCTION_CALL_STATE_FREE(SMA)( (struct TA_SMA_State**) &STATE_P.stateSMA3 );
if (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success)) return retCode;
/**** START GENCODE SECTION 10 - DO NOT DELETE THIS LINE ****/
/* Generated */
/* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK
/* Generated */
/* Generated */ if (_state == NULL)
/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
/* Generated */ if (STATE != NULL) {
/* Generated */ if (MEM_P != NULL) TA_Free(MEM_P);
/* Generated */ TA_Free(STATE); STATE = NULL;}
/* Generated */
/* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */
/* Generated */
/**** END GENCODE SECTION 10 - DO NOT DELETE THIS LINE ****/
/* insert state free code here. */
return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
}
示例3: TA_FuncTableFree
TA_RetCode TA_FuncTableFree( TA_StringTable *table )
{
TA_StringTableFuncHidden *stringTableHidden;
TA_Libc *libHandle;
if( table )
{
stringTableHidden = (TA_StringTableFuncHidden *)table->hiddenData;
if( !stringTableHidden )
return TA_INTERNAL_ERROR(3);
if( stringTableHidden->magicNb != TA_STRING_TABLE_FUNC_MAGIC_NB )
return TA_BAD_OBJECT;
libHandle = stringTableHidden->libHandle;
TA_Free( libHandle, stringTableHidden );
if( table->string )
TA_Free( libHandle, (void *)table->string );
TA_Free( libHandle, table );
}
return TA_SUCCESS;
}
示例4: TA_FuncTableFree
TA_RetCode TA_FuncTableFree( TA_StringTable *table )
{
TA_StringTablePriv *stringTablePriv;
if( table )
{
stringTablePriv = (TA_StringTablePriv *)table->hiddenData;
if( !stringTablePriv )
{
return TA_INTERNAL_ERROR(3);
}
if( stringTablePriv->magicNumber != TA_STRING_TABLE_FUNC_MAGIC_NB )
{
return TA_BAD_OBJECT;
}
if( table->string )
TA_Free( (void *)table->string );
TA_Free( table );
}
return TA_SUCCESS;
}
示例5: TA_FileIndexAddTokenInfo
TA_RetCode TA_FileIndexAddTokenInfo( TA_FileIndexPriv *data,
TA_TokenId id,
TA_String *value,
TA_TokenInfo *optBefore )
{
TA_PROLOG;
TA_RetCode retCode;
TA_TokenInfo *info;
TA_Libc *libHandle;
TA_StringCache *stringCache;
libHandle = data->libHandle;
TA_TRACE_BEGIN( libHandle, TA_FileIndexAddTokenInfo );
stringCache = TA_GetGlobalStringCache( libHandle );
info = TA_Malloc( libHandle, sizeof( TA_TokenInfo ) );
if( !info )
{
TA_TRACE_RETURN( TA_ALLOC_ERR );
}
info->id = id;
if( value == NULL )
info->value = NULL;
else
{
info->value = TA_StringDup( stringCache, value );
if( !info->value )
{
TA_Free( libHandle, info );
TA_TRACE_RETURN( TA_ALLOC_ERR );
}
}
if( optBefore )
retCode = TA_ListAddBefore( data->listLocationToken, optBefore, info );
else
retCode = TA_ListAddTail( data->listLocationToken, info );
if( retCode != TA_SUCCESS )
{
if( info->value )
TA_StringFree( stringCache, info->value );
TA_Free( libHandle, info );
TA_TRACE_RETURN( retCode );
}
TA_TRACE_RETURN( TA_SUCCESS );
}
示例6: freeSymbolData
static TA_RetCode freeSymbolData( TA_Libc *libHandle, void *toBeFreed )
{
TA_FileIndexSymbolData *symbolData;
TA_StringCache *stringCache;
stringCache = TA_GetGlobalStringCache( libHandle );
symbolData = (TA_FileIndexSymbolData *)toBeFreed;
if( !symbolData )
return TA_ALLOC_ERR;
/* Not yet im[plemented !!!
if( symbolData->dataPerDate )
{
if( freeListAndElement( symbolData->dataPerDate, freeDataPerDate ) != TA_SUCCESS )
return TA_ALLOC_ERR;
}
*/
if( symbolData->string )
TA_StringFree( stringCache, symbolData->string );
TA_Free( libHandle, symbolData );
return TA_SUCCESS;
}
示例7: TA_ReadOpInfoFree
TA_RetCode TA_ReadOpInfoFree( TA_ReadOpInfo *readOpInfoToBeFreed )
{
TA_Libc *libHandle;
if( readOpInfoToBeFreed )
{
libHandle = readOpInfoToBeFreed->libHandle;
if( readOpInfoToBeFreed->arrayReadOp )
TA_Free( libHandle, readOpInfoToBeFreed->arrayReadOp );
TA_Free( libHandle, readOpInfoToBeFreed );
}
return TA_SUCCESS;
}
示例8: TA_WebFetch
/* A little utility to fetch a web page and send the raw data
* to the provided FILE pointer. This ptr could be "stdout" to
* display on the console.
*
* Example:
* TA_WebFetch( "www.yahoo.com", stdout );
* or
* TA_WebFetch( "http://www.yahoo.com/mt", myFile );
*/
TA_RetCode TA_WebFetch( TA_Libc *libHandle, const char *url, FILE *out )
{
TA_RetCode retCode;
TA_WebPage *webPage;
const char *stringStart;
const char *webSitePage;
char *allocString;
unsigned int webSiteLength;
if( !url )
return TA_BAD_PARAM;
allocString = NULL;
/* Skip the http:// if specified. */
stringStart = url;
if( strncmp( url, "http://", 7 ) == 0 )
stringStart += 7;
/* Find if there is a specifc web page specified. */
webSitePage = strchr( stringStart, '/' );
if( webSitePage )
{
webSitePage++;
if( *webSitePage == '\0' )
{
webSitePage = NULL;
}
else
{
webSiteLength = webSitePage - stringStart - 1;
allocString = (char *)TA_Malloc( libHandle, webSiteLength+1 );
if( !allocString )
return TA_ALLOC_ERR;
strncpy( allocString, stringStart, webSiteLength );
allocString[webSiteLength] = '\0';
stringStart = allocString;
}
}
retCode = TA_WebPageAlloc( libHandle,
stringStart,
webSitePage,
NULL, NULL,
&webPage,
2 );
if( allocString )
TA_Free( libHandle, allocString );
if( retCode == TA_SUCCESS )
{
retCode = TA_StreamToFile( webPage->content, out );
TA_WebPageFree( webPage );
}
return retCode;
}
示例9: TA_DictFree
TA_RetCode TA_DictFree( TA_Dict *dict )
{
TA_PrivDictInfo *theDict;
dnode_t *node;
dnode_t *next;
TA_String *stringToDelete;
void *valueToDelete;
dict_t *kazlibDict;
TA_Libc *libHandle;
int flags;
theDict = (TA_PrivDictInfo *)dict;
if( theDict == NULL )
return TA_BAD_PARAM;
kazlibDict = &theDict->d;
libHandle = theDict->libHandle;
/* Delete all the key-value pair sequentially. */
node = dict_first( libHandle, kazlibDict );
while (node != NULL)
{
/* Get the next node. */
next = dict_next( libHandle, kazlibDict, node );
/* Free the 'node, the 'key' string and the 'value'. */
flags = theDict->flags;
valueToDelete = dnode_get(node);
if( flags & (TA_DICT_KEY_TWO_STRING|TA_DICT_KEY_ONE_STRING) )
{
stringToDelete = TA_StringFromChar(dnode_getkey(node));
dict_delete_free( libHandle, kazlibDict, node );
TA_StringFree( TA_GetGlobalStringCache( libHandle ), stringToDelete );
}
else
dict_delete_free( libHandle, kazlibDict, node );
if( flags & TA_DICT_KEY_TWO_STRING )
{
/* The value is a dictionary. Delete it. */
TA_DictFree( (TA_Dict *)valueToDelete );
}
else if( theDict->freeValueFunc )
theDict->freeValueFunc( libHandle, valueToDelete );
node = next;
}
/* Free the TA_PrivDictInfo */
TA_Free( libHandle, theDict );
return TA_SUCCESS;
}
示例10: TA_ParamHoldersFree
TA_RetCode TA_ParamHoldersFree( TA_ParamHolder *inputParamsToFree,
TA_ParamHolder *optInputParamsToFree,
TA_ParamHolder *outputParamsToFree )
{
TA_PROLOG;
TA_Libc *libHandle;
TA_ParamHolderPriv *input;
TA_ParamHolderPriv *optInput;
TA_ParamHolderPriv *output;
input = (TA_ParamHolderPriv *)inputParamsToFree;
optInput = (TA_ParamHolderPriv *)optInputParamsToFree;
output = (TA_ParamHolderPriv *)outputParamsToFree;
if( !input || !output )
return TA_BAD_PARAM;
if( (input->magicNumber != TA_PARAM_HOLDER_PRIV_MAGIC_NB) ||
(output->magicNumber != TA_PARAM_HOLDER_PRIV_MAGIC_NB) )
return TA_INVALID_PARAM_HOLDER;
libHandle = input->libHandle;
TA_TRACE_BEGIN( libHandle, TA_ParamHoldersFree );
if( optInput )
{
if( optInput->magicNumber != TA_PARAM_HOLDER_PRIV_MAGIC_NB )
{
TA_TRACE_RETURN( TA_INVALID_PARAM_HOLDER );
}
}
TA_Free( libHandle, input );
if( optInput )
TA_Free( libHandle, optInput );
TA_Free( libHandle, output );
TA_TRACE_RETURN( TA_SUCCESS );
}
示例11: TA_GroupTableFree
TA_RetCode TA_GroupTableFree( TA_StringTable *table )
{
TA_StringTableGroupHidden *stringTableHidden;
TA_Libc *libHandle;
if( table )
{
stringTableHidden = (TA_StringTableGroupHidden *)table->hiddenData;
if( !stringTableHidden )
return TA_INTERNAL_ERROR(1);
if( stringTableHidden->magicNb != TA_STRING_TABLE_GROUP_MAGIC_NB )
return TA_BAD_OBJECT;
libHandle = stringTableHidden->libHandle;
TA_Free( libHandle, stringTableHidden );
TA_Free( libHandle, table );
}
return TA_SUCCESS;
}
示例12: freeTokenInfo
static TA_RetCode freeTokenInfo( TA_Libc *libHandle, void *toBeFreed )
{
TA_TokenInfo *info;
TA_StringCache *stringCache;
stringCache = TA_GetGlobalStringCache( libHandle );
info = (TA_TokenInfo *)toBeFreed;
if( !info )
return TA_ALLOC_ERR;
if( info->value )
TA_StringFree( stringCache, info->value );
TA_Free( libHandle, info );
return TA_SUCCESS;
}