Skip to content

Commit 07e5082

Browse files
authored
Add VFS C API (Geenz#8)
* Add EntropyCore VFS C API and example usage * Update CMakeLists.txt
1 parent 86ba6ed commit 07e5082

14 files changed

+3662
-0
lines changed

CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,28 @@ set(ENTROPY_C_API_HEADERS
137137
include/entropy/entropy_work_service.h
138138
)
139139

140+
# VFS C API sources and headers
141+
set(ENTROPY_VFS_C_API_SOURCES
142+
src/entropy/entropy_vfs_types_c.cpp
143+
src/entropy/entropy_virtual_file_system_c.cpp
144+
src/entropy/entropy_file_handle_c.cpp
145+
src/entropy/entropy_directory_handle_c.cpp
146+
src/entropy/entropy_file_operation_handle_c.cpp
147+
src/entropy/entropy_write_batch_c.cpp
148+
)
149+
150+
set(ENTROPY_VFS_C_API_HEADERS
151+
include/entropy/entropy_vfs_types.h
152+
include/entropy/entropy_virtual_file_system.h
153+
include/entropy/entropy_file_handle.h
154+
include/entropy/entropy_directory_handle.h
155+
include/entropy/entropy_file_operation_handle.h
156+
include/entropy/entropy_write_batch.h
157+
)
158+
140159
# Append to main lists
160+
list(APPEND ENTROPY_C_API_SOURCES ${ENTROPY_VFS_C_API_SOURCES})
161+
list(APPEND ENTROPY_C_API_HEADERS ${ENTROPY_VFS_C_API_HEADERS})
141162
list(APPEND ENTROPY_CORE_SOURCES ${ENTROPY_C_API_SOURCES})
142163
list(APPEND ENTROPY_CORE_HEADERS ${ENTROPY_C_API_HEADERS})
143164

@@ -211,6 +232,13 @@ set_property(TARGET ConcurrencyAPIExample PROPERTY LINKER_LANGUAGE CXX)
211232
# Link core
212233
target_link_libraries(ConcurrencyAPIExample PRIVATE EntropyCore)
213234

235+
# VFS C API example (pure C)
236+
add_executable(VFSCAPIExample Examples/VFSCAPIExample.c)
237+
# Ensure C++ linker is used (C target linking against C++ library)
238+
set_property(TARGET VFSCAPIExample PROPERTY LINKER_LANGUAGE CXX)
239+
# Link core
240+
target_link_libraries(VFSCAPIExample PRIVATE EntropyCore)
241+
214242
add_executable(VirtualFileSystemExample Examples/VirtualFileSystemExample.cpp)
215243
target_link_libraries(VirtualFileSystemExample PRIVATE EntropyCore)
216244
# Avoid Windows min/max macro pollution

0 commit comments

Comments
 (0)