Changeset 0ce0103 in mainline for uspace/app/bithenge/blob.c
- Timestamp:
- 2012-08-06T04:15:33Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f9c314a5
- Parents:
- c3437d9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/blob.c
rc3437d9 r0ce0103 55 55 assert(ops); 56 56 assert(ops->destroy); 57 assert(ops->read );57 assert(ops->read || ops->read_bits); 58 58 assert(ops->size); 59 59 … … 339 339 } 340 340 341 static int subblob_read_bits(bithenge_blob_t *base, aoff64_t offset, 342 char *buffer, aoff64_t *size, bool little_endian) 343 { 344 subblob_t *blob = blob_as_subblob(base); 345 if (blob->size_matters) { 346 if (offset > blob->size) 347 return EINVAL; 348 *size = min(*size, blob->size - offset); 349 } 350 offset += blob->offset; 351 return bithenge_blob_read_bits(blob->source, offset, buffer, size, 352 little_endian); 353 } 354 341 355 static void subblob_destroy(bithenge_blob_t *base) 342 356 { … … 349 363 .size = subblob_size, 350 364 .read = subblob_read, 365 .read_bits = subblob_read_bits, 351 366 .destroy = subblob_destroy, 352 367 };
Note:
See TracChangeset
for help on using the changeset viewer.