Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 705 → Rev 711

/programs/develop/open watcom/trunk/clib/h/kolibri.h
99,8 → 99,29
 
#endif
 
typedef struct
{ unsigned attr;
unsigned flags;
unsigned cr_time;
unsigned cr_date;
unsigned acc_time;
unsigned acc_date;
unsigned mod_time;
unsigned mod_date;
unsigned size;
unsigned size_high;
} FILEINFO;
 
 
unsigned init_heap(void);
void *user_alloc(unsigned size);
unsigned user_free(void *);
 
int create_file(const char *name);
int get_fileinfo(const char *name,FILEINFO* pinfo);
int read_file (const char *name,void *buff, unsigned offset, unsigned count,unsigned *reads);
int write_file(const char *name,const void *buff,unsigned offset,unsigned count,unsigned *writes);
 
#pragma aux init_heap = \
"mov EAX, 68" \
"mov EBX, 11" \
108,10 → 129,6
value [EAX] \
modify [ EBX ];
 
void *user_alloc(unsigned size);
 
void *user_alloc(unsigned size);
 
#pragma aux user_alloc = \
"mov EAX, 68" \
"mov EBX, 12" \
119,8 → 136,6
parm [ ECX ] value [EAX] \
modify [ EBX ];
 
unsigned user_free(void *);
 
#pragma aux user_free = \
"mov EAX, 68" \
"mov EBX, 13" \
128,6 → 143,78
parm [ ECX ] value [EAX] \
modify [ EBX ];
 
#pragma aux create_file = \
"push 0" \
"push 0" \
"mov [esp+1], eax" \
"push 0" \
"push 0" \
"push 0" \
"push 0" \
"push 2" \
"mov ebx, esp" \
"mov eax, 70" \
"int 0x40" \
"add esp, 28" \
parm [EAX] value [EAX] \
modify [ EBX ];
 
#pragma aux get_fileinfo = \
"push 0" \
"push 0" \
"mov [esp+1], eax" \
"push ebx" \
"push 0" \
"push 0" \
"push 0" \
"push 5" \
"mov ebx, esp" \
"mov eax, 70" \
"int 0x40" \
"add esp, 28" \
parm [EAX] [ebx] value [EAX] \
modify [ EBX ];
 
#pragma aux read_file = \
"push 0" \
"push 0" \
"mov [esp+1], eax" \
"push ebx" \
"push edx" \
"push 0" \
"push ecx" \
"push 0" \
"mov ebx, esp" \
"mov eax, 70" \
"int 0x40" \
"test esi, esi" \
"jz skip" \
"mov [esi], ebx" \
"skip:" \
"add esp, 28" \
parm [EAX] [EBX] [ECX] [EDX] [ESI] value [EAX] \
modify [ EBX ];
 
#pragma aux write_file = \
"push 0" \
"push 0" \
"mov [esp+1], eax" \
"push ebx" \
"push edx" \
"push 0" \
"push ecx" \
"push 3" \
"mov ebx, esp" \
"mov eax, 70" \
"int 0x40" \
"test esi, esi" \
"jz skip" \
"mov [esi], ebx" \
"skip:" \
"add esp, 28" \
parm [EAX] [EBX] [ECX] [EDX] [ESI] value [EAX] \
modify [ EBX ];
 
#ifdef __cplusplus
extern "C"
}
/programs/develop/open watcom/trunk/clib/handleio/lseekwnt.c
36,16 → 36,8
#include "seterrno.h"
#include "lseek.h"
#include "handleio.h"
#include "kolibri.h"
 
/*
DWORD SetFilePointer(
HANDLE hFile, // handle to file
LONG lDistanceToMove, // bytes to move pointer
PLONG lpDistanceToMoveHigh, // bytes to move pointer
DWORD dwMoveMethod // starting point
);
*/
 
#ifndef INVALID_SET_FILE_POINTER
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
#endif
56,21 → 48,6
unsigned int offset;
}__file_handle;
 
typedef struct
{ DWORD attr;
DWORD flags;
DWORD cr_time;
DWORD cr_date;
DWORD acc_time;
DWORD acc_date;
DWORD mod_time;
DWORD mod_date;
DWORD size;
DWORD size_high;
} FILEINFO;
 
