C H A P T E R 3
Working with Records
dirStatus = dsGetRecordList( nodeRef, dataBuffer, &recNames, eDSExact, &recTypes, &attrTypes, false, &recCount, &context );
for ( i = 1; i <= recCount; i++ )
{
dirStatus | = dsGetRecordEntry( nodeRef, dataBuffer, | i, |
&attrListRef, &pRecEntry | ); |
|
for ( j = | 1; j <= | j++ ) |
{ |
|
|
dirStatus = dsGetAttributeEntry( nodeRef, dataBuffer, attrListRef, j, &valueRef, &pAttrEntry );
for ( k = 1; k <=
{
dirStatus = dsGetAttributeValue( nodeRef, dataBuffer, k, valueRef, &pValueEntry );
printf( "%s\t- %lu\n",
dirStatus = dsDeallocAttributeValueEntry( gDirRef,
pValueEntry );
pValueEntry = NULL;
//Deallocate pAttrEntry, pValueEntry, and pRecEntry
//by calling dsDeallocAttributeEntry,
//dsDeallocAttributeValueEntry, and
//dsDeallocRecordEntry, respectively.
}
dirStatus = dsCloseAttributeValueList( valueRef ); valueRef = NULL;
dirStatus = dsDeallocAttributeEntry( gDirRef, pAttrEntry); pAttrEntry = NULL;
}
dirStatus = dsCloseAttributeList( attrListRef ); attrListRef = NULL;
dirStatus = dsDeallocRecordEntry( gDirRef, pRecEntry ); pRecEntry = NULL;
}
}while (context != NULL); // Loop until all data has been obtained. // Call dsDataListDeallocate to deallocate recNames, recTypes, and // attrTypes.
// Deallocate dataBuffer by calling dsDataBufferDeAllocate. dsDataListDeallocate ( gDirRef, &recNames ); dsDataListDeallocate ( gDirRef, &recTypes ); dsDataListDeallocate ( gDirRef, &attrTypes ); dsDataBufferDeAllocate ( gDirRef, dataBuffer ); dataBuffer = NULL;
}
return dirStatus; } // GetRecordList
Getting Information About a Record’s Attribute
The sample code in Listing
Getting Information About a Record’s Attribute | 35 |