[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/support cmdline.c,1.11,1.12 dir.c,1.16,
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/support cmdline.c,1.11,1.12 dir.c,1.16,1.17 dynlib.c,1.5,1.6 file.c,1.12,1.13 guid.c,1.2,1.3 intern.c,1.1.1.1,1.2 locale.c,1.5,1.6 mkcategory.c,1.1.1.1,1.2 mknumber.c,1.1,1.2 path.c,1.2,1.3 pt_defs.c,1.5,1.6 regex.c,1.1,1.2 socket.c,1.9,1.10 spawn.c,1.8,1.9 test_float.c,1.5,1.6time.c,1.6,1.7 |
Date: |
Wed, 14 May 2003 22:46:30 -0400 |
Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv24273/support
Modified Files:
cmdline.c dir.c dynlib.c file.c guid.c intern.c locale.c
mkcategory.c mknumber.c path.c pt_defs.c regex.c socket.c
spawn.c test_float.c time.c
Log Message:
Port the rest of the "support" layer to m68k-palmos.
Index: cmdline.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/cmdline.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** cmdline.c 16 Dec 2002 11:58:50 -0000 1.11
--- cmdline.c 15 May 2003 02:46:28 -0000 1.12
***************
*** 29,32 ****
--- 29,34 ----
#endif
+ #if !defined(__palmos__)
+
/*
* Flag that indicates if '/' parsing is suppressed.
***************
*** 690,693 ****
--- 692,721 ----
suppressSlash = 1;
}
+
+ #else /* __palmos__ */
+
+ /*
+ * Stub out the command-line handling under PalmOS.
+ */
+
+ int ILCmdLineNextOption(int *argc, char ***argv, int *state,
+ const ILCmdLineOption *options,
char **param)
+ {
+ return -1;
+ }
+
+ void ILCmdLineHelp(const ILCmdLineOption *options)
+ {
+ }
+
+ void ILCmdLineExpand(int *argc, char ***argv)
+ {
+ }
+
+ void ILCmdLineSuppressSlash(void)
+ {
+ }
+
+ #endif /* __palmos__ */
#ifdef __cplusplus
Index: dir.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/dir.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** dir.c 10 May 2003 06:56:11 -0000 1.16
--- dir.c 15 May 2003 02:46:28 -0000 1.17
***************
*** 53,56 ****
--- 53,62 ----
#endif
+ #if defined(__palmos__)
+ #define IL_NO_DIR_ROUTINES
+ #endif
+
+ #ifndef IL_NO_DIR_ROUTINES
+
ILInt32 ILDeleteDir(const char *path)
{
***************
*** 514,517 ****
--- 520,572 ----
#endif
}
+
+ #else /* IL_NO_DIR_ROUTINES */
+
+ ILInt32 ILDeleteDir(const char *path)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ ILInt32 ILRenameDir(const char *old_name, const char *new_name)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ ILInt32 ILChangeDir(const char *path)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ ILInt32 ILCreateDir(const char *path)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILGetFileType(const char *path)
+ {
+ return ILFileType_REG;
+ }
+
+ ILDir *ILOpenDir(char *path)
+ {
+ return 0;
+ }
+
+ int ILCloseDir(ILDir *dir)
+ {
+ return 0;
+ }
+
+ const char *ILDirEntName(ILDirEnt *entry)
+ {
+ return 0;
+ }
+
+ int ILDirEntType(ILDirEnt *entry)
+ {
+ return ILFileType_Unknown;
+ }
+
+ #endif /* IL_NO_DIR_ROUTINES */
#ifdef __cplusplus
Index: dynlib.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/dynlib.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** dynlib.c 27 Mar 2003 03:39:57 -0000 1.5
--- dynlib.c 15 May 2003 02:46:28 -0000 1.6
***************
*** 151,155 ****
--- 151,157 ----
void *ILDynLibraryOpen(const char *name)
{
+ #ifndef REDUCED_STDIO
fprintf(stderr, "%s: dynamic libraries are not available\n", name);
+ #endif
return 0;
}
Index: file.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/file.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** file.c 9 Jan 2003 00:18:41 -0000 1.12
--- file.c 15 May 2003 02:46:28 -0000 1.13
***************
*** 54,57 ****
--- 54,63 ----
#endif
+ #if defined(__palmos__)
+ #define IL_NO_FILE_ROUTINES
+ #endif
+
+ #ifndef IL_NO_FILE_ROUTINES
+
int ILDeleteFile(const char *filename)
{
***************
*** 545,548 ****
--- 551,696 ----
return IL_ERRNO_ENOSYS;
}
+
+ #else /* IL_NO_FILE_ROUTINES */
+
+ int ILDeleteFile(const char *filename)
+ {
+ return IL_ERRNO_ENOSYS;
+ }
+
+ int ILFileExists(const char *filename, char **newExePath)
+ {
+ return 0;
+ }
+
+ int ILSysIOGetErrno(void)
+ {
+ return ILSysIOConvertErrno(errno);
+ }
+
+ void ILSysIOSetErrno(int code)
+ {
+ code = ILSysIOConvertFromErrno(code);
+ if(code != -1)
+ {
+ errno = code;
+ }
+ else
+ {
+ errno = ENOSYS;
+ }
+ }
+
+ const char *ILSysIOGetErrnoMessage(int code)
+ {
+ #ifdef HAVE_STRERROR
+ code = ILSysIOConvertFromErrno(code);
+ if(code != -1)
+ {
+ return strerror(code);
+ }
+ else
+ {
+ return 0;
+ }
+ #else
+ return 0;
+ #endif
+ }
+
+ int ILSysIOValidatePathname(const char *path)
+ {
+ return 1;
+ }
+
+ ILSysIOHandle ILSysIOOpenFile(const char *path, ILUInt32 mode,
+ ILUInt32 access, ILUInt32
share)
+ {
+ errno = ENOENT;
+ return (ILSysIOHandle)(ILNativeInt)(-1);
+ }
+
+ int ILSysIOCheckHandleAccess(ILSysIOHandle handle, ILUInt32 access)
+ {
+ return 0;
+ }
+
+ int ILSysIOClose(ILSysIOHandle handle)
+ {
+ return 1;
+ }
+
+ ILInt32 ILSysIORead(ILSysIOHandle handle, void *buf, ILInt32 size)
+ {
+ return 0;
+ }
+
+ ILInt32 ILSysIOWrite(ILSysIOHandle handle, const void *buf, ILInt32 size)
+ {
+ return size;
+ }
+
+ ILInt64 ILSysIOSeek(ILSysIOHandle handle, ILInt64 offset, int whence)
+ {
+ return offset;
+ }
+
+ int ILSysIOFlushRead(ILSysIOHandle handle)
+ {
+ return 1;
+ }
+
+ int ILSysIOFlushWrite(ILSysIOHandle handle)
+ {
+ return 1;
+ }
+
+ ILInt32 ILCopyFile(const char *src, const char *dest)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILSysIOTruncate(ILSysIOHandle handle, ILInt64 posn)
+ {
+ errno = ENOSYS;
+ return 0;
+ }
+
+ int ILSysIOHasAsync(void)
+ {
+ return 0;
+ }
+
+ int ILSysIOPathGetLastAccess(const char *path, ILInt64 *time)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILSysIOPathGetLastModification(const char *path, ILInt64 *time)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILSysIOPathGetCreation(const char *path, ILInt64 *time)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILSysIOSetModificationTime(const char *path, ILInt64 time)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILSysIOSetAccessTime(const char *path, ILInt64 time)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ int ILSysIOSetCreationTime(const char *path, ILInt64 time)
+ {
+ return IL_ERRNO_ENOENT;
+ }
+
+ #endif /* IL_NO_FILE_ROUTINES */
#ifdef __cplusplus
Index: guid.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/guid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** guid.c 4 Dec 2001 05:07:27 -0000 1.2
--- guid.c 15 May 2003 02:46:28 -0000 1.3
***************
*** 22,26 ****
#include "il_utils.h"
#include "il_crypt.h"
! #if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
--- 22,29 ----
#include "il_utils.h"
#include "il_crypt.h"
! #if defined(__palmos__)
! #include <PalmTypes.h>
! #include <TimeMgr.h>
! #elif TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
***************
*** 56,59 ****
--- 59,64 ----
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
+ #elif defined(__palmos__)
+ UInt32 timestamp;
#else
time_t timestamp;
***************
*** 103,107 ****
--- 108,116 ----
entropySize = 8;
#else
+ #if defined(__palmos__)
+ timestamp = TimGetSeconds();
+ #else
timestamp = time(0);
+ #endif
guid[0] = (unsigned char)(timestamp >> 24);
guid[1] = (unsigned char)(timestamp >> 16);
Index: intern.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/intern.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** intern.c 13 Aug 2001 05:25:00 -0000 1.1.1.1
--- intern.c 15 May 2003 02:46:28 -0000 1.2
***************
*** 81,88 ****
--- 81,90 ----
if(!entry)
{
+ #ifndef REDUCED_STDIO
fprintf(stderr, "virtual memory exhausted - cannot intern \"");
fwrite(str, 1, len, stderr);
fprintf(stderr, "\"\n");
exit(1);
+ #endif
result.string = emptyString;
result.len = 0;
***************
*** 139,142 ****
--- 141,145 ----
if(!entry)
{
+ #ifndef REDUCED_STDIO
fprintf(stderr, "virtual memory exhausted - cannot intern \"");
fwrite(str1.string, 1, str1.len, stderr);
***************
*** 144,147 ****
--- 147,151 ----
fprintf(stderr, "\"\n");
exit(1);
+ #endif
result.string = emptyString;
result.len = 0;
Index: locale.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/locale.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** locale.c 11 Dec 2002 00:06:06 -0000 1.5
--- locale.c 15 May 2003 02:46:28 -0000 1.6
***************
*** 248,251 ****
--- 248,254 ----
char *ILGetCultureName(void)
{
+ #if defined(__palmos__)
+ return 0;
+ #else
char *env;
char name[8];
***************
*** 283,286 ****
--- 286,290 ----
name[5] = '\0';
return ILDupString(name);
+ #endif
}
Index: mkcategory.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/mkcategory.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** mkcategory.c 13 Aug 2001 05:25:00 -0000 1.1.1.1
--- mkcategory.c 15 May 2003 02:46:28 -0000 1.2
***************
*** 27,30 ****
--- 27,39 ----
#endif
+ #if defined(__palmos__)
+
+ int main(int argc, char *argv[])
+ {
+ return 0;
+ }
+
+ #else
+
/*
* Full category table.
***************
*** 282,285 ****
--- 291,296 ----
return 0;
}
+
+ #endif
#ifdef __cplusplus
Index: mknumber.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/mknumber.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** mknumber.c 23 Oct 2001 05:21:08 -0000 1.1
--- mknumber.c 15 May 2003 02:46:28 -0000 1.2
***************
*** 28,31 ****
--- 28,40 ----
#endif
+ #if defined(__palmos__)
+
+ int main(int argc, char *argv[])
+ {
+ return 0;
+ }
+
+ #else
+
/*
* Full category table.
***************
*** 224,227 ****
--- 233,238 ----
return 0;
}
+
+ #endif
#ifdef __cplusplus
Index: path.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/path.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** path.c 16 Dec 2002 04:20:40 -0000 1.2
--- path.c 15 May 2003 02:46:28 -0000 1.3
***************
*** 241,244 ****
--- 241,247 ----
char *ILSearchPath(const char *path, const char *name, int isExe)
{
+ #if defined(__palmos__)
+ return 0;
+ #else
int separator;
int len, temp;
***************
*** 347,350 ****
--- 350,354 ----
/* If we get here, then we could not locate the name */
return 0;
+ #endif
}
Index: pt_defs.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/pt_defs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** pt_defs.c 12 Jun 2002 00:44:22 -0000 1.5
--- pt_defs.c 15 May 2003 02:46:28 -0000 1.6
***************
*** 26,30 ****
#if HAVE_SYS_TIME_H
#include <sys/time.h>
! #else
#include <time.h>
#endif
--- 26,30 ----
#if HAVE_SYS_TIME_H
#include <sys/time.h>
! #elif !defined(__palmos__)
#include <time.h>
#endif
Index: regex.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/regex.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** regex.c 14 Dec 2002 22:42:27 -0000 1.1
--- regex.c 15 May 2003 02:46:28 -0000 1.2
***************
*** 21,24 ****
--- 21,26 ----
02111-1307 USA. */
+ #if !defined(__palmos__)
+
/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
***************
*** 8359,8360 ****
--- 8361,8364 ----
# define DEFINED_ONCE
+
+ #endif /* !__palmos__ */
Index: socket.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/socket.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** socket.c 12 May 2003 09:41:17 -0000 1.9
--- socket.c 15 May 2003 02:46:28 -0000 1.10
***************
*** 21,24 ****
--- 21,27 ----
#include "il_sysio.h"
#include "il_errno.h"
+
+ #ifdef IL_CONFIG_NETWORKING
+
#if TIME_WITH_SYS_TIME
#include <sys/time.h>
***************
*** 501,502 ****
--- 504,507 ----
};
#endif
+
+ #endif /* IL_CONFIG_NETWORKING */
Index: spawn.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/spawn.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** spawn.c 7 May 2003 10:48:35 -0000 1.8
--- spawn.c 15 May 2003 02:46:28 -0000 1.9
***************
*** 25,29 ****
#include <windows.h>
#include <process.h>
! #else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
--- 25,29 ----
#include <windows.h>
#include <process.h>
! #elif !defined(__palmos__)
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
***************
*** 367,371 ****
--- 367,373 ----
int ILSpawnProcess(char *argv[])
{
+ #ifndef REDUCED_STDIO
fputs("Don't know how to spawn child processes on this system\n",
stderr);
+ #endif
return -1;
}
Index: test_float.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/test_float.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** test_float.c 13 Dec 2002 11:24:47 -0000 1.5
--- test_float.c 15 May 2003 02:46:28 -0000 1.6
***************
*** 38,41 ****
--- 38,43 ----
#endif
+ #ifdef IL_CONFIG_FP_SUPPORTED
+
int ILNativeFloatIsNaN(ILNativeFloat value)
{
***************
*** 90,93 ****
--- 92,97 ----
}
}
+
+ #endif /* IL_CONFIG_FP_SUPPORTED */
#ifdef __cplusplus
Index: time.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/time.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** time.c 13 Dec 2002 11:24:47 -0000 1.6
--- time.c 15 May 2003 02:46:28 -0000 1.7
***************
*** 20,24 ****
#include "il_system.h"
! #if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
--- 20,27 ----
#include "il_system.h"
! #if defined(__palmos__)
! #include <PalmTypes.h>
! #include <TimeMgr.h>
! #elif TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
***************
*** 61,64 ****
--- 64,77 ----
#endif
+ /*
+ * Magic number that converts a time which is relative to
+ * Jan 1, 1904 into a value which is relative to Jan 1, 0001.
+ */
+ #ifdef IL_WIN32_NATIVE
+ #define PALM_EPOCH_ADJUST ((ILInt64)60052752000LL)
+ #else
+ #define PALM_EPOCH_ADJUST ((ILInt64)60052752000L)
+ #endif
+
void ILGetCurrTime(ILCurrTime *timeValue)
{
***************
*** 79,82 ****
--- 92,99 ----
timeValue->secs = (value / (ILInt64)10000000) + WIN32_EPOCH_ADJUST;
timeValue->nsecs = (ILUInt32)((value % (ILInt64)10000000) *
(ILInt64)100);
+ #elif defined(__palmos__)
+ /* Use the PalmOS routine to get the time in seconds */
+ timeValue->secs = ((ILInt64)(TimGetSeconds())) + PALM_EPOCH_ADJUST;
+ timeValue->nsecs = 0;
#else
/* Use the ANSI routine to get the time in seconds */
***************
*** 94,97 ****
--- 111,115 ----
ILInt32 ILGetTimeZoneAdjust(void)
{
+ #if !defined(__palmos__)
static int initialized = 0;
static int isdst = 0;
***************
*** 105,108 ****
--- 123,130 ----
}
return (ILInt32)(timezone - (isdst ? 3600 : 0));
+ #else
+ /* TODO */
+ return 0;
+ #endif
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/support cmdline.c,1.11,1.12 dir.c,1.16,1.17 dynlib.c,1.5,1.6 file.c,1.12,1.13 guid.c,1.2,1.3 intern.c,1.1.1.1,1.2 locale.c,1.5,1.6 mkcategory.c,1.1.1.1,1.2 mknumber.c,1.1,1.2 path.c,1.2,1.3 pt_defs.c,1.5,1.6 regex.c,1.1,1.2 socket.c,1.9,1.10 spawn.c,1.8,1.9 test_float.c,1.5,1.6time.c,1.6,1.7,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2353,1.2354
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnet/engine Makefile.am,1.58,1.59 cvmc.c,1.36,1.37 ilrun.c,1.29,1.30 ilverify.c,1.27,1.28
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2353,1.2354
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnet/engine Makefile.am,1.58,1.59 cvmc.c,1.36,1.37 ilrun.c,1.29,1.30 ilverify.c,1.27,1.28
- Index(es):