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:
Jiri Malak 2024-07-09 18:45:59 +02:00 committed by Kenneth J Davis
parent 4ca28252da
commit 5304e657fd
19 changed files with 35 additions and 35 deletions

View File

@ -34,10 +34,11 @@
*/*/hdr/buffer.h */*/hdr/buffer.h
*/*/hdr/cds.h */*/hdr/cds.h
*/*/hdr/clock.h */*/hdr/clock.h
*/*/hdr/date.h
*/*/hdr/dcb.h */*/hdr/dcb.h
*/*/hdr/ddate.h
*/*/hdr/device.h */*/hdr/device.h
*/*/hdr/dirmatch.h */*/hdr/dirmatch.h
*/*/hdr/dtime.h
*/*/hdr/error.h */*/hdr/error.h
*/*/hdr/exe.h */*/hdr/exe.h
*/*/hdr/fat.h */*/hdr/fat.h
@ -56,7 +57,6 @@
*/*/hdr/sft.h */*/hdr/sft.h
*/*/hdr/stacks.inc */*/hdr/stacks.inc
*/*/hdr/tail.h */*/hdr/tail.h
*/*/hdr/time.h
*/*/hdr/version.h */*/hdr/version.h
*/*/hdr/xstructs.h */*/hdr/xstructs.h
*/*/kernel/nls/001-437.hc */*/kernel/nls/001-437.hc

View File

@ -51,7 +51,7 @@ static BYTE *date_hRcsId =
#define EPOCH_DAY 1 /* 1 for January 1 */ #define EPOCH_DAY 1 /* 1 for January 1 */
#define EPOCH_YEAR 1980 /* for Tues 1-1-80 epoch */ #define EPOCH_YEAR 1980 /* for Tues 1-1-80 epoch */
typedef UWORD date; typedef UWORD ddate;
#endif #endif

View File

@ -47,8 +47,8 @@ typedef struct {
UWORD reserved2; UWORD reserved2;
UBYTE dm_attr_fnd; /* found file attribute */ UBYTE dm_attr_fnd; /* found file attribute */
time dm_time; /* file time */ dtime dm_time; /* file time */
date dm_date; /* file date */ ddate dm_date; /* file date */
ULONG dm_size; /* file size */ ULONG dm_size; /* file size */
BYTE dm_name[FNAME_SIZE + FEXT_SIZE + 2]; /* file name */ BYTE dm_name[FNAME_SIZE + FEXT_SIZE + 2]; /* file name */
} dmatch; } dmatch;

View File

