Subversion Repositories Kolibri OS

Rev

Rev 5885 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #ifndef INCLUDE_LIBFS_H
  2. #define INCLUDE_LIBFS_H
  3. #print "[include <obj/fs.h>]\n"
  4.  
  5. #ifndef INCLUDE_KOLIBRI_H
  6. #include "../lib/kolibri.h"
  7. #endif
  8.  
  9. #ifndef INCLUDE_DLL_H
  10. #include "../lib/dll.h"
  11. #endif
  12.  
  13. :struct FILE_SYSTEM_FUNCTION
  14. {
  15.         dword remove_pointer;
  16.         byte remove(dword path);
  17.        
  18.         dword read_pointer;
  19.         dword read(dword path);
  20.        
  21.         dword run_pointer;
  22.         dword run(dword path,arg);
  23.        
  24.         dword move_pointer;
  25.         byte move(dword path1,path2);
  26.        
  27.         dword copy_pointer;
  28.         byte copy(dword path1,path2);
  29.        
  30.         dword get_size_pointer;
  31.         qword get_size(dword path);
  32. } fs;
  33.  
  34. :byte FILE_SYSTEM_FUNCTION::remove(dword path)
  35. {
  36.         dword tmp = path;
  37.         remove_pointer stdcall(tmp);
  38.         return EAX;
  39. }
  40.  
  41. :dword FILE_SYSTEM_FUNCTION::read(dword path)
  42. {
  43.         dword tmp = path;
  44.         read_pointer stdcall(tmp);
  45.         return EAX;
  46. }
  47.  
  48. :dword FILE_SYSTEM_FUNCTION::run(dword path,arg)
  49. {
  50.         dword tmp1 = path1;
  51.         dword tmp2 = arg;
  52.         run_pointer stdcall(tmp1,tmp2);
  53.         return EAX;
  54. }
  55.  
  56. :qword FILE_SYSTEM_FUNCTION::get_size(dword path)
  57. {
  58.         dword tmp = path;
  59.         get_size_pointer stdcall(tmp);
  60.         return EAX;
  61. }
  62.  
  63. :byte FILE_SYSTEM_FUNCTION::move(dword path1,path2)
  64. {
  65.         dword tmp1 = path1;
  66.         dword tmp2 = path2;
  67.         move_pointer stdcall(tmp1,tmp2);
  68.         return EAX;
  69. }
  70.  
  71. :byte FILE_SYSTEM_FUNCTION::copy(dword path1,path2)
  72. {
  73.         dword tmp1 = path1;
  74.         dword tmp2 = path2;
  75.         copy_pointer stdcall(tmp1,tmp2);
  76.         return EAX;
  77. }
  78.  
  79. :byte __CHECK_FS__ = 0;
  80. :void lib_init_fs()
  81. {
  82.         IF(__CHECK_FS__)return;
  83.         library.load("/sys/LIB/FS.OBJ");
  84.         fs.remove_pointer = library.get("fs.remove");
  85.         fs.get_size_pointer = library.get("fs.get_size");
  86.         fs.move_pointer = library.get("fs.move");
  87.         fs.copy_pointer = library.get("fs.copy");
  88.         fs.read_pointer = library.get("fs.read");
  89.         fs.run_pointer = library.get("fs.execute");
  90.         __CHECK_FS__ = true;
  91. }
  92.  
  93. #endif