Subversion Repositories Kolibri OS

Rev

Rev 9057 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. #pragma pack(push, 1)
  3. typedef struct
  4. {
  5.   char sec;
  6.   char min;
  7.   char hour;
  8.   char rsv;
  9. }detime_t;
  10.  
  11. typedef struct
  12. {
  13.   char  day;
  14.   char  month;
  15.   short year;
  16. }dedate_t;
  17.  
  18. typedef struct
  19. {
  20.   unsigned    attr;
  21.   unsigned    flags;
  22.   union
  23.   {
  24.      detime_t  ctime;
  25.      unsigned  cr_time;
  26.   };
  27.   union
  28.   {
  29.      dedate_t  cdate;
  30.      unsigned  cr_date;
  31.   };
  32.   union
  33.   {
  34.      detime_t  atime;
  35.      unsigned  acc_time;
  36.   };
  37.   union
  38.   {
  39.      dedate_t  adate;
  40.      unsigned  acc_date;
  41.   };
  42.   union
  43.   {
  44.      detime_t  mtime;
  45.      unsigned  mod_time;
  46.   };
  47.   union
  48.   {
  49.      dedate_t  mdate;
  50.      unsigned  mod_date;
  51.   };
  52.   unsigned    size;
  53.   unsigned    size_high;
  54. } FILEINFO;
  55.  
  56. #pragma pack(pop)
  57.  
  58.  
  59. int get_fileinfo(const char *path,FILEINFO *info)
  60. {
  61.    int retval;
  62.  
  63.    asm __volatile__
  64.       (
  65.        "pushl $0 \n\t"
  66.        "pushl $0 \n\t"
  67.        "movl %0, 1(%%esp) \n\t"
  68.        "pushl %%ebx \n\t"
  69.        "pushl $0 \n\t"
  70.        "pushl $0 \n\t"
  71.        "pushl $0 \n\t"
  72.        "pushl $5 \n\t"
  73.        "movl %%esp, %%ebx \n\t"
  74.        "movl $70, %%eax \n\t"
  75.        "int $0x40 \n\t"
  76.        "addl $28, %%esp \n\t"
  77.        :"=a" (retval)
  78.        :"r" (path), "b" (info)
  79.        );
  80.    return retval;
  81. };
  82.