Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.         some system function of KolibriOS and founded of them functions
  3. */
  4.  
  5. static DWORD gui_get_file_size(char *filename,DWORD *buf_for_size)
  6. {
  7.         static char             buf[44];
  8.         static fileio_t f;
  9.         bded_t          *bded;
  10.         DWORD           status,value;
  11.  
  12.         f.number_subfunction=5;
  13.         f.data=(DWORD*)buf;
  14.         f.full_file_path=filename;
  15.  
  16.         status=gui_ksys_files_io(&f,value);
  17.  
  18.         if (status==KOLIBRIOS_SYS_FILE_ACCESS_SUCCESSFULLY)
  19.         {
  20.                 bded=(bded_t*)buf;
  21.                 *buf_for_size=bded->file_size_low;
  22.                 buf_for_size++;
  23.                 *buf_for_size=bded->file_size_hight;
  24.         }
  25.  
  26.         return(status);
  27. }
  28.  
  29. static DWORD gui_read_file(char *filename,DWORD *buf_pos_size,DWORD size_read,char *buf)
  30. {
  31.         static fileio_t f;
  32.         DWORD           status,value;
  33.  
  34.         f.number_subfunction=0;
  35.         f.offset_in_file_low=(DWORD)*buf_pos_size;buf_pos_size++;
  36.         f.offset_in_file_hight=(DWORD)*buf_pos_size;
  37.         f.size=size_read;
  38.         f.data=(DWORD*)buf;
  39.         f.full_file_path=filename;
  40.  
  41.         status=gui_ksys_files_io(&f,value);
  42.  
  43.         return(status);
  44. }
  45.  
  46. static void gui_debug_out_str(char *s)
  47. {
  48.  
  49.         while(*s)
  50.         {
  51.                 if (*s=='\n') gui_ksys_debug_out(13);
  52.  
  53.                 gui_ksys_debug_out(*s);
  54.                 s++;
  55.         }
  56. }
  57.  
  58. static void* gui_cofflib_getproc(import_t *lib, char *name)
  59. {
  60.         int i;
  61.  
  62.         for(i = 0; lib[i].name && strcmp(name, lib[i].name); i++);
  63.  
  64.         if(lib[i].name) return lib[i].data;
  65.                         else    return NULL;
  66. }
  67.  
  68.