diff options
author | nelsonb%netscape.com <devnull@localhost> | 2002-04-04 00:00:27 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2002-04-04 00:00:27 +0000 |
commit | 51ff52096577e93fe20ce2930d5c11a5f19ea9aa (patch) | |
tree | 8fba8f1ad8ef9105c2c531d131b4cad40decfdab | |
parent | aacc0d93ce3ca381db7d4767599b4be6f491f370 (diff) | |
download | nss-hg-51ff52096577e93fe20ce2930d5c11a5f19ea9aa.tar.gz |
Add cross-platform (WinCE) support.
-rw-r--r-- | security/nss/cmd/lib/seccnames.c | 2 | ||||
-rw-r--r-- | security/nss/cmd/lib/secpwd.c | 16 | ||||
-rw-r--r-- | security/nss/cmd/lib/secutil.c | 12 | ||||
-rw-r--r-- | security/nss/cmd/rsaperf/defkey.c | 1 | ||||
-rw-r--r-- | security/nss/cmd/strsclnt/strsclnt.c | 2 | ||||
-rw-r--r-- | security/nss/cmd/zlib/zutil.h | 3 |
6 files changed, 27 insertions, 9 deletions
diff --git a/security/nss/cmd/lib/seccnames.c b/security/nss/cmd/lib/seccnames.c index 833361e41..a1857dc0e 100644 --- a/security/nss/cmd/lib/seccnames.c +++ b/security/nss/cmd/lib/seccnames.c @@ -45,7 +45,9 @@ #include "secutil.h" #include "secpkcs7.h" #include "secrng.h" +#if !defined(_WIN32_WCE) #include <sys/stat.h> +#endif #include <stdarg.h> #ifdef XP_UNIX diff --git a/security/nss/cmd/lib/secpwd.c b/security/nss/cmd/lib/secpwd.c index 57c4aac5f..8bc4eef14 100644 --- a/security/nss/cmd/lib/secpwd.c +++ b/security/nss/cmd/lib/secpwd.c @@ -46,7 +46,7 @@ #include <unistd.h> #endif -#ifdef _WINDOWS +#if defined(_WINDOWS) && !defined(_WIN32_WCE) #include <conio.h> #include <io.h> #define QUIET_FGETS quiet_fgets @@ -82,13 +82,16 @@ static void echoOn(int fd) char *SEC_GetPassword(FILE *input, FILE *output, char *prompt, PRBool (*ok)(char *)) { - char phrase[200]; - int infd = fileno(input); #if defined(_WINDOWS) || defined(OS2) int isTTY = (input == stdin); +#define echoOn(x) +#define echoOff(x) #else + int infd = fileno(input); int isTTY = isatty(infd); #endif + char phrase[200]; + for (;;) { /* Prompt for password */ if (isTTY) { @@ -167,8 +170,11 @@ static char * quiet_fgets (char *buf, int length, FILE *input) while (1) { - c = getch(); - +#if defined (_WIN32_WCE) + c = getchar(); /* gets a character from stdin */ +#else + c = getch(); /* getch gets a character from the console */ +#endif if (c == '\b') { if (end > buf) diff --git a/security/nss/cmd/lib/secutil.c b/security/nss/cmd/lib/secutil.c index f7cfb8d59..d312239f3 100644 --- a/security/nss/cmd/lib/secutil.c +++ b/security/nss/cmd/lib/secutil.c @@ -45,9 +45,11 @@ #include "secutil.h" #include "secpkcs7.h" #include "secrng.h" -#include <sys/stat.h> #include <stdarg.h> +#if !defined(_WIN32_WCE) +#include <sys/stat.h> #include <errno.h> +#endif #ifdef XP_UNIX #include <unistd.h> @@ -110,7 +112,11 @@ SECU_PrintSystemError(char *progName, char *msg, ...) va_start(args, msg); fprintf(stderr, "%s: ", progName); vfprintf(stderr, msg, args); +#if defined(_WIN32_WCE) + fprintf(stderr, ": %d\n", PR_GetOSError()); +#else fprintf(stderr, ": %s\n", strerror(errno)); +#endif va_end(args); } @@ -388,7 +394,7 @@ SECU_DefaultSSLDir(void) char *dir; static char sslDir[1000]; - dir = getenv("SSL_DIR"); + dir = PR_GetEnv("SSL_DIR"); if (!dir) return NULL; @@ -424,7 +430,7 @@ SECU_ConfigDirectory(const char* base) if (base == NULL || *base == 0) { - home = getenv("HOME"); + home = PR_GetEnv("HOME"); if (!home) home = ""; if (*home && home[strlen(home) - 1] == '/') diff --git a/security/nss/cmd/rsaperf/defkey.c b/security/nss/cmd/rsaperf/defkey.c index fe4870d77..3dd4fe36c 100644 --- a/security/nss/cmd/rsaperf/defkey.c +++ b/security/nss/cmd/rsaperf/defkey.c @@ -38,6 +38,7 @@ #include "secoidt.h" #include "lowkeyti.h" +#undef CONST #define CONST static CONST unsigned char default_n[128] = { diff --git a/security/nss/cmd/strsclnt/strsclnt.c b/security/nss/cmd/strsclnt/strsclnt.c index 29c90274e..c7dafda15 100644 --- a/security/nss/cmd/strsclnt/strsclnt.c +++ b/security/nss/cmd/strsclnt/strsclnt.c @@ -39,8 +39,10 @@ #include <unistd.h> #endif #include <stdlib.h> +#if !defined(_WIN32_WCE) #include <errno.h> #include <fcntl.h> +#endif #include <stdarg.h> #include "plgetopt.h" diff --git a/security/nss/cmd/zlib/zutil.h b/security/nss/cmd/zlib/zutil.h index 12a59356c..6918260cf 100644 --- a/security/nss/cmd/zlib/zutil.h +++ b/security/nss/cmd/zlib/zutil.h @@ -15,7 +15,8 @@ #include "zlib.h" -#if defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS) +#if defined(_WIN32_WCE) +#elif defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS) # include <stddef.h> # include <errno.h> #else |