Skip to content

Commit

Permalink
More Non-Mac Unix tweaks...now compiles, but needs more work to actually
Browse files Browse the repository at this point in the history
 function.
  • Loading branch information
icculus committed Jul 14, 2004
1 parent f782418 commit 2539e7b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -7,7 +7,7 @@ BINDIR := bin
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.
Expand Down
37 changes: 37 additions & 0 deletions platform_unix.c
Expand Up @@ -10,6 +10,7 @@
#include <sys/param.h>
#include <errno.h>
#include <assert.h>
#include <sys/wait.h>

#if USE_PTHREAD
#include <pthread.h>
Expand Down Expand Up @@ -485,6 +486,42 @@ int show_and_install_readme(const char *fname, const char *text)
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


Expand Down
38 changes: 38 additions & 0 deletions ui_stdio.c
@@ -1,5 +1,6 @@

#include <stdio.h>
#include <ctype.h>

#include "platform.h"
#include "ui.h"
Expand Down Expand Up @@ -61,7 +62,44 @@ void ui_total_progress(int percent)

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 ... */

0 comments on commit 2539e7b

Please sign in to comment.