Removed all PDOS related stuff
authorRobert Pengelly <robertapengelly@hotmail.com>
Wed, 19 Aug 2026 09:44:39 +0000 (10:44 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Wed, 19 Aug 2026 09:44:39 +0000 (10:44 +0100)
Makefile.std [deleted file]
e2cp.c
report.c

diff --git a/Makefile.std b/Makefile.std
deleted file mode 100644 (file)
index 9d0263d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#******************************************************************************
-# @file             Makefile.std
-#******************************************************************************
-AS=pdas --oformat coff
-CC=gccwin
-LD=pdld --no-insert-timestamp
-
-COPTS=-S -O2 -fno-common -ansi -I. -I../pdos/pdpclib -D__WIN32__ -D__NOBIVA__ -D__PDOS__
-COBJ=cache.obj common.obj list.obj report.obj
-
-all: clean mke2fs.exe e2cp.exe e2md.exe mke2nod.exe
-
-mke2fs.exe: mke2fs.obj $(COBJ)
-  $(LD) -s -o mke2fs.exe ../pdos/pdpclib/w32start.obj mke2fs.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-e2cp.exe: e2cp.obj $(COBJ)
-  $(LD) -s -o e2cp.exe ../pdos/pdpclib/w32start.obj e2cp.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-e2md.exe: e2md.obj $(COBJ)
-  $(LD) -s -o e2md.exe ../pdos/pdpclib/w32start.obj e2md.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-mke2nod.exe: mke2nod.obj $(COBJ)
-  $(LD) -s -o mke2nod.exe ../pdos/pdpclib/w32start.obj mke2nod.obj $(COBJ) ../pdos/pdpclib/msvcrt.lib
-
-.c.obj:
-  $(CC) $(COPTS) $<
-  $(AS) -o $@ $*.s
-  rm -f $*.s
-
-clean:
-  rm -f *.obj
-  rm -f mke2fs.exe
-  rm -f e2cp.exe
-  rm -f e2md.exe
-  rm -f mke2nod.exe
diff --git a/e2cp.c b/e2cp.c
index 2a0b458d77678eadcb9be5e9719dba033edecab9..fe2c09776d0e09a32dc3ca88b4ba8c23b21d7b74 100644 (file)
--- a/e2cp.c
+++ b/e2cp.c
@@ -438,23 +438,21 @@ static int walk_path (struct filesystem *fs, char *dirname) {
 
 }
 
-#ifndef     __PDOS__
-# if    defined (_WIN32)
-#  include  <windows.h>
-#  include  <winioctl.h>
-# elif defined (__GNUC__)
-#  include  <sys/ioctl.h>
-#  include  <termios.h>
-#  include  <unistd.h>
-#  if   defined (__CYGWIN__)
-#   include  <sys/socket.h>
-#  endif
+#if     defined (_WIN32)
+# include   <windows.h>
+# include   <winioctl.h>
+#elif defined (__GNUC__)
+# include   <sys/ioctl.h>
+# include   <termios.h>
+# include   <unistd.h>
+# if   defined (__CYGWIN__)
+#  include  <sys/socket.h>
 # endif
 
 /** Get a single character from the terminal. */
 static char getch (void) {
 
-#if     defined(_WIN32) && !defined (__PDOS__)
+#if     defined(_WIN32)
 
     KEY_EVENT_RECORD keyevent;
     INPUT_RECORD irec;
@@ -519,20 +517,10 @@ static char getch (void) {
     
     }
 
-#else
-
-    int key;
-    
-#if     defined (__PDOS__)
-
-    setvbuf (stdin, NULL, _IONBF, 0);
-    
-    for (;;) {
-
 #else
 
     struct termios term;
-    int nbbytes;
+    int nbbytes, key;
     
     tcgetattr (0, &term);
     
@@ -604,14 +592,8 @@ static char getch (void) {
         
         }
         
-#if     defined (__PDOS__)
-        setvbuf (stdin, NULL, _IOLBF, 0);
-#else
-
         term.c_lflag |= (ICANON | ECHO);                    /* turn on line buffering and echoing */
         tcsetattr (0, TCSANOW, &term);
-
-#endif
         
         switch (key) {
         
@@ -673,17 +655,9 @@ static char getch (void) {
 #endif
 
 }
-#endif
 
 static int check_overwrite (const char *fn) {
 
-#if     defined (__PDOS__)
-
-    report_at (NULL, 0, REPORT_WARNING, "overwriting %s", fn);
-    return 1;
-
-#else
-
     int ch;
     
     printf ("File %s already exists.\n", fn);
@@ -705,8 +679,6 @@ static int check_overwrite (const char *fn) {
     
     return check_overwrite (fn);
 
-#endif
-
 }
 
 static void copy_file (struct filesystem *fs, FILE *fp, unsigned long parent_nod, char *target) {
index 8e128ef31f46400f43a7afab03f4526adf5fcc2c..7ac81783cdf746714d0733d3055ccd99f6ab09ba 100644 (file)
--- a/report.c
+++ b/report.c
@@ -9,16 +9,20 @@
 
 unsigned long errors = 0;
 
-#ifndef     __PDOS__
-#if     defined (_WIN32)
+#if     defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__)
+static void reset_console_color (void) {
+    fprintf (stderr, "\033[0m");
+}
+
+static void set_console_color (int color) {
+    fprintf (stderr, "\033[%dm", color);
+}
+#elif   defined (_WIN32)
 # include   <windows.h>
 static int OriginalConsoleColor = -1;
-#endif
 
 static void reset_console_color (void) {
 
-#if     defined (_WIN32)
-
     HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE);
     
     if (OriginalConsoleColor == -1) { return; }
@@ -26,18 +30,10 @@ static void reset_console_color (void) {
     SetConsoleTextAttribute (hStdError, OriginalConsoleColor);
     OriginalConsoleColor = -1;
 
-#else
-
-    fprintf (stderr, "\033[0m");
-
-#endif
-
 }
 
 static void set_console_color (int color) {
 
-#if     defined (_WIN32)
-
     HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE);
     WORD wColor;
     
@@ -56,12 +52,6 @@ static void set_console_color (int color) {
     wColor = (OriginalConsoleColor & 0xF0) + (color & 0xF);
     SetConsoleTextAttribute (hStdError, wColor);
 
-#else
-
-    fprintf (stderr, "\033[%dm", color);
-
-#endif
-
 }
 #endif
 
@@ -93,7 +83,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned
     
     if (type == REPORT_ERROR || type == REPORT_FATAL_ERROR) {
     
-#ifndef     __PDOS__
+#if     defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
         set_console_color (COLOR_ERROR);
 #endif
         
@@ -105,7 +95,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned
     
     } else if (type == REPORT_INTERNAL_ERROR) {
     
-#ifndef     __PDOS__
+#if     defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
         set_console_color (COLOR_INTERNAL_ERROR);
 #endif
         
@@ -113,7 +103,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned
     
     } else if (type == REPORT_WARNING) {
     
-#ifndef     __PDOS__
+#if     defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
         set_console_color (COLOR_WARNING);
 #endif
         
@@ -121,7 +111,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned
     
     }
     
-#ifndef     __PDOS__
+#if     defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32)
     reset_console_color ();
 #endif