CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
vfsobj.h
Go to the documentation of this file.
1
6
7#pragma once
8// This header file is auto-generated!
9// Do not make changes to this file or they will be overwritten.
10// clang-format off
11#include <cx/obj.h>
12#include <cx/thread/rwlock.h>
13
14typedef struct VFSDir VFSDir;
15typedef struct VFS VFS;
16typedef struct VFS_WeakRef VFS_WeakRef;
17typedef struct VFSMount VFSMount;
18typedef struct VFSMount_WeakRef VFSMount_WeakRef;
20saDeclarePtr(VFS_WeakRef);
21saDeclarePtr(VFSMount);
22saDeclarePtr(VFSMount_WeakRef);
23
25typedef struct VFS {
26 union {
27 ObjIface* _;
28 void* _is_VFS;
29 void* _is_ObjInst;
30 };
31 ObjClassInfo* _clsinfo;
32 atomic(uintptr) _ref;
33 atomic(ptr) _weakref;
34
35 VFSDir* root;
36 hashtable namespaces;
37 string curdir;
42 uint32 flags;
43} VFS;
44extern ObjClassInfo VFS_clsinfo;
45#define VFS(inst) ((VFS*)(unused_noeval((inst) && &((inst)->_is_VFS)), (inst)))
46#define VFSNone ((VFS*)NULL)
47
48typedef struct VFS_WeakRef {
49 union {
50 ObjInst* _inst;
51 void* _is_VFS_WeakRef;
52 void* _is_ObjInst_WeakRef;
53 };
54 atomic(uintptr) _ref;
55 RWLock _lock;
56} VFS_WeakRef;
57#define VFS_WeakRef(inst) ((VFS_WeakRef*)(unused_noeval((inst) && &((inst)->_is_VFS_WeakRef)), (inst)))
58
59_objfactory_guaranteed VFS* VFS_create(uint32 flags);
77#define vfsCreate(flags) VFS_create(flags)
78
79_objfactory_check VFS* VFS_createFromFS();
106#define vfsCreateFromFS() VFS_createFromFS()
107
108
109typedef struct VFSMount {
110 union {
111 ObjIface* _;
112 void* _is_VFSMount;
113 void* _is_ObjInst;
114 };
115 ObjClassInfo* _clsinfo;
116 atomic(uintptr) _ref;
117 atomic(ptr) _weakref;
118
119 ObjInst* provider;
120 uint32 flags;
121} VFSMount;
122extern ObjClassInfo VFSMount_clsinfo;
123#define VFSMount(inst) ((VFSMount*)(unused_noeval((inst) && &((inst)->_is_VFSMount)), (inst)))
124#define VFSMountNone ((VFSMount*)NULL)
125
126typedef struct VFSMount_WeakRef {
127 union {
128 ObjInst* _inst;
129 void* _is_VFSMount_WeakRef;
130 void* _is_ObjInst_WeakRef;
131 };
132 atomic(uintptr) _ref;
133 RWLock _lock;
134} VFSMount_WeakRef;
135#define VFSMount_WeakRef(inst) ((VFSMount_WeakRef*)(unused_noeval((inst) && &((inst)->_is_VFSMount_WeakRef)), (inst)))
136
137_objfactory_guaranteed VFSMount* VFSMount_create(ObjInst* provider, uint32 flags);
138// VFSMount* vfsmountCreate(ObjInst* provider, uint32 flags);
139#define vfsmountCreate(provider, flags) VFSMount_create(ObjInst(provider), flags)
140
141
#define saDeclarePtr(name)
Definition sarray.h:98
#define _objfactory_check
Definition objimpl.h:110
#define _objfactory_guaranteed
Definition objimpl.h:104
CX Object System - Object-oriented programming in C.
Reader-writer lock synchronization primitive.
VFS Object.
Definition vfsobj.h:25
RWLock vfslock
Definition vfsobj.h:38
VFSDir * root
Root for namespaceless paths.
Definition vfsobj.h:35
string curdir
Current working directory of the VFS.
Definition vfsobj.h:37
hashtable namespaces
Hashtable of string/VFSDir.
Definition vfsobj.h:36
RWLock vfsdlock
Definition vfsobj.h:41