本文整理汇总了C++中StringFree函数的典型用法代码示例。如果您正苦于以下问题:C++ StringFree函数的具体用法?C++ StringFree怎么用?C++ StringFree使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了StringFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _device_info
static void _device_info( string_t p,const char * device )
{
char * path ;
if( device == NULL ){
StringMultipleAppend( p,"\n device: \t","Nil","\n loop: \t","Nil",NULL ) ;
}else if( StringPrefixEqual( device,"/dev/loop" ) ){
path = zuluCryptLoopDeviceAddress_1( device ) ;
if( path != NULL ){
StringMultipleAppend( p,"\n device: \t",device,"\n loop: \t",path,NULL ) ;
StringFree( path ) ;
}else{
StringMultipleAppend( p,"\n device: \t",device,"\n loop: \tNil",NULL ) ;
}
}else{
/*
* zuluCryptResolvePath() is defined in resolve_path.c
*/
path = zuluCryptResolvePath( device ) ;
StringMultipleAppend( p,"\n device: \t",path,"\n loop: \tNil",NULL ) ;
StringFree( path ) ;
}
}
示例2: NewsArticleFree
static void NewsArticleFree(void *elem)
{
rssNewsArticle *article = elem;
StringFree(&article->title);
StringFree(&article->server);
StringFree(&article->fullURL);
}
示例3: zuluCryptGetALoopDeviceAssociatedWithAnImageFile
char * zuluCryptGetALoopDeviceAssociatedWithAnImageFile( const char * path )
{
int i ;
string_t st = String( "" ) ;
const char * e ;
char * f ;
for( i = 0 ; i < 255 ; i++ ){
StringReplace( st,"/dev/loop" ) ;
e = StringAppendInt( st,i ) ;
f = zuluCryptLoopDeviceAddress_1( e ) ;
if( StringsAreEqual( path,f ) ){
StringFree( f ) ;
return StringDeleteHandle( &st ) ;
}else{
StringFree( f ) ;
}
}
StringDelete( &st ) ;
return NULL ;
}
示例4: ArticleFree
static void ArticleFree(void *vp)
{
article *a = vp;
StringFree(&a->url);
StringFree(&a->title);
StringFree(&a->server);
}
示例5: ThreadDataFree
static void ThreadDataFree(void *elem){
threadData* data = elem;
pthread_join(data->threadID,NULL);
threadArguments* arg =data->arg;
StringFree(&arg->title);
StringFree(&arg->URL);
free(data->arg);
}
示例6: zuluCryptUnmountVolume
int zuluCryptUnmountVolume( const char * device,char ** m_point )
{
char * m ;
int h = 3 ;
char * loop_path = NULL ;
if( StringPrefixMatch( device,"/dev/loop",9 ) ){
/*
* zuluCryptLoopDeviceAddress() is defined in ./create_loop_device.c
*/
loop_path = zuluCryptLoopDeviceAddress( device ) ;
if( loop_path != NULL ){
device = loop_path ;
}
}
/*
* zuluCryptGetMountPointFromPath() is defined in ./process_mountinfo.c
*/
m = zuluCryptGetMountPointFromPath( device ) ;
if( m != NULL ){
h = _unmount_volume( m ) ;
if( h == 0 ){
/*
*zuluCryptMtabIsAtEtc() is defined in ./mount_volume.c
*/
if( zuluCryptMtabIsAtEtc() ){
h = zuluCrypRemoveEntryFromMtab( m ) ;
}
if( m_point != NULL ){
*m_point = m ;
}else{
StringFree( m ) ;
}
}else{
StringFree( m ) ;
}
}
if( h != 0 && h != 3 && h != 4 ){
h = 2 ;
}
StringFree( loop_path ) ;
return h ;
}
示例7: StringCreate
boolean ScaleObj::SetName(char *name)
{
XmString xm_string = StringCreate(name);
XtVaSetValues(_w, XmNtitleString, xm_string, NULL);
StringFree(xm_string);
return true;
}
示例8: _eval_path
static stringList_t _eval_path( string_t path,stringList_t stl_1 )
{
string_t st ;
const char * e ;
char * ac ;
if( StringStartsWith( path,"/" ) ){
/*
* zuluCryptResolvePath_1() is defined in resolve_paths.c
*/
st = zuluCryptResolvePath_1( StringContent( path ) ) ;
if( st != StringVoid ){
stl_1 = StringListAppendString_1( stl_1,&st ) ;
}
}else if( StringStartsWith( path,"UUID=" ) ){
/*
* check above did not find '/' character and we are in this block assuming the line uses UUID
*/
e = StringRemoveString( path,"\"" ) ;
/*
* zuluCryptEvaluateDeviceTags() is defined in path_access.c
*/
ac = zuluCryptEvaluateDeviceTags( "UUID",e + 5 ) ;
if( ac != NULL ){
stl_1 = StringListAppend( stl_1,ac ) ;
StringFree( ac ) ;
}
}
return stl_1 ;
}
示例9: _zuluCryptAddMDRAIDVolumes
static stringList_t _zuluCryptAddMDRAIDVolumes( stringList_t stl )
{
DIR * dir = opendir( "/dev/md/" ) ;
struct dirent * entry ;
char * e ;
const char * f ;
string_t st ;
if( dir != NULL ){
while( ( entry = readdir( dir ) ) != NULL ){
f = entry->d_name ;
if( !StringAtLeastOneMatch_1( f,".","..","md-device-map",NULL ) ){
st = String( "/dev/md/" ) ;
e = zuluCryptRealPath( StringAppend( st,f ) ) ;
if( e != NULL ){
StringListRemoveString( stl,e ) ;
StringFree( e ) ;
}
stl = StringListAppendString_1( stl,&st ) ;
}
}
closedir( dir ) ;
}
return stl ;
}
示例10: _print_list
static void _print_list( stringList_t stl )
{
const char * e ;
char * z ;
StringListIterator it ;
StringListIterator end ;
StringListGetIterators( stl,&it,&end ) ;
while( it != end ){
e = StringContent( *it ) ;
it++ ;
if( StringPrefixEqual( e,"/dev/loop" ) ){
/*
* zuluCryptLoopDeviceAddress_1() is defined in ../lib/create_loop_device.c
*/
z = zuluCryptLoopDeviceAddress_1( e ) ;
if( z != NULL ){
puts( z ) ;
StringFree( z ) ;
}else{
puts( e ) ;
}
}else{
puts( e ) ;
}
}
}
示例11: _zuluCryptExECheckEmptySlots
static int _zuluCryptExECheckEmptySlots( const char * device )
{
int status = 0 ;
char * c ;
char * d ;
zuluCryptSecurityGainElevatedPrivileges() ;
c = zuluCryptEmptySlots( device ) ;
zuluCryptSecurityDropElevatedPrivileges() ;
if( c == NULL ){
return 1 ;
}
d = c - 1 ;
while( *++d ){
if( *d == '3' ){
status = 3 ;
break ;
}
}
StringFree( c ) ;
return status ;
}
示例12: zuluCryptVolumeStatus
char * zuluCryptVolumeStatus( const char * mapper )
{
char * path ;
string_t p ;
if( zuluCryptTrueCryptOrVeraCryptVolume( mapper ) ){
p = _get_crypto_info_from_tcplay( mapper ) ;
}else{
p = _get_crypto_info_from_cryptsetup( mapper ) ;
}
if( p == StringVoid ){
return NULL ;
}else{
/*
* zuluCryptGetMountPointFromPath() is defined in ./process_mountinfo.c
*/
path = zuluCryptGetMountPointFromPath( mapper ) ;
if( path != NULL ){
zuluCryptFileSystemProperties( p,mapper,path ) ;
StringFree( path ) ;
}
return StringDeleteHandle( &p ) ;
}
}
示例13: zuluCryptEXEVolumeInfo
int zuluCryptEXEVolumeInfo( const char * mapper,const char * device,uid_t uid )
{
char * output ;
int xt ;
/*
* ZULUCRYPTlongMapperPath is set in ../constants.h
* zuluCryptCreateMapperName() is defined at ../lib/create_mapper_name.c
*/
string_t p = zuluCryptCreateMapperName( device,mapper,uid,ZULUCRYPTlongMapperPath ) ;
zuluCryptSecurityGainElevatedPrivileges() ;
/*
*zuluCryptVolumeStatus() is defined in ../lib/status.c
*/
output = zuluCryptVolumeStatus( StringContent( p ) ) ;
zuluCryptSecurityDropElevatedPrivileges() ;
if( output != NULL ){
printf( "%s\n",output ) ;
StringFree( output ) ;
xt = 0 ;
}else{
printf( gettext( "ERROR: Could not get volume properties,volume is not open or was opened by a different user\n" ) ) ;
xt = 2 ;
}
StringDelete( &p ) ;
return xt ;
}
示例14: zuluCryptLoopDeviceAddress_1
char * zuluCryptLoopDeviceAddress_1( const char * device )
{
int fd ;
char * path ;
struct loop_info64 l_info ;
string_t st = String_1( "/sys/block/",device + 5,"/loop/backing_file",NULL ) ;
string_t xt = _StringGetFromVirtualFile( &st ) ;
if( xt == StringVoid ){
memset( &l_info,'\0',sizeof( struct loop_info64 ) ) ;
fd = open( device,O_RDONLY ) ;
ioctl( fd,LOOP_GET_STATUS64,&l_info ) ;
path = zuluCryptRealPath( ( char * ) l_info.lo_file_name ) ;
close( fd ) ;
st = String( path ) ;
StringFree( path ) ;
_clean_loop_path( st ) ;
return StringDeleteHandle( &st ) ; ;
}else{
_clean_loop_path( xt ) ;
return StringDeleteHandle( &xt ) ;
}
}
示例15: XtRemoveEventHandler
void Container::DoEndUpdate()
{
XtRemoveEventHandler(XtParent(_workArea), ExposureMask, FALSE,
&Container::UpdateAreaMessage, (XtPointer) this);
StringFree(_xm_update_message);
if (XtIsRealized(_workArea))
XClearArea(display, XtWindow(XtParent(_workArea)), 0, 0, 0, 0, TRUE);
_xm_update_message = NULL;
if (_container_type == SCROLLED_WORK_AREA ||
_container_type == WORK_AREA ||
_container_type == SCROLLED_ICON_LIST ||
_container_type == ICON_LIST)
{
if (XtIsRealized(_workArea))
XtMapWidget(_workArea);
GuiWorkAreaEnableRedisplay(_workArea);
XmDropSiteEndUpdate(XtParent(_workArea));
}
else
{
XtManageChild(_workArea);
if (_container_type == SCROLLED_HORIZONTAL_ROW_COLUMN)
XtAppAddTimeOut(appContext, 500, ResizeTimeOut, this);
}
}