Rename project to ToastyFS

This commit is contained in:
2025-11-16 02:10:59 +01:00
parent a4a37b7a36
commit e1cdc28d4d
10 changed files with 436 additions and 436 deletions
-56
View File
@@ -1,56 +0,0 @@
#ifndef MOUSEFS_INCLUDED
#define MOUSEFS_INCLUDED
#include <stdint.h>
#include <stdbool.h>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <poll.h>
#endif
typedef struct MouseFS MouseFS;
typedef struct {
char name[128]; // TODO: Implement a proper name length
bool is_dir;
} MouseFS_Entity;
typedef enum {
MOUSEFS_RESULT_EMPTY,
MOUSEFS_RESULT_CREATE_ERROR,
MOUSEFS_RESULT_CREATE_SUCCESS,
MOUSEFS_RESULT_DELETE_ERROR,
MOUSEFS_RESULT_DELETE_SUCCESS,
MOUSEFS_RESULT_LIST_ERROR,
MOUSEFS_RESULT_LIST_SUCCESS,
MOUSEFS_RESULT_READ_ERROR,
MOUSEFS_RESULT_READ_SUCCESS,
MOUSEFS_RESULT_WRITE_ERROR,
MOUSEFS_RESULT_WRITE_SUCCESS,
} MouseFS_ResultType;
typedef struct {
MouseFS_ResultType type;
int num_entities;
MouseFS_Entity *entities;
} MouseFS_Result;
MouseFS *mousefs_init(char *addr, uint16_t port);
void mousefs_free(MouseFS *mfs);
void mousefs_wait(MouseFS *mfs, int opidx, MouseFS_Result *result, int timeout);
bool mousefs_isdone(MouseFS *mfs, int opidx, MouseFS_Result *result);
int mousefs_process_events(MouseFS *mfs, void **contexts, struct pollfd *polled, int num_polled);
int mousefs_submit_create (MouseFS *mfs, char *path, int path_len, bool is_dir, unsigned int chunk_size);
int mousefs_submit_delete (MouseFS *mfs, char *path, int path_len);
int mousefs_submit_list (MouseFS *mfs, char *path, int path_len);
int mousefs_submit_read (MouseFS *mfs, char *path, int path_len, int off, void *dst, int len);
int mousefs_submit_write (MouseFS *mfs, char *path, int path_len, int off, void *src, int len);
void mousefs_result_free(MouseFS_Result *result);
#endif // MOUSEFS_INCLUDED
+56
View File
@@ -0,0 +1,56 @@
#ifndef TOASTYFS_INCLUDED
#define TOASTYFS_INCLUDED
#include <stdint.h>
#include <stdbool.h>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <poll.h>
#endif
typedef struct ToastyFS ToastyFS;
typedef struct {
char name[128]; // TODO: Implement a proper name length
bool is_dir;
} ToastyFS_Entity;
typedef enum {
TOASTYFS_RESULT_EMPTY,
TOASTYFS_RESULT_CREATE_ERROR,
TOASTYFS_RESULT_CREATE_SUCCESS,
TOASTYFS_RESULT_DELETE_ERROR,
TOASTYFS_RESULT_DELETE_SUCCESS,
TOASTYFS_RESULT_LIST_ERROR,
TOASTYFS_RESULT_LIST_SUCCESS,
TOASTYFS_RESULT_READ_ERROR,
TOASTYFS_RESULT_READ_SUCCESS,
TOASTYFS_RESULT_WRITE_ERROR,
TOASTYFS_RESULT_WRITE_SUCCESS,
} ToastyFS_ResultType;
typedef struct {
ToastyFS_ResultType type;
int num_entities;
ToastyFS_Entity *entities;
} ToastyFS_Result;
ToastyFS *toastyfs_init(char *addr, uint16_t port);
void toastyfs_free(ToastyFS *tfs);
void toastyfs_wait(ToastyFS *tfs, int opidx, ToastyFS_Result *result, int timeout);
bool toastyfs_isdone(ToastyFS *tfs, int opidx, ToastyFS_Result *result);
int toastyfs_process_events(ToastyFS *tfs, void **contexts, struct pollfd *polled, int num_polled);
int toastyfs_submit_create (ToastyFS *tfs, char *path, int path_len, bool is_dir, unsigned int chunk_size);
int toastyfs_submit_delete (ToastyFS *tfs, char *path, int path_len);
int toastyfs_submit_list (ToastyFS *tfs, char *path, int path_len);
int toastyfs_submit_read (ToastyFS *tfs, char *path, int path_len, int off, void *dst, int len);
int toastyfs_submit_write (ToastyFS *tfs, char *path, int path_len, int off, void *src, int len);
void toastyfs_result_free(ToastyFS_Result *result);
#endif // TOASTYFS_INCLUDED