; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: Files manipulation library.
;
;  Target OS: Dummy
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________

DIR_SLASH equ '\'

fsFromBegin     = 0
fsFromEnd       = 0
fsFromCurrent   = 0


;--------------------------------------
; if CF = 0, eax is handle to the file.
; if CF = 1, eax is error code.
;--------------------------------------
proc FileOpen, .filename
begin
        stc
        return
endp



proc FileCreate, .filename
begin
        stc
        return
endp




proc FileClose, .handle
begin
        stc
        return
endp


; returns 32bit file size in eax
proc FileSize, .handle
begin
        stc
        return
endp



proc FileRead, .handle, .buffer, .count
begin
        stc
        return
endp




proc FileWrite, .handle, .buffer, .count
begin
        stc
        return
endp




;----------------------------------------------------
; if CF = 0, eax is the new possition in the file
; if CF = 1, eax is error code.
;----------------------------------------------------
proc FileSeek, .handle, .dist, .direction
begin
        stc
        return
endp



;----------------------------------------------------
; if CF = 0 - the file was deleted
; if CF = 1, eax is error code.
;----------------------------------------------------
proc FileDelete, .filename
begin
        stc
        return
endp



proc GetCurrentDir
begin
        return
endp




proc SetCurrentDir, .hDirectory
begin
        return
endp




proc GetErrorString, .code
begin
        return
endp



proc FreeErrorString, .ptrString
begin
        return
endp



ftUnknown    =  0
ftDirectory  =  1
ftFile       =  2



; reads all items of the directory and fills them in the TArray of type TDirItem.
; arguments:
;   dir - string with the path to the directory.
;
; returns:
;   if not error: CF=0; eax = pointer to TArray of TDirItem;
;   if error:     CF=1; eax = error code;

proc DirectoryRead, .dir
begin
        stc
        return
endp




proc GetFileInfo, .hFile, .ptrFileInfo
begin
        stc
        return
endp

