зеркало из https://github.com/mozilla/pjs.git
Add cross-platform (WinCE) support.
This commit is contained in:
Родитель
967e460a03
Коммит
8cff0b44bc
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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] == '/')
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "secoidt.h"
|
||||
#include "lowkeyti.h"
|
||||
|
||||
#undef CONST
|
||||
#define CONST
|
||||
|
||||
static CONST unsigned char default_n[128] = {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* $Id: zutil.h,v 1.1 2000-03-31 20:13:19 relyea%netscape.com Exp $ */
|
||||
/* $Id: zutil.h,v 1.2 2002-04-04 00:00:18 nelsonb%netscape.com Exp $ */
|
||||
|
||||
#ifndef _Z_UTIL_H
|
||||
#define _Z_UTIL_H
|
||||
|
||||
#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
|
||||
|
|
Загрузка…
Ссылка в новой задаче