Changeset 7c3fb9b in mainline for uspace/lib/bithenge/include/bithenge/blob.h
- Timestamp:
- 2018-05-17T08:29:01Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/bithenge/include/bithenge/blob.h
rfac0ac7 r7c3fb9b 43 43 44 44 /** A blob of raw binary data. 45 * @implements bithenge_node_t */ 45 * @implements bithenge_node_t 46 */ 46 47 typedef struct { 47 48 /** @privatesection */ … … 50 51 51 52 /** Operations providing random access to binary data. 52 * @todo Should these be thread-safe? */ 53 * @todo Should these be thread-safe? 54 */ 53 55 typedef struct bithenge_random_access_blob_ops_t { 54 56 /** @copydoc bithenge_blob_t::bithenge_blob_size */ … … 61 63 aoff64_t *size, bool little_endian); 62 64 /** Destroy the blob. 63 * @param blob The blob. */ 65 * @param blob The blob. 66 */ 64 67 void (*destroy)(bithenge_blob_t *self); 65 68 } bithenge_random_access_blob_ops_t; 66 69 67 70 /** A blob built from an object that supports only sequential reading. 68 * @implements bithenge_blob_t */ 71 * @implements bithenge_blob_t 72 */ 69 73 typedef struct { 70 74 /** @privatesection */ … … 82 86 83 87 /** Operations providing sequential access to binary data. 84 * @memberof bithenge_sequential_blob_t */ 88 * @memberof bithenge_sequential_blob_t 89 */ 85 90 typedef struct bithenge_sequential_blob_ops_t { 86 91 … … 112 117 113 118 /** Destroy the blob. 114 * @param self The blob. */ 119 * @param self The blob. 120 */ 115 121 void (*destroy)(bithenge_sequential_blob_t *self); 116 122 } bithenge_sequential_blob_ops_t; … … 189 195 * @param self The blob. 190 196 * @param[out] out Holds whether the blob is empty. 191 * @return EOK on success or an error code from errno.h. */ 197 * @return EOK on success or an error code from errno.h. 198 */ 192 199 static inline errno_t bithenge_blob_empty(bithenge_blob_t *self, bool *out) 193 200 { … … 203 210 * @memberof bithenge_blob_t 204 211 * @param blob The blob to cast. 205 * @return The blob node as a generic node. */ 212 * @return The blob node as a generic node. 213 */ 206 214 static inline bithenge_node_t *bithenge_blob_as_node(bithenge_blob_t *blob) 207 215 { … … 212 220 * @memberof bithenge_blob_t 213 221 * @param node The node to cast, which must be a blob node. 214 * @return The generic node as a blob node. */ 222 * @return The generic node as a blob node. 223 */ 215 224 static inline bithenge_blob_t *bithenge_node_as_blob(bithenge_node_t *node) 216 225 { … … 220 229 221 230 /** Increment a blob's reference count. 222 * @param blob The blob to reference. */ 231 * @param blob The blob to reference. 232 */ 223 233 static inline void bithenge_blob_inc_ref(bithenge_blob_t *blob) 224 234 { … … 227 237 228 238 /** Decrement a blob's reference count. 229 * @param blob The blob to dereference, or NULL. */ 239 * @param blob The blob to dereference, or NULL. 240 */ 230 241 static inline void bithenge_blob_dec_ref(bithenge_blob_t *blob) 231 242 {
Note:
See TracChangeset
for help on using the changeset viewer.