mirror of https://github.com/FDOS/kernel.git
time.t: resolve issue with internal and standard C time.h files and remove all hacks
- fix issue by renaming header file and symbols which consolidate with standard C time.h - rename also date.h for consistency - remove all hacks from make files and from sys.c now can share new dtime.h with standard C time.h without any collision that any order of internal and standard C header path is possible
This commit is contained in:
parent
4ca28252da
commit
5304e657fd
4
filelist
4
filelist
|
@ -34,10 +34,11 @@
|
|||
*/*/hdr/buffer.h
|
||||
*/*/hdr/cds.h
|
||||
*/*/hdr/clock.h
|
||||
*/*/hdr/date.h
|
||||
*/*/hdr/dcb.h
|
||||
*/*/hdr/ddate.h
|
||||
*/*/hdr/device.h
|
||||
*/*/hdr/dirmatch.h
|
||||
*/*/hdr/dtime.h
|
||||
*/*/hdr/error.h
|
||||
*/*/hdr/exe.h
|
||||
*/*/hdr/fat.h
|
||||
|
@ -56,7 +57,6 @@
|
|||
*/*/hdr/sft.h
|
||||
*/*/hdr/stacks.inc
|
||||
*/*/hdr/tail.h
|
||||
*/*/hdr/time.h
|
||||
*/*/hdr/version.h
|
||||
*/*/hdr/xstructs.h
|
||||
*/*/kernel/nls/001-437.hc
|
||||
|
|
|
@ -51,7 +51,7 @@ static BYTE *date_hRcsId =
|
|||
#define EPOCH_DAY 1 /* 1 for January 1 */
|
||||
#define EPOCH_YEAR 1980 /* for Tues 1-1-80 epoch */
|
||||
|
||||
typedef UWORD date;
|
||||
typedef UWORD ddate;
|
||||
|
||||
#endif
|
||||
|
|
@ -47,8 +47,8 @@ typedef struct {
|
|||
UWORD reserved2;
|
||||
|
||||
UBYTE dm_attr_fnd; /* found file attribute */
|
||||
time dm_time; /* file time */
|
||||
date dm_date; /* file date */
|
||||
dtime dm_time; /* file time */
|
||||
ddate dm_date; /* file date */
|
||||
ULONG dm_size; /* file size */
|
||||
BYTE dm_name[FNAME_SIZE + FEXT_SIZE + 2]; /* file name */
|
||||
} dmatch;
|
||||
|
|
|
@ -39,7 +39,7 @@ static BYTE *time_hRcsId =
|
|||
#endif
|
||||
#endif
|
||||
|
||||
typedef UWORD time;
|
||||
typedef UWORD dtime;
|
||||
|
||||
struct dostime
|
||||
{
|
|
@ -105,8 +105,8 @@ struct dirent {
|
|||
UWORD dir_crdate; /* Creation date */
|
||||
UWORD dir_accdate; /* Last access date */
|
||||
UWORD dir_start_high; /* High word of the cluster */
|
||||
time dir_time; /* Time file created/updated */
|
||||
date dir_date; /* Date file created/updated */
|
||||
dtime dir_time; /* Time file created/updated */
|
||||
ddate dir_date; /* Date file created/updated */
|
||||
UWORD dir_start; /* Starting cluster */
|
||||
/* 1st available = 2 */
|
||||
ULONG dir_size; /* File size in bytes */
|
||||
|
|
|
@ -86,8 +86,8 @@ typedef struct {
|
|||
UWORD fcb_recsiz; /* Logical record size in bytes, */
|
||||
/* default = 128 */
|
||||
ULONG fcb_fsize; /* File size in bytes */
|
||||
date fcb_date; /* Date file created */
|
||||
time fcb_time; /* Time of last write */
|
||||
ddate fcb_date; /* Date file created */
|
||||
dtime fcb_time; /* Time of last write */
|
||||
/* the following are reserved by system */
|
||||
BYTE fcb_sftno; /* Device ID */
|
||||
BYTE fcb_attrib_hi; /* share info, dev attrib word hi */
|
||||
|
|
|
@ -61,8 +61,8 @@ typedef struct {
|
|||
#else
|
||||
CLUSTER sft_stclust; /* 0b - Starting cluster */
|
||||
#endif
|
||||
time sft_time; /* 0d - File time */
|
||||
date sft_date; /* 0f - File date */
|
||||
dtime sft_time; /* 0d - File time */
|
||||
ddate sft_date; /* 0f - File date */
|
||||
ULONG sft_size; /* 11 - File size */
|
||||
ULONG sft_posit; /* 15 - Current file position */
|
||||
UWORD sft_relclust; /* 19 - File relative cluster (low part) */
|
||||
|
|
|
@ -1130,7 +1130,7 @@ COUNT DosFindNext(void)
|
|||
return pop_dmp(rc, dmp);
|
||||
}
|
||||
|
||||
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
|
||||
COUNT DosGetFtime(COUNT hndl, ddate * dp, dtime * tp)
|
||||
{
|
||||
sft FAR *s;
|
||||
/*sfttbl FAR *sp;*/
|
||||
|
@ -1144,7 +1144,7 @@ COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
COUNT DosSetFtimeSft(int sft_idx, date dp, time tp)
|
||||
COUNT DosSetFtimeSft(int sft_idx, ddate dp, dtime tp)
|
||||
{
|
||||
/* Get the SFT block that contains the SFT */
|
||||
sft FAR *s = idx_to_sft(sft_idx);
|
||||
|
|
|
@ -52,7 +52,7 @@ COUNT map_cluster(f_node_ptr, COUNT);
|
|||
STATIC int shrink_file(f_node_ptr fnp);
|
||||
|
||||
/* FAT time notation in the form of hhhh hmmm mmmd dddd (d = double second) */
|
||||
STATIC time time_encode(struct dostime *t)
|
||||
STATIC dtime time_encode(struct dostime *t)
|
||||
{
|
||||
return (t->hour << 11) | (t->minute << 5) | (t->second >> 1);
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ STATIC int alloc_find_free(f_node_ptr fnp, char *path)
|
|||
/* */
|
||||
/* dos_getdate for the file date */
|
||||
/* */
|
||||
date dos_getdate(void)
|
||||
ddate dos_getdate(void)
|
||||
{
|
||||
struct dosdate dd;
|
||||
|
||||
|
@ -679,7 +679,7 @@ date dos_getdate(void)
|
|||
/* */
|
||||
/* dos_gettime for the file time */
|
||||
/* */
|
||||
time dos_gettime(void)
|
||||
dtime dos_gettime(void)
|
||||
{
|
||||
struct dostime dt;
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ static BYTE *Globals_hRcsId =
|
|||
#include "device.h"
|
||||
#include "mcb.h"
|
||||
#include "pcb.h"
|
||||
#include "date.h"
|
||||
#include "time.h"
|
||||
#include "ddate.h"
|
||||
#include "dtime.h"
|
||||
#include "fat.h"
|
||||
#include "fcb.h"
|
||||
#include "tail.h"
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#define IN_INIT_MOD
|
||||
|
||||
#include "version.h"
|
||||
#include "date.h"
|
||||
#include "time.h"
|
||||
#include "ddate.h"
|
||||
#include "dtime.h"
|
||||
#include "mcb.h"
|
||||
#include "sft.h"
|
||||
#include "fat.h"
|
||||
|
|
|
@ -1200,8 +1200,8 @@ dispatch:
|
|||
|
||||
case 0x01:
|
||||
rc = DosSetFtime((COUNT) lr.BX, /* Handle */
|
||||
(date) lr.DX, /* FileDate */
|
||||
(time) lr.CX); /* FileTime */
|
||||
(ddate) lr.DX, /* FileDate */
|
||||
(dtime) lr.CX); /* FileTime */
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -87,7 +87,7 @@ serial.obj: serial.asm io.inc $(TARGET).lnk
|
|||
|
||||
HDRS=\
|
||||
$(HDR)portab.h $(HDR)device.h $(HDR)mcb.h $(HDR)pcb.h \
|
||||
$(HDR)fat.h $(HDR)fcb.h $(HDR)tail.h $(HDR)time.h $(HDR)process.h \
|
||||
$(HDR)fat.h $(HDR)fcb.h $(HDR)tail.h $(HDR)dtime.h $(HDR)process.h \
|
||||
$(HDR)dcb.h $(HDR)sft.h $(HDR)cds.h $(HDR)exe.h $(HDR)fnode.h \
|
||||
$(HDR)dirmatch.h $(HDR)file.h $(HDR)clock.h $(HDR)kbd.h $(HDR)error.h \
|
||||
$(HDR)version.h dyndata.h
|
||||
|
|
|
@ -102,8 +102,8 @@ COUNT DosGetCuDir(UBYTE drive, BYTE FAR * s);
|
|||
COUNT DosChangeDir(BYTE FAR * s);
|
||||
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name);
|
||||
COUNT DosFindNext(void);
|
||||
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp);
|
||||
COUNT DosSetFtimeSft(int sft_idx, date dp, time tp);
|
||||
COUNT DosGetFtime(COUNT hndl, ddate * dp, dtime * tp);
|
||||
COUNT DosSetFtimeSft(int sft_idx, ddate dp, dtime tp);
|
||||
#define DosSetFtime(hndl, dp, tp) DosSetFtimeSft(get_sft_idx(hndl), (dp), (tp))
|
||||
COUNT DosGetFattr(BYTE FAR * name);
|
||||
COUNT DosSetFattr(BYTE FAR * name, UWORD attrp);
|
||||
|
@ -158,8 +158,8 @@ COUNT dos_close(COUNT fd);
|
|||
COUNT dos_delete(BYTE * path, int attrib);
|
||||
COUNT dos_rmdir(BYTE * path);
|
||||
COUNT dos_rename(BYTE * path1, BYTE * path2, int attrib);
|
||||
date dos_getdate(void);
|
||||
time dos_gettime(void);
|
||||
ddate dos_getdate(void);
|
||||
dtime dos_gettime(void);
|
||||
COUNT dos_mkdir(BYTE * dir);
|
||||
BOOL last_link(f_node_ptr fnp);
|
||||
COUNT map_cluster(REG f_node_ptr fnp, COUNT mode);
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
/****************************************************************/
|
||||
|
||||
#include "portab.h"
|
||||
#include "time.h"
|
||||
#include "date.h"
|
||||
#include "dtime.h"
|
||||
#include "ddate.h"
|
||||
#include "globals.h"
|
||||
|
||||
#ifdef VERSION_STRINGS
|
||||
|
|
|
@ -70,7 +70,7 @@ endif
|
|||
|
||||
INITPATCH=ia16-elf-objcopy --redefine-sym ___umodsi3=_init_umodsi3 --redefine-sym ___udivsi3=_init_udivsi3 --redefine-sym ___ashlsi3=_init_ashlsi3 --redefine-sym ___lshrsi3=_init_lshrsi3 --redefine-sym _printf=_init_printf --redefine-sym _sprintf=_init_sprintf --redefine-sym _execrh=_init_execrh --redefine-sym _memcpy=_init_memcpy --redefine-sym _fmemcpy=_init_fmemcpy --redefine-sym _fmemset=_init_fmemset --redefine-sym _fmemcmp=_init_fmemcmp --redefine-sym _memcmp=_init_memcmp --redefine-sym _memset=_init_memset --redefine-sym _strchr=_init_strchr --redefine-sym _strcpy=_init_strcpy --redefine-sym _fstrcpy=_init_fstrcpy --redefine-sym _strlen=_init_strlen --redefine-sym _fstrlen=_init_fstrlen --redefine-sym _open=_init_DosOpen
|
||||
CLDEF=1
|
||||
CLT=gcc -Wall -DDOSC_TIME_H -I../hdr -o $@
|
||||
CLT=gcc -Wall -I../hdr -o $@
|
||||
CLC=$(CLT)
|
||||
LINK=$(XLINK) -Tkernel.ld -nostdlib -Wl,-Map,kernel.map -o kernel.exe $(OBJS) -Wl,--whole-archive ../drivers/device.lib -Wl,--no-whole-archive \#
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ CP=cp
|
|||
ECHOTO=echo>>
|
||||
INITPATCH=@echo > /dev/null
|
||||
CLDEF=1
|
||||
CLT=wcl386 -zq -bcl=linux -DDOSC_TIME_H -I../hdr -fe=$@ -I$(COMPILERPATH)/lh
|
||||
CLT=wcl386 -zq -bcl=linux -I../hdr -fe=$@ -I$(COMPILERPATH)/lh
|
||||
CLC=$(CLT)
|
||||
CFLAGST=-fo=.obj $(CFLAGST)
|
||||
ALLCFLAGS=-fo=.obj $(ALLCFLAGS)
|
||||
|
|
|
@ -13,7 +13,7 @@ INCLUDEPATH=$(COMPILERPATH)\h
|
|||
#ECHOTO=echo>>
|
||||
#INITPATCH=@echo > nul
|
||||
CLDEF=1
|
||||
CLT=wcl386 -zq -bcl=nt -DDOSC_TIME_H -I..\hdr -fe=$@ -I$(COMPILERPATH)\h -I$(COMPILERPATH)\h\nt
|
||||
CLT=wcl386 -zq -bcl=nt -I..\hdr -fe=$@ -I$(COMPILERPATH)\h -I$(COMPILERPATH)\h\nt
|
||||
CLC=$(CLT)
|
||||
CFLAGST=-fo=.obj $(CFLAGST)
|
||||
ALLCFLAGS=-fo=.obj $(ALLCFLAGS)
|
||||
|
|
Loading…
Reference in New Issue