Cthulhu  0.2.10
Cthulhu compiler collection
common.h File Reference
#include "fs/fs.h"
#include <stddef.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fs_inode_t
 
struct  fs_iter_t
 
struct  inode_result_t
 
struct  fs_callbacks_t
 
struct  fs_t
 

Typedefs

typedef fs_inode_t *(* fs_query_node_t) (fs_t *fs, const fs_inode_t *node, const char *name)
 
typedef io_t *(* fs_query_file_t) (fs_t *fs, fs_inode_t *node, os_access_t flags)
 
typedef inode_result_t(* fs_file_create_t) (fs_t *fs, fs_inode_t *node, const char *name)
 
typedef os_error_t(* fs_file_delete_t) (fs_t *fs, fs_inode_t *node, const char *name)
 
typedef inode_result_t(* fs_dir_create_t) (fs_t *fs, fs_inode_t *node, const char *name)
 
typedef os_error_t(* fs_dir_delete_t) (fs_t *fs, fs_inode_t *node, const char *name)
 
typedef os_error_t(* fs_iter_begin_t) (fs_t *fs, const fs_inode_t *dir, fs_iter_t *iter)
 
typedef os_error_t(* fs_iter_next_t) (fs_iter_t *iter)
 
typedef os_error_t(* fs_iter_end_t) (fs_iter_t *iter)
 
typedef void(* fs_delete_t) (fs_t *fs)
 fs callback to delete the fs More...
 

Functions

CT_LOCAL fs_inode_tinode_file (fs_t *fs, const char *name, const void *data)
 
CT_LOCAL fs_inode_tinode_dir (fs_t *fs, const char *name, const void *data)
 
CT_LOCAL fs_inode_tinode_new (fs_t *fs, os_dirent_t type, const char *name, const void *data)
 
CT_LOCAL void * inode_data (fs_inode_t *inode)
 
CT_LOCAL CT_CONSTFN bool inode_is (const fs_inode_t *inode, os_dirent_t type)
 
CT_LOCAL CT_CONSTFN const char * inode_name (const fs_inode_t *inode)
 
CT_LOCAL void * iter_data (fs_iter_t *iter)
 
CT_LOCAL os_error_t mkdir_recursive (const char *path, arena_t *arena)
 
CT_LOCAL fs_tfs_new (void *root, const fs_callbacks_t *cb, const void *data, size_t size, arena_t *arena)
 
CT_LOCAL void * fs_data (fs_t *fs)
 

Variables

CT_LOCAL fs_inode_t gInvalidFileNode
 

Typedef Documentation

◆ fs_delete_t

typedef void(* fs_delete_t) (fs_t *fs)

fs callback to delete the fs

Parameters
fsthe fs to delete

Definition at line 49 of file common.h.

◆ fs_dir_create_t

typedef inode_result_t(* fs_dir_create_t) (fs_t *fs, fs_inode_t *node, const char *name)

Definition at line 39 of file common.h.

◆ fs_dir_delete_t

typedef os_error_t(* fs_dir_delete_t) (fs_t *fs, fs_inode_t *node, const char *name)

Definition at line 40 of file common.h.

◆ fs_file_create_t

typedef inode_result_t(* fs_file_create_t) (fs_t *fs, fs_inode_t *node, const char *name)

Definition at line 36 of file common.h.

◆ fs_file_delete_t

typedef os_error_t(* fs_file_delete_t) (fs_t *fs, fs_inode_t *node, const char *name)

Definition at line 37 of file common.h.

◆ fs_iter_begin_t

typedef os_error_t(* fs_iter_begin_t) (fs_t *fs, const fs_inode_t *dir, fs_iter_t *iter)

Definition at line 42 of file common.h.

◆ fs_iter_end_t

typedef os_error_t(* fs_iter_end_t) (fs_iter_t *iter)

Definition at line 44 of file common.h.

◆ fs_iter_next_t

typedef os_error_t(* fs_iter_next_t) (fs_iter_t *iter)

Definition at line 43 of file common.h.

◆ fs_query_file_t

typedef io_t*(* fs_query_file_t) (fs_t *fs, fs_inode_t *node, os_access_t flags)

Definition at line 34 of file common.h.

◆ fs_query_node_t

typedef fs_inode_t*(* fs_query_node_t) (fs_t *fs, const fs_inode_t *node, const char *name)

Definition at line 33 of file common.h.

Function Documentation

◆ fs_data()

CT_LOCAL void* fs_data ( fs_t fs)

Definition at line 108 of file common.c.

◆ fs_new()

CT_LOCAL fs_t* fs_new ( void *  root,
const fs_callbacks_t cb,
const void *  data,
size_t  size,
arena_t arena 
)

Definition at line 93 of file common.c.

◆ inode_data()

CT_LOCAL void* inode_data ( fs_inode_t inode)

Definition at line 41 of file common.c.

◆ inode_dir()

CT_LOCAL fs_inode_t* inode_dir ( fs_t fs,
const char *  name,
const void *  data 
)

Definition at line 36 of file common.c.

◆ inode_file()

CT_LOCAL fs_inode_t* inode_file ( fs_t fs,
const char *  name,
const void *  data 
)

Definition at line 31 of file common.c.

◆ inode_is()

CT_LOCAL CT_CONSTFN bool inode_is ( const fs_inode_t inode,
os_dirent_t  type 
)

Definition at line 55 of file common.c.

◆ inode_name()

CT_LOCAL CT_CONSTFN const char* inode_name ( const fs_inode_t inode)

Definition at line 63 of file common.c.

◆ inode_new()

CT_LOCAL fs_inode_t* inode_new ( fs_t fs,
os_dirent_t  type,
const char *  name,
const void *  data 
)

Definition at line 19 of file common.c.

◆ iter_data()

CT_LOCAL void* iter_data ( fs_iter_t iter)

Definition at line 48 of file common.c.

◆ mkdir_recursive()

CT_LOCAL os_error_t mkdir_recursive ( const char *  path,
arena_t arena 
)

Definition at line 72 of file common.c.

Variable Documentation

◆ gInvalidFileNode

CT_LOCAL fs_inode_t gInvalidFileNode
extern

Definition at line 15 of file common.c.