Changeset 5c5c346a in mainline
- Timestamp:
- 2012-05-31T04:01:28Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50985c34
- Parents:
- 4b16422
- Location:
- uspace/app/bithenge
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/Makefile
r4b16422 r5c5c346a 35 35 blob.c \ 36 36 block.c \ 37 file.c \ 37 38 test.c 38 39 -
uspace/app/bithenge/block.c
r4b16422 r5c5c346a 112 112 aoff64_t size; 113 113 rc = block_get_bsize(service_id, &bsize); 114 if (rc != EOK) 114 if (rc != EOK) { 115 block_fini(service_id); 115 116 return rc; 117 } 116 118 rc = block_get_nblocks(service_id, &nblocks); 117 if (rc != EOK) 119 if (rc != EOK) { 120 block_fini(service_id); 118 121 return rc; 122 } 119 123 size = bsize * nblocks; 120 124 121 125 // Create blob 122 126 block_blob_t *blob = malloc(sizeof(*blob)); 123 if (!blob) 127 if (!blob) { 128 block_fini(service_id); 124 129 return ENOMEM; 130 } 125 131 rc = bithenge_new_random_access_blob(blob_from_block(blob), 126 132 &block_ops); 127 133 if (rc != EOK) { 128 134 free(blob); 135 block_fini(service_id); 129 136 return rc; 130 137 } -
uspace/app/bithenge/test.c
r4b16422 r5c5c346a 40 40 #include "blob.h" 41 41 #include "block.h" 42 #include "file.h" 42 43 43 44 static void … … 83 84 bithenge_blob_destroy(blob); 84 85 86 bithenge_new_file_blob(&blob, "/textdemo"); 87 printf("Data from file:/textdemo: "); 88 print_blob(blob); 89 bithenge_blob_destroy(blob); 90 85 91 return 0; 86 92 }
Note:
See TracChangeset
for help on using the changeset viewer.