Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 5c925ce in mainline for uspace/app/bithenge/blob.c


Ignore:
Timestamp:
2012-06-07T17:00:12Z (9 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master
Children:
8375d0eb
Parents:
5f679702
Message:

Bithenge: make blobs a type of node

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bithenge/blob.c

    r5f679702 r5c925ce  
    4242#include <stdlib.h>
    4343#include "blob.h"
     44#include "tree.h"
    4445
    4546/** Initialize a random access blob.
     
    5960        assert(ops->size);
    6061
    61         blob->ops = ops;
     62        blob->base.type = BITHENGE_NODE_BLOB;
     63        blob->base.blob_ops = ops;
    6264        return EOK;
    6365}
     
    234236 * @param len The length of the data.
    235237 * @return EOK on success or an error code from errno.h. */
    236 int bithenge_new_blob_from_data(bithenge_blob_t **out, const void *data,
     238int bithenge_new_blob_from_data(bithenge_node_t **out, const void *data,
    237239    size_t len)
    238240{
     
    258260        blob->size = len;
    259261        blob->needs_free = true;
    260         *out = blob_from_memory(blob);
     262        *out = bithenge_blob_as_node(blob_from_memory(blob));
    261263        return EOK;
    262264}
     
    273275 * blob is destroyed.
    274276 * @return EOK on success or an error code from errno.h. */
    275 int bithenge_new_blob_from_buffer(bithenge_blob_t **out, const void *buffer,
     277int bithenge_new_blob_from_buffer(bithenge_node_t **out, const void *buffer,
    276278    size_t len, bool needs_free)
    277279{
     
    291293        blob->size = len;
    292294        blob->needs_free = needs_free;
    293         *out = blob_from_memory(blob);
     295        *out = bithenge_blob_as_node(blob_from_memory(blob));
    294296        return EOK;
    295297}
Note: See TracChangeset for help on using the changeset viewer.