isfs.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {$IFDEF OGC_INTERFACE}
  2. {$ifdef HW_RVL}
  3. const
  4. ISFS_MAXPATH = IPC_MAXPATH_LEN;
  5. ISFS_OPEN_READ = $01;
  6. ISFS_OPEN_WRITE = $02;
  7. ISFS_OPEN_RW = ( ISFS_OPEN_READ or ISFS_OPEN_WRITE );
  8. ISFS_OK = 0;
  9. ISFS_ENOMEM = - 22;
  10. ISFS_EINVAL = - 101;
  11. type
  12. _fstats = record
  13. file_length : cuint32;
  14. file_pos : cuint32;
  15. end;
  16. fstats = _fstats;
  17. isfscallback = function(result: cint32; usrdata: pointer): cint32; cdecl;
  18. function ISFS_Initialize: cint32; cdecl; external;
  19. function ISFS_Deinitialize: cint32; cdecl; external;
  20. function ISFS_Open(filepath: pcchar; mode: cuint8): cint32; cdecl; external;
  21. function ISFS_OpenAsync(filepath: pcchar; mode: cuint8; cb: isfscallback;
  22. usrdata: pointer): cint32; cdecl; external;
  23. function ISFS_Close(fd: cint32): cint32; cdecl; external;
  24. function ISFS_CloseAsync(fd: cint32; cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  25. function ISFS_Delete(filepath: pcchar): cint32; cdecl; external;
  26. function ISFS_DeleteAsync(filepath: pcchar; cb: isfscallback; usrdata: pointer)
  27. : cint32; cdecl; external;
  28. function ISFS_ReadDir(filepath, name_list: pcchar; num: pcuint32): cint32; cdecl; external;
  29. function ISFS_ReadDirAsync(filepath, name_list: pcchar; num: pcuint32;
  30. cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  31. function ISFS_CreateFile(filepath: pcchar;
  32. attributes, owner_perm, group_perm, other_perm: cuint8): cint32; cdecl; external;
  33. function ISFS_CreateFileAsync(filepath: pcchar;
  34. attributes, owner_perm, group_perm, other_perm: cuint8; cb: isfscallback;
  35. usrdata: pointer): cint32; cdecl; external;
  36. function ISFS_Write(fd: cint32; buffer: pointer; length: cuint32): cint32; cdecl; external;
  37. function ISFS_WriteAsync(fd: cint32; buffer: pointer; length: cuint32;
  38. cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  39. function ISFS_Read(fd: cint32; buffer: pointer; length: cuint32): cint32; cdecl; external;
  40. function ISFS_ReadAsync(fd: cint32; buffer: pointer; length: cuint32;
  41. cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  42. function ISFS_Seek(fd, where, whence: cint32): cint32; cdecl; external;
  43. function ISFS_SeekAsync(fd, where, whence: cint32; cb: isfscallback;
  44. usrdata: pointer): cint32; cdecl; external;
  45. function ISFS_CreateDir(filepath: pcchar;
  46. attributes, owner_perm, group_perm, other_perm: cuint8): cint32; cdecl; external;
  47. function ISFS_CreateDirAsync(filepath: pcchar;
  48. attributes, owner_perm, group_perm, other_perm: cuint8; cb: isfscallback;
  49. usrdata: pointer): cint32; cdecl; external;
  50. function ISFS_GetStats(stats: pointer): cint32; cdecl; external;
  51. function ISFS_GetStatsAsync(stats: pointer; cb: isfscallback; usrdata: pointer)
  52. : cint32; cdecl; external;
  53. type
  54. Pfstats = ^fstats;
  55. function ISFS_GetFileStats(fd: cint32; status: Pfstats): cint32; cdecl; external;
  56. function ISFS_GetFileStatsAsync(fd: cint32; status: Pfstats; cb: isfscallback;
  57. usrdata: pointer): cint32; cdecl; external;
  58. function ISFS_GetAttr(filepath: pcchar; ownerID: pcuint32; groupID: pcuint16;
  59. attributes, ownerperm, groupperm, otherperm: pcuint8): cint32; cdecl; external;
  60. function ISFS_GetAttrAsync(filepath: pcchar; ownerID: pcuint32;
  61. groupID: pcuint16; attributes, ownerperm, groupperm, otherperm: pcuint8;
  62. cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  63. function ISFS_Rename(filepathOld, filepathNew: pcchar): cint32; cdecl; external;
  64. function ISFS_RenameAsync(filepathOld, filepathNew: pcchar; cb: isfscallback;
  65. usrdata: pointer): cint32; cdecl; external;
  66. function ISFS_SetAttr(filepath: pcchar; ownerID: cuint32; groupID: cuint16;
  67. attributes, ownerperm, groupperm, otherperm: cuint8): cint32; cdecl; external;
  68. function ISFS_SetAttrAsync(filepath: pcchar; ownerID: cuint32;
  69. groupID: cuint16; attributes, ownerperm, groupperm, otherperm: cuint8;
  70. cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  71. function ISFS_GetUsage(filepath: pcchar; usage1, usage2: pcuint32): cint32; cdecl; external;
  72. function ISFS_GetUsageAsync(filepath: pcchar; usage1, usage2: pcuint32;
  73. cb: isfscallback; usrdata: pointer): cint32; cdecl; external;
  74. {$endif HW_RVL}
  75. {$ENDIF OGC_INTERFACE}