Rename project from TinyDFS to MouseFS
- Renamed TinyDFS.h to MouseFS.h - Updated all type names: TinyDFS -> MouseFS, TinyDFS_Entity -> MouseFS_Entity, TinyDFS_Result -> MouseFS_Result - Updated all enum values: TINYDFS_RESULT_* -> MOUSEFS_RESULT_* - Updated all function names: tinydfs_* -> mousefs_* - Updated all variable names: tdfs -> mfs - Updated references in all source files, headers, examples, and documentation - Updated Makefile build targets: tinydfs_* -> mousefs_*
This commit is contained in:
+14
-14
@@ -1,39 +1,39 @@
|
||||
#include <stddef.h>
|
||||
#include <TinyDFS.h>
|
||||
#include <MouseFS.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
TinyDFS *tdfs = tinydfs_init("127.0.0.1", 8080);
|
||||
if (tdfs == NULL)
|
||||
MouseFS *mfs = mousefs_init("127.0.0.1", 8080);
|
||||
if (mfs == NULL)
|
||||
return -1;
|
||||
|
||||
if (tinydfs_submit_create(tdfs, "/my_file_1", -1, false, 1024) < 0) {
|
||||
tinydfs_free(tdfs);
|
||||
if (mousefs_submit_create(mfs, "/my_file_1", -1, false, 1024) < 0) {
|
||||
mousefs_free(mfs);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tinydfs_submit_create(tdfs, "/my_file_2", -1, false, 1024) < 0) {
|
||||
tinydfs_free(tdfs);
|
||||
if (mousefs_submit_create(mfs, "/my_file_2", -1, false, 1024) < 0) {
|
||||
mousefs_free(mfs);
|
||||
return -1;
|
||||
}
|
||||
|
||||
char buff_1[] = "This is file 1";
|
||||
if (tinydfs_submit_write(tdfs, "/my_file_1", -1, 0, buff_1, sizeof(buff_1)-1) < 0) {
|
||||
tinydfs_free(tdfs);
|
||||
if (mousefs_submit_write(mfs, "/my_file_1", -1, 0, buff_1, sizeof(buff_1)-1) < 0) {
|
||||
mousefs_free(mfs);
|
||||
return -1;
|
||||
}
|
||||
|
||||
char buff_2[] = "This is file 2";
|
||||
if (tinydfs_submit_write(tdfs, "/my_file_1", -1, 0, buff_2, sizeof(buff_2)-1) < 0) {
|
||||
tinydfs_free(tdfs);
|
||||
if (mousefs_submit_write(mfs, "/my_file_1", -1, 0, buff_2, sizeof(buff_2)-1) < 0) {
|
||||
mousefs_free(mfs);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
TinyDFS_Result result;
|
||||
tinydfs_wait(tdfs, -1, &result, -1);
|
||||
MouseFS_Result result;
|
||||
mousefs_wait(mfs, -1, &result, -1);
|
||||
}
|
||||
|
||||
tinydfs_free(tdfs);
|
||||
mousefs_free(mfs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user