28 #include <oc_filesystem_list.h> 34 #define IsDirSign(Char) ( (Char) == '/' || (Char) == '\\' ) 35 #define IsAbsolutePath(Path) ( IsDirSign((Path)[0]) ) 42 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 44 typedef struct _MountedEntry_t
51 typedef struct _OpenedFileEntry_t
59 MountedEntry_t MountedEntry;
61 } * OpenedFileEntry_t;
70 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ 77 #define _________________________________________LOCAL_PROTOTYPES_SECTION___________________________________________________________________ 79 static MountedEntry_t GetMountedFileSystem(
const char * Path ,
bool WithParentDirs );
80 static char * GetPwd(
void );
81 static uint32_t ConvertRelativeToAbsolute(
const char * Relative ,
char * outAbsolute , uint32_t AbsoluteSize ,
bool TreatAsDir );
82 static char * ConvertToAbsoluteWithAllocation(
const char * Relative ,
bool TreatAsDir );
83 static bool CheckIfDirExists(
const char * Absolute );
85 #undef _________________________________________LOCAL_PROTOTYPES_SECTION___________________________________________________________________ 93 #define _________________________________________VARIABLES_SECTION__________________________________________________________________________ 97 static oC_List(MountedEntry_t) MountedEntries = NULL;
98 static oC_List(OpenedFileEntry_t) OpenedFilesEntries = NULL;
100 .
Name =
"Virtual File System" 103 #undef _________________________________________VARIABLES_SECTION__________________________________________________________________________ 111 #define _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________ 116 oC_ErrorCode_t oC_VirtualFileSystem_TurnOn(
void )
118 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
120 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
false , oC_ErrorCode_ModuleIsTurnedOn))
122 FileSystemsList = oC_List_New(&
Allocator,AllocationFlags_CanWait1Second);
123 MountedEntries = oC_List_New(&
Allocator,AllocationFlags_CanWait1Second);
124 OpenedFilesEntries= oC_List_New(&
Allocator,AllocationFlags_CanWait1Second);
126 if(FileSystemsList && MountedEntries && OpenedFilesEntries)
129 errorCode = oC_ErrorCode_None;
131 #define ADD_FILE_SYSTEM(FileSystemName) oC_AssignErrorCode(&errorCode , oC_VirtualFileSystem_AddFileSystem(&FileSystemName)); 132 #define DONT_ADD(FileSystemName) 133 CFG_LIST_FILE_SYSTEMS(ADD_FILE_SYSTEM,DONT_ADD)
134 #undef ADD_FILE_SYSTEM 136 #define MOUNT(FileSystemName,MountPoint) \ 137 if(CheckIfDirExists(MountPoint)==false) { oC_AssignErrorCode(&errorCode , oC_VirtualFileSystem_mkdir(MountPoint)); }\ 138 oC_AssignErrorCode(&errorCode , oC_VirtualFileSystem_mount(FileSystemName,MountPoint)); 139 CFG_LIST_MOUNTED_FILE_SYSTEMS(MOUNT)
144 if(oC_List_IsCorrect(FileSystemsList) && !oC_List_Delete(FileSystemsList,AllocationFlags_CanWaitForever))
146 oC_SaveError(
"VFS: Cannot delete FileSystemsList" , oC_ErrorCode_ReleaseError);
148 if(oC_List_IsCorrect(MountedEntries) && !oC_List_Delete(MountedEntries,AllocationFlags_CanWaitForever))
150 oC_SaveError(
"VFS: Cannot delete MountedFileSystems" , oC_ErrorCode_ReleaseError);
152 if(oC_List_IsCorrect(OpenedFilesEntries) && !oC_List_Delete(OpenedFilesEntries,AllocationFlags_CanWaitForever))
154 oC_SaveError(
"VFS: Cannot delete OpenedFilesEntries" , oC_ErrorCode_ReleaseError);
157 errorCode = oC_ErrorCode_AllocationError;
167 oC_ErrorCode_t oC_VirtualFileSystem_TurnOff(
void )
169 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
171 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet))
175 oC_List_Foreach(MountedEntries,mountedFileSystem)
177 if(kfree(mountedFileSystem->MountedPoint,AllocationFlags_CanWaitForever)==
false)
179 errorCode = oC_ErrorCode_ReleaseError;
182 if(kfree(mountedFileSystem,AllocationFlags_CanWaitForever)==
false)
184 errorCode = oC_ErrorCode_ReleaseError;
188 oC_List_Foreach(OpenedFilesEntries,openedFileEntry)
190 if(kfree(openedFileEntry,AllocationFlags_CanWaitForever)==
false)
192 errorCode = oC_ErrorCode_ReleaseError;
196 bool fileSystemsListDeleted = oC_List_Delete(FileSystemsList,AllocationFlags_CanWaitForever);
197 bool mountedListDeleted = oC_List_Delete(MountedEntries,AllocationFlags_CanWaitForever);
198 bool openedDeleted = oC_List_Delete(OpenedFilesEntries,AllocationFlags_CanWaitForever);
201 if(fileSystemsListDeleted && mountedListDeleted && openedDeleted && allReleased)
203 errorCode = oC_ErrorCode_None;
207 errorCode = oC_ErrorCode_ReleaseError;
216 oC_ErrorCode_t oC_VirtualFileSystem_AddFileSystem(
oC_FileSystem_t FileSystem )
218 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
220 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet))
222 bool pushed = oC_List_PushBack(FileSystemsList,FileSystem,&
Allocator);
226 errorCode = oC_ErrorCode_None;
230 errorCode = oC_ErrorCode_CannotAddObjectToList;
239 oC_ErrorCode_t oC_VirtualFileSystem_RemoveFileSystem(
oC_FileSystem_t FileSystem )
241 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
243 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet))
245 bool removed = oC_List_RemoveAll(FileSystemsList,FileSystem);
249 errorCode = oC_ErrorCode_None;
253 errorCode = oC_ErrorCode_CannotRemoveObjectFromList;
263 oC_ErrorCode_t oC_VirtualFileSystem_mount(
const char * FileSystem ,
const char * Path )
265 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
268 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet) &&
269 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
270 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(FileSystem) , oC_ErrorCode_WrongAddress ) &&
271 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect) &&
272 oC_AssignErrorCodeIfFalse(&errorCode , Path[0] ==
'/' , oC_ErrorCode_PathNotCorrect) &&
273 oC_AssignErrorCodeIfFalse(&errorCode , Path[strlen(Path)-1] ==
'/' , oC_ErrorCode_PathNotCorrect)
277 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
279 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
281 MountedEntry_t mountedFileSystem = GetMountedFileSystem(absolute,
false);
282 MountedEntry_t mountedEntry = kmalloc(
sizeof(
struct _MountedEntry_t),&
Allocator,AllocationFlags_CanWait1Second);
283 bool dirExists = CheckIfDirExists(absolute);
285 oC_List_Foreach(FileSystemsList,fileSystem)
287 if(strcmp(FileSystem,fileSystem->Name) == 0)
289 fileSystemEntry = fileSystem;
295 oC_AssignErrorCodeIfFalse(&errorCode , fileSystemEntry !=
NULL , oC_ErrorCode_ObjectNotFoundOnList) &&
296 oC_AssignErrorCodeIfFalse(&errorCode , mountedFileSystem ==
NULL , oC_ErrorCode_PathAlreadyUsed) &&
297 oC_AssignErrorCodeIfFalse(&errorCode , dirExists , oC_ErrorCode_NoSuchFile) &&
298 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(fileSystemEntry->init) , oC_ErrorCode_FileSystemNotCorrect) &&
299 oC_AssignErrorCode( &errorCode , fileSystemEntry->init(&mountedEntry->Context)) &&
300 oC_AssignErrorCodeIfFalse(&errorCode , mountedEntry !=
NULL , oC_ErrorCode_AllocationError )
303 oC_UInt_t pathLength = strlen(absolute) + 1;
304 mountedEntry->FileSystem = fileSystemEntry;
305 mountedEntry->MountedPoint = kmalloc(pathLength ,&
Allocator , AllocationFlags_CanWait1Second);
307 if(oC_AssignErrorCodeIfFalse(&errorCode , mountedEntry->MountedPoint , oC_ErrorCode_AllocationError ))
310 oC_UInt_t pushIndex = 0;
312 strcpy(mountedEntry->MountedPoint,absolute);
314 oC_List_Foreach(MountedEntries,mountedEntryForeach)
316 if(strlen(mountedEntryForeach->MountedPoint) <= pathLength )
326 pushed = oC_List_InsertBefore(MountedEntries,mountedEntry,pushIndex,&
Allocator);
330 errorCode = oC_ErrorCode_None;
334 errorCode = oC_ErrorCode_CannotAddObjectToList;
339 if(oC_ErrorOccur(errorCode))
343 if(mountedEntry->MountedPoint && !kfree(mountedEntry->MountedPoint,AllocationFlags_CanWaitForever))
345 oC_SaveError(
"Cannot release mounted point",oC_ErrorCode_ReleaseError);
347 if(!kfree(mountedEntry,AllocationFlags_CanWaitForever))
349 oC_SaveError(
"Cannot release mounted entry",oC_ErrorCode_ReleaseError);
354 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
356 oC_SaveError(
"vfs-mount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
367 oC_ErrorCode_t oC_VirtualFileSystem_umount(
const char * Path )
369 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
372 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
373 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
374 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) > 1 , oC_ErrorCode_SizeNotCorrect) &&
375 oC_AssignErrorCodeIfFalse(&errorCode , Path[0] ==
'/' , oC_ErrorCode_PathNotCorrect)
379 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
381 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
383 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
false);
385 if(oC_AssignErrorCodeIfFalse(&errorCode,mountedEntry !=
NULL , oC_ErrorCode_NoFileSystemMounted))
387 fileSystem = mountedEntry->FileSystem;
388 errorCode = oC_ErrorCode_None;
390 oC_List_Foreach(OpenedFilesEntries,openedEntry)
392 if(openedEntry->MountedEntry==mountedEntry)
394 oC_AssignErrorCode(&errorCode , oC_VirtualFileSystem_fclose(openedEntry->File));
398 oC_AssignErrorCodeIfFalse(&errorCode , kfree(mountedEntry->MountedPoint , AllocationFlags_CanWaitForever) , oC_ErrorCode_ReleaseError );
399 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(fileSystem->deinit) , oC_ErrorCode_FileSystemNotCorrect );
400 oC_AssignErrorCode( &errorCode , fileSystem->deinit(mountedEntry->Context) );
401 oC_AssignErrorCodeIfFalse(&errorCode , kfree(mountedEntry , AllocationFlags_CanWaitForever) , oC_ErrorCode_ReleaseError );
403 bool removed = oC_List_RemoveAll(MountedEntries,mountedEntry);
405 oC_AssignErrorCodeIfFalse(&errorCode , removed , oC_ErrorCode_CannotRemoveObjectFromList );
408 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
410 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
423 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
426 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
427 oC_AssignErrorCodeIfFalse(&errorCode , isram(outFile) , oC_ErrorCode_OutputAddressNotInRAM ) &&
428 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
429 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) > 1 , oC_ErrorCode_SizeNotCorrect)
432 char * absolute = ConvertToAbsoluteWithAllocation(Path,
false);
434 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
436 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
true);
439 oC_AssignErrorCodeIfFalse(&errorCode , mountedEntry !=
NULL , oC_ErrorCode_NoFileSystemMounted ) &&
440 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem) , oC_ErrorCode_FileSystemNotCorrect) &&
441 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->fopen) , oC_ErrorCode_NoSupportedByFileSystem)
444 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
446 errorCode = mountedEntry->FileSystem->fopen( mountedEntry->Context , outFile , &absolute[mountedPathLength-1] , Mode , Attributes );
448 if(!oC_ErrorOccur(errorCode))
450 OpenedFileEntry_t openedEntry = smartalloc(
sizeof(
struct _OpenedFileEntry_t),AllocationFlags_CanWait1Second);
454 openedEntry->File = *outFile;
455 openedEntry->MountedEntry = mountedEntry;
456 openedEntry->Process = oC_ProcessMan_GetCurrentProcess();
458 bool pushed = oC_List_PushBack(OpenedFilesEntries,openedEntry,&
Allocator);
462 if(!smartfree(openedEntry,
sizeof(
struct _OpenedFileEntry_t),AllocationFlags_CanWaitForever))
464 oC_SaveError(
"VFS: fopen " , oC_ErrorCode_ReleaseError);
467 errorCode = oC_ErrorCode_CannotAddObjectToList;
472 errorCode = oC_ErrorCode_AllocationError;
477 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
479 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
489 oC_ErrorCode_t oC_VirtualFileSystem_fclose(
oC_File_t File )
491 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
493 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
495 oC_List_Foreach(OpenedFilesEntries,openedEntry)
497 if(openedEntry->File == File)
499 MountedEntry_t mountedEntry = openedEntry->MountedEntry;
502 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem) , oC_ErrorCode_FileSystemNotCorrect) &&
503 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->fclose) , oC_ErrorCode_NoSupportedByFileSystem)
506 errorCode = mountedEntry->FileSystem->fclose(mountedEntry->Context,File);
509 if(!smartfree(openedEntry,
sizeof(
struct _OpenedFileEntry_t),AllocationFlags_CanWaitForever))
511 oC_SaveError(
"VFS: fclose " , errorCode);
514 bool removed = oC_List_RemoveAll(OpenedFilesEntries,openedEntry);
516 oC_AssignErrorCodeIfFalse(&errorCode , removed , oC_ErrorCode_CannotRemoveObjectFromList);
527 oC_ErrorCode_t oC_VirtualFileSystem_fcloseFromProcess(
oC_Process_t Process )
529 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
531 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
533 errorCode = oC_ErrorCode_None;
535 oC_List_Foreach(OpenedFilesEntries,openedEntry)
537 if(openedEntry->Process == Process )
539 oC_AssignErrorCode(&errorCode , oC_VirtualFileSystem_fclose(openedEntry->File));
549 oC_ErrorCode_t oC_VirtualFileSystem_fread(
oC_File_t File ,
void * outBuffer , uint32_t * Size )
551 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
553 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
555 errorCode = oC_ErrorCode_NoSuchFile;
557 oC_List_Foreach(OpenedFilesEntries,openedEntry)
559 if(openedEntry->File == File )
561 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->fread) , oC_ErrorCode_NoSupportedByFileSystem))
563 errorCode = openedEntry->MountedEntry->FileSystem->fread(openedEntry->MountedEntry->Context,File,outBuffer,Size);
575 oC_ErrorCode_t oC_VirtualFileSystem_fwrite(
oC_File_t File ,
const void * Buffer , uint32_t * Size )
577 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
579 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
581 errorCode = oC_ErrorCode_NoSuchFile;
583 oC_List_Foreach(OpenedFilesEntries,openedEntry)
585 if(openedEntry->File == File )
587 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->fwrite) , oC_ErrorCode_NoSupportedByFileSystem))
589 errorCode = openedEntry->MountedEntry->FileSystem->fwrite(openedEntry->MountedEntry->Context,File,Buffer,Size);
601 oC_ErrorCode_t oC_VirtualFileSystem_lseek(
oC_File_t File , uint32_t Offset )
603 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
605 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
607 errorCode = oC_ErrorCode_NoSuchFile;
609 oC_List_Foreach(OpenedFilesEntries,openedEntry)
611 if(openedEntry->File == File )
613 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->lseek) , oC_ErrorCode_NoSupportedByFileSystem))
615 errorCode = openedEntry->MountedEntry->FileSystem->lseek(openedEntry->MountedEntry->Context,File,Offset);
627 oC_ErrorCode_t oC_VirtualFileSystem_ioctl(
oC_File_t File , oC_Ioctl_Command_t Command ,
void * Pointer)
629 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
631 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
633 errorCode = oC_ErrorCode_NoSuchFile;
635 oC_List_Foreach(OpenedFilesEntries,openedEntry)
637 if(openedEntry->File == File )
639 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->ioctl) , oC_ErrorCode_NoSupportedByFileSystem))
641 errorCode = openedEntry->MountedEntry->FileSystem->ioctl(openedEntry->MountedEntry->Context,File,Command,Pointer);
653 oC_ErrorCode_t oC_VirtualFileSystem_sync(
oC_File_t File )
655 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
657 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
659 errorCode = oC_ErrorCode_NoSuchFile;
661 oC_List_Foreach(OpenedFilesEntries,openedEntry)
663 if(openedEntry->File == File )
665 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->sync) , oC_ErrorCode_NoSupportedByFileSystem))
667 errorCode = openedEntry->MountedEntry->FileSystem->sync(openedEntry->MountedEntry->Context,File);
679 oC_ErrorCode_t oC_VirtualFileSystem_getc(
char * outCharacter ,
oC_File_t File )
681 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
683 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
685 errorCode = oC_ErrorCode_NoSuchFile;
687 oC_List_Foreach(OpenedFilesEntries,openedEntry)
689 if(openedEntry->File == File )
691 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->Getc) , oC_ErrorCode_NoSupportedByFileSystem))
693 errorCode = openedEntry->MountedEntry->FileSystem->Getc(openedEntry->MountedEntry->Context,outCharacter,File);
705 oC_ErrorCode_t oC_VirtualFileSystem_putc(
char Character ,
oC_File_t File )
707 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
709 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
711 errorCode = oC_ErrorCode_NoSuchFile;
713 oC_List_Foreach(OpenedFilesEntries,openedEntry)
715 if(openedEntry->File == File )
717 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->Putc) , oC_ErrorCode_NoSupportedByFileSystem))
719 errorCode = openedEntry->MountedEntry->FileSystem->Putc(openedEntry->MountedEntry->Context,Character,File);
731 int32_t oC_VirtualFileSystem_tell(
oC_File_t File )
737 oC_List_Foreach(OpenedFilesEntries,openedEntry)
739 if(openedEntry->File == File )
741 if(isaddresscorrect(openedEntry->MountedEntry->FileSystem->tell))
743 bytes = openedEntry->MountedEntry->FileSystem->tell(openedEntry->MountedEntry->Context,File);
755 bool oC_VirtualFileSystem_eof(
oC_File_t File )
761 oC_List_Foreach(OpenedFilesEntries,openedEntry)
763 if(openedEntry->File == File )
765 if(isaddresscorrect(openedEntry->MountedEntry->FileSystem->eof))
767 eof = openedEntry->MountedEntry->FileSystem->eof(openedEntry->MountedEntry->Context,File);
779 uint32_t oC_VirtualFileSystem_size(
oC_File_t File )
785 oC_List_Foreach(OpenedFilesEntries,openedEntry)
787 if(openedEntry->File == File )
789 if(isaddresscorrect(openedEntry->MountedEntry->FileSystem->size))
791 bytes = openedEntry->MountedEntry->FileSystem->size(openedEntry->MountedEntry->Context,File);
803 oC_ErrorCode_t oC_VirtualFileSystem_opendir(
oC_Dir_t * outDir ,
const char * Path )
805 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
808 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
809 oC_AssignErrorCodeIfFalse(&errorCode , isram(outDir) , oC_ErrorCode_OutputAddressNotInRAM ) &&
810 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
811 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect)
814 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
816 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
818 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
true);
821 oC_AssignErrorCodeIfFalse(&errorCode , mountedEntry !=
NULL , oC_ErrorCode_NoFileSystemMounted ) &&
822 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem) , oC_ErrorCode_FileSystemNotCorrect) &&
823 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->opendir) , oC_ErrorCode_NoSupportedByFileSystem)
826 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
828 errorCode = mountedEntry->FileSystem->opendir( mountedEntry->Context , outDir , &absolute[mountedPathLength-1] );
830 if(!oC_ErrorOccur(errorCode))
832 OpenedFileEntry_t openedEntry = smartalloc(
sizeof(
struct _OpenedFileEntry_t),AllocationFlags_CanWait1Second);
836 openedEntry->Dir = *outDir;
837 openedEntry->MountedEntry = mountedEntry;
838 openedEntry->Process = oC_ProcessMan_GetCurrentProcess();
840 bool pushed = oC_List_PushBack(OpenedFilesEntries,openedEntry,&
Allocator);
844 if(!smartfree(openedEntry,
sizeof(
struct _OpenedFileEntry_t),AllocationFlags_CanWaitForever))
846 oC_SaveError(
"VFS: opendir " , oC_ErrorCode_ReleaseError);
849 errorCode = oC_ErrorCode_CannotAddObjectToList;
854 errorCode = oC_ErrorCode_AllocationError;
859 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
861 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
871 oC_ErrorCode_t oC_VirtualFileSystem_closedir(
oC_Dir_t Dir )
873 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
875 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
877 oC_List_Foreach(OpenedFilesEntries,openedEntry)
879 if(openedEntry->Dir == Dir)
881 MountedEntry_t mountedEntry = openedEntry->MountedEntry;
884 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem) , oC_ErrorCode_FileSystemNotCorrect) &&
885 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->closedir) , oC_ErrorCode_NoSupportedByFileSystem)
888 errorCode = mountedEntry->FileSystem->closedir(mountedEntry->Context,Dir);
891 if(!smartfree(openedEntry,
sizeof(
struct _OpenedFileEntry_t),AllocationFlags_CanWaitForever))
893 oC_SaveError(
"VFS: closedir " , errorCode);
896 bool removed = oC_List_RemoveAll(OpenedFilesEntries,openedEntry);
898 oC_AssignErrorCodeIfFalse(&errorCode , removed , oC_ErrorCode_CannotRemoveObjectFromList);
911 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
913 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
915 errorCode = oC_ErrorCode_NoSuchFile;
917 oC_List_Foreach(OpenedFilesEntries,openedEntry)
919 if(openedEntry->Dir == Dir )
921 if(oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(openedEntry->MountedEntry->FileSystem->readdir) , oC_ErrorCode_NoSupportedByFileSystem))
923 errorCode = openedEntry->MountedEntry->FileSystem->readdir(openedEntry->MountedEntry->Context,Dir,outFileInfo);
935 oC_ErrorCode_t oC_VirtualFileSystem_stat(
const char * Path ,
oC_FileInfo_t * outFileInfo)
937 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
940 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
941 oC_AssignErrorCodeIfFalse(&errorCode , isram(outFileInfo) , oC_ErrorCode_OutputAddressNotInRAM ) &&
942 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
943 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect)
946 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
948 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
950 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
true);
953 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry) , oC_ErrorCode_NoFileSystemMounted) &&
954 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->stat) , oC_ErrorCode_NoSupportedByFileSystem)
957 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
958 errorCode = mountedEntry->FileSystem->stat(mountedEntry->Context,&absolute[mountedPathLength],outFileInfo);
961 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
963 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
973 oC_ErrorCode_t oC_VirtualFileSystem_unlink(
const char * Path)
975 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
978 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
979 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
980 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect)
983 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
985 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
987 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
true);
990 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry) , oC_ErrorCode_NoFileSystemMounted) &&
991 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->unlink) , oC_ErrorCode_NoSupportedByFileSystem)
994 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
995 errorCode = mountedEntry->FileSystem->unlink(mountedEntry->Context,&absolute[mountedPathLength]);
998 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
1000 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
1010 oC_ErrorCode_t oC_VirtualFileSystem_rename(
const char * OldName ,
const char * NewName)
1012 return oC_ErrorCode_NotImplemented;
1017 oC_ErrorCode_t oC_VirtualFileSystem_chmod(
const char * Path, oC_FileSystem_FileAttributes_t Attributes , oC_FileSystem_FileAttributes_t Mask)
1019 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1022 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
1023 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
1024 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect)
1027 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
1029 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
1031 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
true);
1034 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry) , oC_ErrorCode_NoFileSystemMounted) &&
1035 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->chmod) , oC_ErrorCode_NoSupportedByFileSystem)
1038 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
1039 errorCode = mountedEntry->FileSystem->chmod(mountedEntry->Context,&absolute[mountedPathLength],Attributes,Mask);
1042 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
1044 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
1054 oC_ErrorCode_t oC_VirtualFileSystem_utime(
const char * Path , oC_Timestamp_t Timestamp )
1056 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1059 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
1060 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
1061 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect)
1064 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
1066 if(oC_AssignErrorCodeIfFalse(&errorCode , isram(absolute) , oC_ErrorCode_AllocationError ))
1068 MountedEntry_t mountedEntry = GetMountedFileSystem(absolute,
true);
1071 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry) , oC_ErrorCode_NoFileSystemMounted) &&
1072 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->utime) , oC_ErrorCode_NoSupportedByFileSystem)
1075 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
1076 errorCode = mountedEntry->FileSystem->utime(mountedEntry->Context,&absolute[mountedPathLength],Timestamp);
1079 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
1081 oC_SaveError(
"vfs-umount: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
1091 oC_ErrorCode_t oC_VirtualFileSystem_mkdir(
const char * Path)
1093 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1096 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ) &&
1097 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Path) , oC_ErrorCode_WrongAddress ) &&
1098 oC_AssignErrorCodeIfFalse(&errorCode , strlen(Path) >= 1 , oC_ErrorCode_SizeNotCorrect)
1101 char * absolutePath = ConvertToAbsoluteWithAllocation(Path,
true);
1105 MountedEntry_t mountedEntry = GetMountedFileSystem(absolutePath,
true);
1108 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry) , oC_ErrorCode_NoFileSystemMounted) &&
1109 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry->FileSystem->mkdir) , oC_ErrorCode_NoSupportedByFileSystem)
1112 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
1114 errorCode = mountedEntry->FileSystem->mkdir(mountedEntry->Context,&absolutePath[mountedPathLength-1]);
1117 ifnot(ksmartfree(absolutePath,strlen(absolutePath)+1,AllocationFlags_CanWaitForever))
1119 oC_SaveError(
"vfs-mkdir: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
1124 errorCode = oC_ErrorCode_AllocationError;
1134 oC_ErrorCode_t oC_VirtualFileSystem_chdir(
const char * Path)
1136 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1138 if(oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag ==
true , oC_ErrorCode_ModuleNotStartedYet ))
1140 MountedEntry_t mountedEntry = GetMountedFileSystem(Path,
true);
1143 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(mountedEntry) , oC_ErrorCode_NoFileSystemMounted)
1154 oC_ErrorCode_t oC_VirtualFileSystem_getcwd(
char * outBuffer , uint32_t Size )
1156 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1159 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag , oC_ErrorCode_ModuleNotStartedYet ) &&
1160 oC_AssignErrorCodeIfFalse(&errorCode , isram(outBuffer) , oC_ErrorCode_OutputAddressNotInRAM ) &&
1161 oC_AssignErrorCodeIfFalse(&errorCode , Size > 0 , oC_ErrorCode_SizeNotCorrect ) &&
1162 oC_AssignErrorCodeIfFalse(&errorCode , isarrayinram(outBuffer,Size) , oC_ErrorCode_ArraySizeTooBig )
1174 oC_ErrorCode_t oC_VirtualFileSystem_getpwd(
char * outPwd , uint32_t Size )
1176 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1179 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag , oC_ErrorCode_ModuleNotStartedYet ) &&
1180 oC_AssignErrorCodeIfFalse(&errorCode , isram(outPwd) , oC_ErrorCode_OutputAddressNotInRAM ) &&
1181 oC_AssignErrorCodeIfFalse(&errorCode , Size > 0 , oC_ErrorCode_SizeNotCorrect ) &&
1182 oC_AssignErrorCodeIfFalse(&errorCode , isarrayinram(outPwd,Size) , oC_ErrorCode_ArraySizeTooBig )
1186 char * pwd = GetPwd();
1188 if( strlen(pwd) > Size )
1190 errorCode = oC_ErrorCode_OutputArrayToSmall;
1195 errorCode = oC_ErrorCode_None;
1204 oC_ErrorCode_t oC_VirtualFileSystem_ConvertRelativeToAbsolute(
const char * Relative ,
char * outAbsolute , uint32_t * AbsoluteSize ,
bool TreatAsDir )
1206 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
1209 oC_AssignErrorCodeIfFalse(&errorCode ,
ModuleEnabledFlag , oC_ErrorCode_ModuleNotStartedYet ) &&
1210 oC_AssignErrorCodeIfFalse(&errorCode , isaddresscorrect(Relative) , oC_ErrorCode_WrongAddress ) &&
1211 oC_AssignErrorCodeIfFalse(&errorCode , isram(AbsoluteSize) , oC_ErrorCode_OutputAddressNotInRAM )
1214 *AbsoluteSize = ConvertRelativeToAbsolute(Relative,outAbsolute,*AbsoluteSize,TreatAsDir);
1215 errorCode = oC_ErrorCode_None;
1223 bool oC_VirtualFileSystem_DirExists(
const char * Path )
1225 bool exists =
false;
1229 char * absolute = ConvertToAbsoluteWithAllocation(Path,
true);
1233 exists = CheckIfDirExists(absolute);
1235 ifnot(ksmartfree(absolute,strlen(absolute)+1,AllocationFlags_CanWaitForever))
1237 oC_SaveError(
"vfs-dir-exists: cannot release temp buffer ",oC_ErrorCode_ReleaseError);
1242 oC_SaveError(
"vfs-dir-exists: cannot allocate memory for temp buffer",oC_ErrorCode_AllocationError);
1249 #undef _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________ 1256 #define _________________________________________LOCAL_FUNCTIONS_SECTION___________________________________________________________________ 1260 static MountedEntry_t GetMountedFileSystem(
const char * Path ,
bool WithParentDirs )
1262 MountedEntry_t mountedEntry =
NULL;
1263 oC_UInt_t pathLength = strlen(Path);
1265 oC_List_Foreach(MountedEntries,mounted)
1267 oC_UInt_t mountPointLength = strlen(mounted->MountedPoint);
1270 (WithParentDirs && pathLength >= mountPointLength && strncmp(mounted->MountedPoint,Path,mountPointLength)==0) ||
1271 (!WithParentDirs && pathLength == mountPointLength && strcmp(mounted->MountedPoint,Path)==0)
1274 mountedEntry = mounted;
1279 return mountedEntry;
1284 static char * GetPwd(
void )
1286 return oC_Process_GetPwd(oC_ProcessMan_GetCurrentProcess());
1291 static uint32_t ConvertRelativeToAbsolute(
const char * Relative ,
char * outAbsolute , uint32_t AbsoluteSize ,
bool TreatAsDir )
1293 uint32_t requiredSize = 0;
1294 uint32_t relativeLength = strlen(Relative);
1295 char * pwd = GetPwd();
1296 uint32_t pwdLength = strlen(pwd);
1297 bool lastSlashPushed =
false;
1299 #define _putc(c) if( ((c) == '/' && !lastSlashPushed) || ((c) != '/') ) {if(outAbsolute != NULL && requiredSize < AbsoluteSize) { outAbsolute[requiredSize] = c; } requiredSize++; lastSlashPushed = (c) == '/';} 1301 if(relativeLength>0 && pwdLength > 0)
1303 uint32_t tempBufferLength = pwdLength + relativeLength;
1305 if(!IsDirSign(pwd[pwdLength-1]))
1311 if(IsAbsolutePath(Relative))
1313 tempBufferLength = relativeLength;
1316 if(TreatAsDir && !IsDirSign(Relative[relativeLength-1]))
1322 char * tempBuffer = ksmartalloc(tempBufferLength+1, &
Allocator, AllocationFlags_CanWait1Second);
1324 if(oC_SaveIfFalse(
"VFS::ConvertRelativeToAbsolute - Cannot allocate memory - ", tempBuffer !=
NULL, oC_ErrorCode_AllocationError))
1326 if(IsAbsolutePath(Relative))
1328 strcpy(tempBuffer,Relative);
1332 strncpy(tempBuffer,pwd,pwdLength);
1334 if(!IsDirSign(pwd[pwdLength-1]))
1336 tempBuffer[pwdLength] =
'/';
1337 strncpy(&tempBuffer[pwdLength+1],Relative,relativeLength);
1341 strncpy(&tempBuffer[pwdLength],Relative,relativeLength);
1346 if(TreatAsDir && !IsDirSign(Relative[relativeLength-1]))
1349 tempBuffer[tempBufferLength-1] =
'/';
1352 tempBuffer[tempBufferLength] = 0;
1354 uint32_t dirsToSkip = 0;
1355 uint32_t foundDots = 0;
1356 bool foundFileName = TreatAsDir;
1358 for(uint32_t tempBufferIndex = tempBufferLength - 1; tempBufferIndex > 0 ; tempBufferIndex--)
1360 if(IsDirSign(tempBuffer[tempBufferIndex]))
1364 if( dirsToSkip == 0)
1369 if( dirsToSkip > 0 )
1381 foundFileName =
false;
1384 else if(!foundFileName && tempBuffer[tempBufferIndex] ==
'.')
1392 if( dirsToSkip == 0 )
1399 if( dirsToSkip == 0 )
1401 _putc(tempBuffer[tempBufferIndex]);
1404 foundFileName =
true;
1414 if(outAbsolute !=
NULL)
1417 string_reverse(outAbsolute);
1420 if(ksmartfree(tempBuffer,tempBufferLength+1,AllocationFlags_CanWaitForever)==
false)
1422 oC_SaveError(
"VFS,ConvertRelativeToAbsolute: cannot relase temp buffer" , oC_ErrorCode_ReleaseError);
1428 strcpy(outAbsolute,
"VFS error");
1433 return requiredSize;
1438 static char * ConvertToAbsoluteWithAllocation(
const char * Relative ,
bool TreatAsDir )
1440 uint32_t requiredSize = ConvertRelativeToAbsolute(Relative,
NULL,0,TreatAsDir);
1441 char * absolute = ksmartalloc(requiredSize,&
Allocator,AllocationFlags_CanWait1Second);
1445 ConvertRelativeToAbsolute(Relative,absolute,requiredSize,TreatAsDir);
1453 static bool CheckIfDirExists(
const char * Absolute )
1455 bool exists = strcmp(Absolute,
"/") == 0;
1457 MountedEntry_t mountedEntry = GetMountedFileSystem(Absolute,
true);
1459 if(isaddresscorrect(mountedEntry) && isaddresscorrect(mountedEntry->FileSystem->DirExists))
1461 oC_UInt_t mountedPathLength = strlen(mountedEntry->MountedPoint);
1462 exists = mountedEntry->FileSystem->DirExists(mountedEntry->Context,&Absolute[mountedPathLength-1]);
1468 #undef _________________________________________LOCAL_FUNCTIONS_SECTION___________________________________________________________________ static bool ModuleEnabledFlag
identifier for allocations
bool oC_MemMan_FreeAllMemoryOfAllocator(Allocator_t Allocator)
release all memory of allocator
The file with interface for process manager.
The file with list library.
The file with interface for Virtual File System.
oC_FileSystem_ModeFlags_t
The file with interface for string library.
static const oC_Allocator_t Allocator
#define NULL
pointer to a zero