Subversion Repositories Kolibri OS

Rev

Rev 4874 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4874 Rev 5808
Line 1... Line 1...
1
#ifndef __KOS_IO_H__
1
#ifndef __KOS_IO_H__
2
#define __KOS_IO_H__
2
#define __KOS_IO_H__
Line -... Line 3...
-
 
3
 
-
 
4
#ifdef __cplusplus
-
 
5
extern "C" {
-
 
6
#endif
3
 
7
 
4
#pragma pack(push, 1)
8
#pragma pack(push, 1)
5
typedef struct
9
typedef struct
6
{
10
{
7
  char sec;
11
  char sec;
Line 63... Line 67...
63
               size_t offset, size_t count, size_t *reads);
67
               size_t offset, size_t count, size_t *reads);
64
int write_file(const char *path,const void *buff,
68
int write_file(const char *path,const void *buff,
65
               size_t offset, size_t count, size_t *writes);
69
               size_t offset, size_t count, size_t *writes);
66
int set_file_size(const char *path, unsigned size);
70
int set_file_size(const char *path, unsigned size);
67
void *load_file(const char *path, size_t *len);
71
void unpack(void* packed_data, void* unpacked_data) __attribute__((stdcall)) ;
68
void unpack(void* packed_data, void* unpacked_data) __attribute__((stdcall)) ;
-
 
69
 
72
 
Line 70... Line -...
70
static inline int user_free(void *mem)
-
 
71
{
-
 
72
    int  val;
-
 
73
    __asm__ __volatile__(
-
 
74
    "int $0x40"
-
 
75
    :"=a"(val)
-
 
76
    :"a"(68),"b"(12),"c"(mem));
-
 
77
    return val;
-
 
78
}
-
 
79
 
-
 
80
static inline void set_cwd(const char* cwd)
73
static inline void set_cwd(const char* cwd)
81
{
74
{
82
    __asm__ __volatile__(
75
    __asm__ __volatile__(
83
    "int $0x40"
76
    "int $0x40"
84
    ::"a"(30),"b"(1),"c"(cwd));
77
    ::"a"(30),"b"(1),"c"(cwd));
85
};
78
};
Line -... Line 79...
-
 
79
 
-
 
80
#ifdef __cplusplus
-
 
81
}
86
 
82
#endif