libplist  2.7.0
API Documentation - Return to Homepage

◆ plist_data_val_compare_with_size()

PLIST_API int plist_data_val_compare_with_size ( plist_t  datanode,
const uint8_t *  cmpval,
size_t  n 
)

Helper function to compare the data of a PLIST_DATA node against a given blob and size, while no more than n bytes are compared.

This function basically behaves like memcmp after making sure the size of the node's data value is at least n, making this a "starts with" comparison.

Parameters
datanodenode of type PLIST_DATA
cmpvaldata blob to compare against
nsize of data blob passed in cmpval
Returns
0 if the node's value and cmpval are equal, > 0 if the node's value is lexicographically greater than cmpval, or < 0 if the node's value is lexicographically less than cmpval.