Changeset 743ce51 in mainline for uspace/app/bithenge/blob.h
- Timestamp:
- 2012-05-25T03:49:21Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1923501
- Parents:
- a54bd98
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/blob.h
ra54bd98 r743ce51 78 78 * @memberof bithenge_sequential_blob_t */ 79 79 typedef struct bithenge_sequential_blob_ops_t { 80 81 /** Get the total size of the blob. If the total size cannot be 82 * determined easily, this field may be null or return an error, 83 * forcing the entire blob to be read to determine its size. 84 * 85 * @memberof bithenge_blob_t 86 * @param blob The blob. 87 * @param[out] size Total size of the blob. 88 * @return EOK on success or an error code from errno.h. 89 */ 80 90 int (*size)(bithenge_sequential_blob_t *blob, aoff64_t *size); 91 92 /** Read the next part of the blob. If the requested data extends 93 * beyond the end of the blob, the data up until the end of the blob 94 * will be read. 95 * 96 * @param blob The blob. 97 * @param[out] buffer Buffer to read into. If an error occurs, the contents are 98 * undefined. 99 * @param[in,out] size Number of bytes to read; may be 0. If not enough 100 * data is left in the blob, the actual number of bytes read should be 101 * stored here. If an error occurs, the contents are undefined. 102 * @return EOK on success or an error code from errno.h. 103 */ 81 104 int (*read)(bithenge_sequential_blob_t *blob, char *buffer, 82 105 aoff64_t *size); 106 107 /** Destroy the blob. 108 * @param blob The blob. 109 * @return EOK on success or an error code from errno.h. */ 83 110 int (*destroy)(bithenge_sequential_blob_t *blob); 84 111 } bithenge_sequential_blob_ops_t; … … 91 118 * @return EOK on success or an error code from errno.h. 92 119 */ 93 static inline int bithenge_blob_size(bithenge_blob_t *blob, aoff64_t *size) { 120 static inline int bithenge_blob_size(bithenge_blob_t *blob, aoff64_t *size) 121 { 122 assert(blob); 123 assert(blob->ops); 94 124 return blob->ops->size(blob, size); 95 125 } … … 110 140 * @return EOK on success or an error code from errno.h. 111 141 */ 112 static inline int bithenge_blob_read(bithenge_blob_t *blob, aoff64_t offset, char *buffer, aoff64_t *size) { 142 static inline int bithenge_blob_read(bithenge_blob_t *blob, aoff64_t offset, 143 char *buffer, aoff64_t *size) 144 { 145 assert(blob); 146 assert(blob->ops); 113 147 return blob->ops->read(blob, offset, buffer, size); 114 148 } … … 119 153 * @return EOK on success or an error code from errno.h. 120 154 */ 121 static inline int bithenge_blob_destroy(bithenge_blob_t *blob) { 155 static inline int bithenge_blob_destroy(bithenge_blob_t *blob) 156 { 157 assert(blob); 158 assert(blob->ops); 122 159 return blob->ops->destroy(blob); 123 160 }
Note:
See TracChangeset
for help on using the changeset viewer.