@ -39,7 +39,7 @@ static BYTE *time_hRcsId =
#endif #endif
#endif #endif
typedef UWORD time; typedef UWORD dtime;
struct dostime struct dostime
{ {

View File

@ -105,8 +105,8 @@ struct dirent {
UWORD dir_crdate; /* Creation date */ UWORD dir_crdate; /* Creation date */
UWORD dir_accdate; /* Last access date */ UWORD dir_accdate; /* Last access date */
UWORD dir_start_high; /* High word of the cluster */ UWORD dir_start_high; /* High word of the cluster */
time dir_time; /* Time file created/updated */ dtime dir_time; /* Time file created/updated */
date dir_date; /* Date file created/updated */ ddate dir_date; /* Date file created/updated */
UWORD dir_start; /* Starting cluster */ UWORD dir_start; /* Starting cluster */
/* 1st available = 2 */ /* 1st available = 2 */
ULONG dir_size; /* File size in bytes */ ULONG dir_size; /* File size in bytes */

View File

@ -86,8 +86,8 @@ typedef struct {
UWORD fcb_recsiz; /* Logical record size in bytes, */ UWORD fcb_recsiz; /* Logical record size in bytes, */
/* default = 128 */ /* default = 128 */
ULONG fcb_fsize; /* File size in bytes */ ULONG fcb_fsize; /* File size in bytes */
date fcb_date; /* Date file created */ ddate fcb_date; /* Date file created */
time fcb_time; /* Time of last write */ dtime fcb_time; /* Time of last write */
/* the following are reserved by system */ /* the following are reserved by system */
BYTE fcb_sftno; /* Device ID */ BYTE fcb_sftno; /* Device ID */
BYTE fcb_attrib_hi; /* share info, dev attrib word hi */ BYTE fcb_attrib_hi; /* share info, dev attrib word hi */

View File

@ -61,8 +61,8 @@ typedef struct {
#else #else
CLUSTER sft_stclust; /* 0b - Starting cluster */ CLUSTER sft_stclust; /* 0b - Starting cluster */
#endif #endif
time sft_time; /* 0d - File time */ dtime sft_time; /* 0d - File time */
date sft_date; /* 0f - File date */ ddate sft_date; /* 0f - File date */
ULONG sft_size; /* 11 - File size */ ULONG sft_size; /* 11 - File size */
ULONG sft_posit; /* 15 - Current file position */ ULONG sft_posit; /* 15 - Current file position */
UWORD sft_relclust; /* 19 - File relative cluster (low part) */ UWORD sft_relclust; /* 19 - File relative cluster (low part) */

View File

@ -1130,7 +1130,7 @@ COUNT DosFindNext(void)
return pop_dmp(rc, dmp); return pop_dmp(rc, dmp);
} }
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp) COUNT DosGetFtime(COUNT hndl, ddate * dp, dtime * tp)
{ {
sft FAR *s; sft FAR *s;
/*sfttbl FAR *sp;*/ /*sfttbl FAR *sp;*/
@ -1144,7 +1144,7 @@ COUNT DosGetFtime(COUNT hndl, date * dp, time * tp)
return SUCCESS; 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 */ /* Get the SFT block that contains the SFT */
sft FAR *s = idx_to_sft(sft_idx); sft FAR *s = idx_to_sft(sft_idx);

View File

@ -52,7 +52,7 @@ COUNT map_cluster(f_node_ptr, COUNT);
STATIC int shrink_file(f_node_ptr fnp); STATIC int shrink_file(f_node_ptr fnp);
/* FAT time notation in the form of hhhh hmmm mmmd dddd (d = double second) */ /* 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); 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 */ /* dos_getdate for the file date */
/* */ /* */
date dos_getdate(void) ddate dos_getdate(void)
{ {
struct dosdate dd; struct dosdate dd;
@ -679,7 +679,7 @@ date dos_getdate(void)
/* */ /* */
/* dos_gettime for the file time */ /* dos_gettime for the file time */
/* */ /* */
time dos_gettime(void) dtime dos_gettime(void)
{ {
struct dostime dt; struct dostime dt;

View File

@ -37,8 +37,8 @@ static BYTE *Globals_hRcsId =
#include "device.h" #include "device.h"
#include "mcb.h" #include "mcb.h"
#include "pcb.h" #include "pcb.h"
#include "date.h" #include "ddate.h"
#include "time.h" #include "dtime.h"
#include "fat.h" #include "fat.h"
#include "fcb.h" #include "fcb.h"
#include "tail.h" #include "tail.h"

View File

@ -2,8 +2,8 @@
#define IN_INIT_MOD #define IN_INIT_MOD
#include "version.h" #include "version.h"
#include "date.h" #include "ddate.h"
#include "time.h" #include "dtime.h"
#include "mcb.h" #include "mcb.h"
#include "sft.h" #include "sft.h"
#include "fat.h" #include "fat.h"

View File

@ -1200,8 +1200,8 @@ dispatch:
case 0x01: case 0x01:
rc = DosSetFtime((COUNT) lr.BX, /* Handle */ rc = DosSetFtime((COUNT) lr.BX, /* Handle */
(date) lr.DX, /* FileDate */ (ddate) lr.DX, /* FileDate */
(time) lr.CX); /* FileTime */ (dtime) lr.CX); /* FileTime */
break; break;
default: default:

View File

@ -87,7 +87,7 @@ serial.obj: serial.asm io.inc $(TARGET).lnk
HDRS=\ HDRS=\
$(HDR)portab.h $(HDR)device.h $(HDR)mcb.h $(HDR)pcb.h \ $(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)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)dirmatch.h $(HDR)file.h $(HDR)clock.h $(HDR)kbd.h $(HDR)error.h \
$(HDR)version.h dyndata.h $(HDR)version.h dyndata.h

View File

@ -102,8 +102,8 @@ COUNT DosGetCuDir(UBYTE drive, BYTE FAR * s);
COUNT DosChangeDir(BYTE FAR * s); COUNT DosChangeDir(BYTE FAR * s);
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name); COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name);
COUNT DosFindNext(void); COUNT DosFindNext(void);
COUNT DosGetFtime(COUNT hndl, date * dp, time * tp); COUNT DosGetFtime(COUNT hndl, ddate * dp, dtime * tp);
COUNT DosSetFtimeSft(int sft_idx, date dp, time tp); COUNT DosSetFtimeSft(int sft_idx, ddate dp, dtime tp);
#define DosSetFtime(hndl, dp, tp) DosSetFtimeSft(get_sft_idx(hndl), (dp), (tp)) #define DosSetFtime(hndl, dp, tp) DosSetFtimeSft(get_sft_idx(hndl), (dp), (tp))
COUNT DosGetFattr(BYTE FAR * name); COUNT DosGetFattr(BYTE FAR * name);
COUNT DosSetFattr(BYTE FAR * name, UWORD attrp); 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_delete(BYTE * path, int attrib);
COUNT dos_rmdir(BYTE * path); COUNT dos_rmdir(BYTE * path);
COUNT dos_rename(BYTE * path1, BYTE * path2, int attrib); COUNT dos_rename(BYTE * path1, BYTE * path2, int attrib);
date dos_getdate(void); ddate dos_getdate(void);
time dos_gettime(void); dtime dos_gettime(void);
COUNT dos_mkdir(BYTE * dir); COUNT dos_mkdir(BYTE * dir);
BOOL last_link(f_node_ptr fnp); BOOL last_link(f_node_ptr fnp);
COUNT map_cluster(REG f_node_ptr fnp, COUNT mode); COUNT map_cluster(REG f_node_ptr fnp, COUNT mode);

View File

@ -27,8 +27,8 @@
/****************************************************************/ /****************************************************************/
#include "portab.h" #include "portab.h"
#include "time.h" #include "dtime.h"
#include "date.h" #include "ddate.h"
#include "globals.h" #include "globals.h"
#ifdef VERSION_STRINGS #ifdef VERSION_STRINGS

View File

@ -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 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 CLDEF=1
CLT=gcc -Wall -DDOSC_TIME_H -I../hdr -o $@ CLT=gcc -Wall -I../hdr -o $@
CLC=$(CLT) 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 \# LINK=$(XLINK) -Tkernel.ld -nostdlib -Wl,-Map,kernel.map -o kernel.exe $(OBJS) -Wl,--whole-archive ../drivers/device.lib -Wl,--no-whole-archive \#

View File

@ -12,7 +12,7 @@ CP=cp
ECHOTO=echo>> ECHOTO=echo>>
INITPATCH=@echo > /dev/null INITPATCH=@echo > /dev/null
CLDEF=1 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) CLC=$(CLT)
CFLAGST=-fo=.obj $(CFLAGST) CFLAGST=-fo=.obj $(CFLAGST)
ALLCFLAGS=-fo=.obj $(ALLCFLAGS) ALLCFLAGS=-fo=.obj $(ALLCFLAGS)

View File

@ -13,7 +13,7 @@ INCLUDEPATH=$(COMPILERPATH)\h
#ECHOTO=echo>> #ECHOTO=echo>>
#INITPATCH=@echo > nul #INITPATCH=@echo > nul
CLDEF=1 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) CLC=$(CLT)
CFLAGST=-fo=.obj $(CFLAGST) CFLAGST=-fo=.obj $(CFLAGST)
ALLCFLAGS=-fo=.obj $(ALLCFLAGS) ALLCFLAGS=-fo=.obj $(ALLCFLAGS)

View File

@ -58,8 +58,8 @@
#include "device.h" #include "device.h"
#include "dcb.h" #include "dcb.h"
#include "xstructs.h" #include "xstructs.h"
#include "date.h" #include "ddate.h"
#include "../hdr/time.h" #include "dtime.h"
#include "fat.h" #include "fat.h"
/* These definitions deliberately put here instead of /* These definitions deliberately put here instead of