Changeset ce683ed3 in mainline for uspace/app/bithenge/test.c


Ignore:
Timestamp:
2012-05-30T01:11:32Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4b16422
Parents:
1923501
Message:

bithenge: add blobs created from memory buffers

File:
1 edited

Legend:

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

    r1923501 rce683ed3  
    6363int main(int argc, char *argv[])
    6464{
     65        bithenge_blob_t *blob;
     66
    6567        service_id_t service_id;
    6668        loc_service_get_id("bd/initrd", &service_id, 0);
    67 
    68         bithenge_blob_t *blob;
    6969        bithenge_new_block_blob(&blob, service_id);
    7070        printf("Data from block:bd/initrd: ");
     71        print_blob(blob);
     72        bithenge_blob_destroy(blob);
     73
     74        const char data[] = "'Twas brillig, and the slithy toves";
     75        bithenge_new_blob_from_data(&blob, data, sizeof(data));
     76        printf("Data from memory (from_data): ");
     77        print_blob(blob);
     78        bithenge_blob_destroy(blob);
     79
     80        bithenge_new_blob_from_buffer(&blob, data, sizeof(data), false);
     81        printf("Data from memory (from_buffer): ");
    7182        print_blob(blob);
    7283        bithenge_blob_destroy(blob);
Note: See TracChangeset for help on using the changeset viewer.