int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo);
 
_WCRTLINK long __lseek( int hid, long offset, int origin )
{
__file_handle *fh;
/programs/develop/open watcom/trunk/clib/handleio/openklbr.c
46,6 → 46,7
#include "openmode.h"
#include "rtdata.h"
#include "seterrno.h"
#include "kolibri.h"
 
extern unsigned __NFiles;
extern char *__appcwd;
54,23 → 55,6
#if (defined(__WINDOWS__) || defined(__NT__))
 
typedef struct
{ DWORD attr;
DWORD flags;
DWORD cr_time;
DWORD cr_date;
DWORD acc_time;
DWORD acc_date;
DWORD mod_time;
DWORD mod_date;
DWORD size;
DWORD size_high;
} FILEINFO;
 
int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo);
int _stdcall create_file(const char *name);
 
 
typedef struct
{
char *name;
unsigned int offset;
/programs/develop/open watcom/trunk/clib/handleio/qread.c
36,6 → 36,7
#include "seterrno.h"
#include "qread.h"
#include <stdio.h>
#include "kolibri.h"
 
typedef struct
{
43,9 → 44,6
unsigned int offset;
}__file_handle;
 
 
int _stdcall read_file (const char *name,char *buff,unsigned offset, unsigned count,unsigned *reads);
 
int __qread( int handle, void *buffer, unsigned len )
{
__file_handle *fh;
/programs/develop/open watcom/trunk/clib/handleio/qwrit.c
41,8 → 41,8
#include "seterrno.h"
#include "qwrite.h"
#include "liballoc.h"
#include "kolibri.h"
 
 
/*
Use caution when setting the file pointer in a multithreaded
application. You must synchronize access to shared resources. For
52,26 → 52,11
*/
 
typedef struct
{ DWORD attr;
DWORD flags;
DWORD cr_time;
DWORD cr_date;
DWORD acc_time;
DWORD acc_date;
DWORD mod_time;
DWORD mod_date;
DWORD size;
DWORD size_high;
} FILEINFO;
 
typedef struct
{
char *name;
unsigned int offset;
}__file_handle;
 
int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo);
int _stdcall write_file(const char *name,const void *buff,unsigned offset,unsigned count,unsigned *writes);
char* getfullpath(const char* path);
 
int __qwrite( int handle, const void *buffer, unsigned len )
80,7 → 65,6
__file_handle *fh;
unsigned len_written;
 
__handle_check( handle, -1 );
 
fh = (__file_handle*) __getOSHandle( handle );
/programs/develop/open watcom/trunk/clib/math/cosf.asm
0,0 → 1,29
 
include mdef.inc
 
modstart cosf
 
xdefp _cosf
 
_cosf proc
fcos
fnstsw ax
test eax, 0x400
jnz L1
ret
 
L1: fldpi
fadd st,st
fxch st(1)
L2:
fprem1
fnstsw ax
test eax,0x400
jnz L2
fstp st(1)
fcos
ret
_cosf endp
 
endmod
end
/programs/develop/open watcom/trunk/clib/math/sinf.asm
0,0 → 1,29
 
include mdef.inc
 
modstart sinf
 
xdefp _sinf
 
_sinf proc
fsin
fnstsw ax
test eax, 0x400
jnz L1
ret
 
L1: fldpi
fadd st,st
fxch st(1)
L2:
fprem1
fnstsw ax
test eax,0x400
jnz L2
fstp st(1)
fsin
ret
_sinf endp
 
endmod
end
/programs/develop/open watcom/trunk/clib/math/tanf.asm
0,0 → 1,31
 
include mdef.inc
 
modstart tanf
 
xdefp _tanf
 
_tanf proc
fptan
fnstsw ax
test eax, 0x400
jnz L1
fstp st(0)
ret
 
L1: fldpi
fadd st,st
fxch st(1)
L2:
fprem1
fnstsw ax
test eax,0x400
jnz L2
fstp st(1)
fptan
fstp st(0)
ret
_tanf endp
 
endmod
end