Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 1881 → Rev 1882

/programs/develop/libraries/menuetlibc/src/libc/dos/compat/Makefile
0,0 → 1,6
THIS_SRCS = d_close.c d_commit.c d_creat.c d_creatn.c d_exterr.c d_findf.c \
d_findn.c d_getdat.c d_getdf.c d_getdrv.c d_getfa.c d_getftm.c \
d_gettim.c d_open.c d_read.c d_setdat.c d_setdrv.c d_setfa.c d_setftm.c \
d_settim.c d_write.c
 
include $(MENUET_LIBC_TOPDIR)/Make.rules
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_close.c
0,0 → 1,19
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_CLOSE.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_close(int handle)
{
return dosemu_close(handle);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_commit.c
0,0 → 1,20
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_COMMIT.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_commit(int handle)
{
_dosemu_flush(handle);
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_creat.c
0,0 → 1,27
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_CREAT.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
#include <unistd.h>
#include <fcntl.h>
 
static char buf[1];
 
unsigned int _dos_creat(const char *filename, unsigned int attr, int *handle)
{
int i;
i=dosemu_open(filename,attr|O_CREAT);
if(i==-1) return -1;
if(handle) *handle=i;
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_creatn.c
0,0 → 1,27
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_CREATN.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
#include<unistd.h>
#include <fcntl.h>
 
static char buf[1];
 
unsigned int _dos_creatnew(const char *filename, unsigned int attr, int *handle)
{
int i;
i=dosemu_open(filename,attr|O_CREAT|O_EXCL);
if(i==-1) return -1;
if(handle) *handle=i;
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_exterr.c
0,0 → 1,17
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_EXTERR.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <dos.h>
 
int _dosexterr(struct _DOSERROR *p_error)
{
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_findf.c
0,0 → 1,21
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_FINDF.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/stubs.h>
#include <libc/dosio.h>
#include <errno.h>
#include <string.h>
#include <dos.h>
 
unsigned int _dos_findfirst(char *name, unsigned int attr, struct _find_t *result)
{
return -1;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_findn.c
0,0 → 1,20
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_FINDN.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/stubs.h>
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_findnext(struct _find_t *result)
{
return -1;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_getdat.c
0,0 → 1,17
#include <errno.h>
#include <dos.h>
 
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
 
void _dos_getdate(struct _dosdate_t *date)
{
unsigned long tmp;
__asm__ __volatile__("int $0x40":"=a"(tmp):"0"(29));
date->year=2000+(tmp&0xff);
date->month=(tmp>>8)&0xff;
date->day= (tmp>>16)&0xff;
date->dayofweek=0; /* xxx - how to do it correctly ? */
BCD_TO_BIN(date->year);
BCD_TO_BIN(date->month);
BCD_TO_BIN(date->day);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_getdf.c
0,0 → 1,22
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_GETDF.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <dos.h>
#include <errno.h>
 
unsigned int _dos_getdiskfree(unsigned int drive, struct _diskfree_t *diskspace)
{
diskspace->sectors_per_cluster = 1;
diskspace->avail_clusters = 0xFFFF;
diskspace->bytes_per_sector = 512;
diskspace->total_clusters = 0xFFFF;
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_getdrv.c
0,0 → 1,17
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_GETDRV.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <dos.h>
 
void _dos_getdrive(unsigned int *p_drive)
{
*p_drive = 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_getfa.c
0,0 → 1,19
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_GETFA.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_getfileattr(const char *filename, unsigned int *p_attr)
{
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_getftm.c
0,0 → 1,18
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_GETFTM.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_getftime(int handle, unsigned int *p_date, unsigned int *p_time)
{
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_gettim.c
0,0 → 1,15
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
 
#include <dos.h>
 
void _dos_gettime(struct _dostime_t *time)
{
unsigned long tmp=__menuet__getsystemclock();
time->hour=tmp&0xff;
time->minute=(tmp>>8)&0xff;
time->second=(tmp>>16)&0xff;
time->hsecond=0;
BCD_TO_BIN(time->hour);
BCD_TO_BIN(time->minute);
BCD_TO_BIN(time->second);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_open.c
0,0 → 1,24
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_OPEN.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
#include<menuet/os.h>
 
unsigned int _dos_open(const char *filename, unsigned int mode, int *handle)
{
int i;
i=dosemu_open(filename,mode);
if(i==-1) return -1;
if(handle) *handle=i;
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_read.c
0,0 → 1,27
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_READ.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/stubs.h>
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
#define FSLAYER
#include<menuet/os.h>
 
unsigned int _dos_read(int handle, void *buffer, unsigned int count, unsigned int *result)
{
int p;
p=dosemu_read(handle,buffer,count);
if(p==-1) return p;
if(result) *result=p;
return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_setdat.c
0,0 → 1,17
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_SETDAT.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_setdate(struct _dosdate_t *date)
{
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_setdrv.c
0,0 → 1,16
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_SETDRV.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <dos.h>
 
void _dos_setdrive(unsigned int drive, unsigned int *p_drives)
{
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_setfa.c
0,0 → 1,18
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_SETFA.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_setfileattr(const char *filename, unsigned int attr)
{
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_setftm.c
0,0 → 1,18
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_SETFTM.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_setftime(int handle, unsigned int date, unsigned int time)
{
return -1;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_settim.c
0,0 → 1,18
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_SETTIM.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_settime(struct _dostime_t *time)
{
return -1;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/programs/develop/libraries/menuetlibc/src/libc/dos/compat/d_write.c
0,0 → 1,25
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/*
* D_WITE.C.
*
* Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
*
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
 
#include <libc/stubs.h>
#include <libc/dosio.h>
#include <errno.h>
#include <dos.h>
 
unsigned int _dos_write(int handle, const void *buffer, unsigned int count, unsigned int *result)
{
int p;
p=dosemu_write(handle,buffer,count);
if(p==-1) return p;
if(result) *result=p;
return 0;
}
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property