More Non-Mac Unix tweaks...now compiles, but needs more work to actually
authorRyan C. Gordon <icculus@icculus.org>
Wed, 14 Jul 2004 13:09:37 +0000
changeset 66 118c760d8e55
parent 65 35c52890a14f
child 68 f95d862e3a4e
More Non-Mac Unix tweaks...now compiles, but needs more work to actually function.
Makefile
platform_unix.c
ui_stdio.c
--- a/Makefile	Wed Jul 14 03:04:25 2004 +0000
+++ b/Makefile	Wed Jul 14 13:09:37 2004 +0000
@@ -7,7 +7,7 @@
 SRCDIR := .
 
 # must be "macosx" or "unix" or "win32" ... not all necessarily work right now.
-platform := macosx
+platform := unix
 
 # Add zlib support? Will compress all ADD/ADDORREPLACE/PATCH operations.
 # If you're going to compress the patch anyhow, this might not be wanted.
--- a/platform_unix.c	Wed Jul 14 03:04:25 2004 +0000
+++ b/platform_unix.c	Wed Jul 14 13:09:37 2004 +0000
@@ -10,6 +10,7 @@
 #include <sys/param.h>
 #include <errno.h>
 #include <assert.h>
+#include <sys/wait.h>
 
 #if USE_PTHREAD
 #include <pthread.h>
@@ -485,6 +486,42 @@
     system(cmd);
     return(1);
 } /* show_and_install_readme */
+
+
+#else  /* Regular old POSIX-compliant Unix... */
+
+int update_version(const char *ver)
+{
+    /*
+     * !!! FIXME: need some way to flag this install as updated...
+     * !!! FIXME:  maybe just leave unimplemented?
+     */
+    _fatal("Not implemented!");
+    return(0);
+} /* show_and_install_readme */
+
+int show_and_install_readme(const char *fname, const char *text)
+{
+    /*
+     * !!! FIXME: Can just dump to stdout? This should really be in the
+     * !!! FIXME:  UI modules...
+     */
+    _fatal("Not implemented!");
+    return(0);
+} /* show_and_install_readme */
+
+
+int chdir_by_identifier(const char *name, const char *str,
+                        const char *version, const char *newversion)
+{
+    /*
+     * !!! FIXME: need some way to find the program automatically...
+     * !!! FIXME:  maybe just prompt the user? Oh well.
+     */
+    _fatal("Not implemented!");
+    return(0);
+} /* chdir_by_identifier */
+
 #endif
 
 
--- a/ui_stdio.c	Wed Jul 14 03:04:25 2004 +0000
+++ b/ui_stdio.c	Wed Jul 14 13:09:37 2004 +0000
@@ -1,5 +1,6 @@
 
 #include <stdio.h>
+#include <ctype.h>
 
 #include "platform.h"
 #include "ui.h"
@@ -61,7 +62,44 @@
 
 void ui_status(const char *str)
 {
+    printf("Current operation: %s\n", str);
 } /* ui_status */
 
+
+int ui_prompt_yn(const char *question)
+{
+    int c;
+    while (1)
+    {
+        printf("%s", question);
+        c = toupper(getchar());
+        if (c == 'N')
+            return(0);
+        else if ((c == 'Y') || (c == '\r') || (c == '\n'))
+            return(1);
+        printf("\n");
+    } /* while */
+
+    return(1);
+} /* ui_prompt_yn */
+
+
+int ui_prompt_ny(const char *question)
+{
+    int c;
+    while (1)
+    {
+        printf("%s", question);
+        c = toupper(getchar());
+        if (c == 'Y')
+            return 1;
+        else if ((c == 'N') || (c == '\r') || (c == '\n'))
+            return 0;
+        printf("\n");
+    } /* while */
+
+    return(0);
+} /* ui_prompt_ny */
+
 /* end of ui_stdio.h ... */