[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnet/engine lib_serial.c, NONE, 1.1 Makefile.am, 1
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnet/engine lib_serial.c, NONE, 1.1 Makefile.am, 1.67, 1.68 int_proto.h, 1.88, 1.89 int_table.c, 1.91, 1.92 |
Date: |
Tue, 04 Nov 2003 06:51:15 +0000 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv6816/engine
Modified Files:
Makefile.am int_proto.h int_table.c
Added Files:
lib_serial.c
Log Message:
Stub out internalcalls for "PortMethods".
Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/Makefile.am,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** Makefile.am 3 Nov 2003 05:18:21 -0000 1.67
--- Makefile.am 4 Nov 2003 06:51:12 -0000 1.68
***************
*** 37,40 ****
--- 37,41 ----
lib_regexp.c \
lib_security.c \
+ lib_serial.c \
lib_socket.c \
lib_stdio.c \
--- NEW FILE: lib_serial.c ---
/*
* lib_serial.c - Internalcall methods for the "Platform.PortMethods" class.
*
* Copyright (C) 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "engine.h"
#include "lib_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Serial port parameters. Must match "PortMethods.Parameters".
*/
typedef struct
{
ILInt32 baudRate;
ILInt32 parity;
ILInt32 dataBits;
ILInt32 stopBits;
ILInt32 handshake;
ILUInt8 parityReplace;
ILBool discardNull;
ILInt32 readBufferSize;
ILInt32 writeBufferSize;
ILInt32 receivedBytesThreshold;
ILInt32 readTimeout;
ILInt32 writeTimeout;
} SerialParameters;
/*
* Serial port types.
*/
#define IL_SERIAL_REGULAR 0
#define IL_SERIAL_INFRARED 1
/*
* Bits for various serial pins.
*/
#define IL_PIN_BREAK (1<<0)
#define IL_PIN_CD (1<<1)
#define IL_PIN_CTS (1<<2)
#define IL_PIN_DSR (1<<3)
#define IL_PIN_DTR (1<<4)
#define IL_PIN_RTS (1<<5)
/*
* public static bool IsValid(int type, int portNumber);
*/
ILBool _IL_PortMethods_IsValid
(ILExecThread *_thread, ILInt32 type, ILInt32
portNumber)
{
/* TODO */
return 0;
}
/*
* public static bool IsAccessible(int type, int portNumber);
*/
ILBool _IL_PortMethods_IsAccessible
(ILExecThread *_thread, ILInt32 type, ILInt32
portNumber)
{
/* TODO */
return 0;
}
/*
* public static IntPtr Open(int type, int portNumber,
* Parameters parameters);
*/
ILNativeInt _IL_PortMethods_Open(ILExecThread *_thread, ILInt32 type,
ILInt32
portNumber, ILObject *parameters)
{
/* TODO */
return 0;
}
/*
* public static void Close(IntPtr handle);
*/
void _IL_PortMethods_Close(ILExecThread *_thread, ILNativeInt handle)
{
/* TODO */
}
/*
* public static void Modify(IntPtr handle, Parameters parameters);
*/
void _IL_PortMethods_Modify(ILExecThread *_thread, ILNativeInt handle,
ILObject *parameters)
{
/* TODO */
}
/*
* public static int GetBytesToRead(IntPtr handle);
*/
ILInt32 _IL_PortMethods_GetBytesToRead(ILExecThread *_thread,
ILNativeInt handle)
{
/* TODO */
return 0;
}
/*
* public static int GetBytesToWrite(IntPtr handle);
*/
ILInt32 _IL_PortMethods_GetBytesToWrite(ILExecThread *_thread,
ILNativeInt handle)
{
/* TODO */
return 0;
}
/*
* public static int ReadPins(IntPtr handle);
*/
ILInt32 _IL_PortMethods_ReadPins(ILExecThread *_thread, ILNativeInt handle)
{
/* TODO */
return 0;
}
/*
* public static void WritePins(IntPtr handle, int mask, int value);
*/
void _IL_PortMethods_WritePins(ILExecThread *_thread,
ILNativeInt handle,
ILInt32 mask,
ILInt32 value)
{
/* TODO */
}
/*
* public static void GetRecommendedBufferSizes
* (out int readBufferSize, out int writeBufferSize,
* out int receivedBytesThreshold);
*/
void _IL_PortMethods_GetRecommendedBufferSizes
(ILExecThread *_thread, ILInt32 *readBufferSize,
ILInt32 *writeBufferSize, ILInt32
*receivedBytesThreshold)
{
/* TODO */
*readBufferSize = 1024;
*writeBufferSize = 1024;
*receivedBytesThreshold = 768;
}
/*
* public static void DiscardInBuffer(IntPtr handle);
*/
void _IL_PortMethods_DiscardInBuffer(ILExecThread *_thread, ILNativeInt handle)
{
/* TODO */
}
/*
* public static void DiscardOutBuffer(IntPtr handle);
*/
void _IL_PortMethods_DiscardOutBuffer(ILExecThread *_thread, ILNativeInt handle)
{
/* TODO */
}
/*
* public static void DrainOutBuffer(IntPtr handle);
*/
void _IL_PortMethods_DrainOutBuffer(ILExecThread * _thread, ILNativeInt handle)
{
/* TODO */
}
/*
* public static int Read(IntPtr handle, byte[] buffer, int offset, int count);
*/
ILInt32 _IL_PortMethods_Read(ILExecThread *_thread, ILNativeInt handle,
System_Array *buffer,
ILInt32 offset,
ILInt32 count)
{
/* TODO */
return 0;
}
/*
* public static void Write
* (IntPtr handle, byte[] buffer, int offset, int count);
*/
void _IL_PortMethods_Write(ILExecThread *_thread, ILNativeInt handle,
System_Array *buffer,
ILInt32 offset,
ILInt32 count)
{
/* TODO */
}
#ifdef __cplusplus
};
#endif
Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -d -r1.88 -r1.89
*** int_proto.h 2 Nov 2003 02:48:47 -0000 1.88
--- int_proto.h 4 Nov 2003 06:51:12 -0000 1.89
***************
*** 501,504 ****
--- 501,505 ----
extern void _IL_Stdio_Clear(ILExecThread * _thread);
extern void _IL_Stdio_ReadKey(ILExecThread * _thread, ILUInt16 * ch, ILInt32
* key, ILInt32 * modifiers);
+ extern void _IL_Stdio_StdWrite_ic(ILExecThread * _thread, ILInt32 fd,
ILUInt16 value);
extern void _IL_Stdio_SetCursorPosition(ILExecThread * _thread, ILInt32 x,
ILInt32 y);
extern void _IL_Stdio_SetTextAttributes(ILExecThread * _thread, ILInt32
attrs);
***************
*** 515,519 ****
extern ILInt32 _IL_Stdio_StdRead_iaBii(ILExecThread * _thread, ILInt32 fd,
System_Array * value, ILInt32 index, ILInt32 count);
extern void _IL_Stdio_StdWrite_iaBii(ILExecThread * _thread, ILInt32 fd,
System_Array * value, ILInt32 index, ILInt32 count);
- extern void _IL_Stdio_StdWrite_ic(ILExecThread * _thread, ILInt32 fd,
ILUInt16 value);
extern void _IL_Stdio_StdWrite_iacii(ILExecThread * _thread, ILInt32 fd,
System_Array * value, ILInt32 index, ILInt32 count);
extern void _IL_Stdio_StdWrite_iString(ILExecThread * _thread, ILInt32 fd,
ILString * value);
--- 516,519 ----
***************
*** 650,653 ****
--- 650,669 ----
extern ILObject * _IL_SocketMethods_CreateManualResetEvent(ILExecThread *
_thread);
extern void _IL_SocketMethods_WaitHandleSet(ILExecThread * _thread, ILObject
* waitHandle);
+
+ extern void _IL_PortMethods_GetRecommendedBufferSizes(ILExecThread * _thread,
ILInt32 * readBufferSize, ILInt32 * writeBufferSize, ILInt32 *
receivedBytesThreshold);
+ extern ILBool _IL_PortMethods_IsValid(ILExecThread * _thread, ILInt32 type,
ILInt32 portNumber);
+ extern void _IL_PortMethods_Modify(ILExecThread * _thread, ILNativeInt
handle, ILObject * parameters);
+ extern ILInt32 _IL_PortMethods_GetBytesToRead(ILExecThread * _thread,
ILNativeInt handle);
+ extern ILInt32 _IL_PortMethods_GetBytesToWrite(ILExecThread * _thread,
ILNativeInt handle);
+ extern ILInt32 _IL_PortMethods_ReadPins(ILExecThread * _thread, ILNativeInt
handle);
+ extern void _IL_PortMethods_WritePins(ILExecThread * _thread, ILNativeInt
handle, ILInt32 mask, ILInt32 value);
+ extern void _IL_PortMethods_Close(ILExecThread * _thread, ILNativeInt handle);
+ extern void _IL_PortMethods_DiscardInBuffer(ILExecThread * _thread,
ILNativeInt handle);
+ extern void _IL_PortMethods_DiscardOutBuffer(ILExecThread * _thread,
ILNativeInt handle);
+ extern ILBool _IL_PortMethods_IsAccessible(ILExecThread * _thread, ILInt32
type, ILInt32 portNumber);
+ extern ILNativeInt _IL_PortMethods_Open(ILExecThread * _thread, ILInt32 type,
ILInt32 portNumber, ILObject * parameters);
+ extern void _IL_PortMethods_DrainOutBuffer(ILExecThread * _thread,
ILNativeInt handle);
+ extern ILInt32 _IL_PortMethods_Read(ILExecThread * _thread, ILNativeInt
handle, System_Array * buffer, ILInt32 offset, ILInt32 count);
+ extern void _IL_PortMethods_Write(ILExecThread * _thread, ILNativeInt handle,
System_Array * buffer, ILInt32 offset, ILInt32 count);
extern ILInt32 _IL_IPAddress_HostToNetworkOrder_i(ILExecThread * _thread,
ILInt32 host);
Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** int_table.c 2 Nov 2003 02:48:47 -0000 1.91
--- int_table.c 4 Nov 2003 06:51:13 -0000 1.92
***************
*** 2302,2305 ****
--- 2302,2314 ----
#if !defined(HAVE_LIBFFI)
+ static void marshal_vpiS(void (*fn)(), void *rvalue, void **avalue)
+ {
+ (*(void (*)(void *, ILInt32, ILUInt16))fn)(*((void * *)(avalue[0])),
*((ILInt32 *)(avalue[1])), *((ILUInt16 *)(avalue[2])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
static void marshal_vpii(void (*fn)(), void *rvalue, void **avalue)
{
***************
*** 2336,2348 ****
#endif
- #if !defined(HAVE_LIBFFI)
-
- static void marshal_vpiS(void (*fn)(), void *rvalue, void **avalue)
- {
- (*(void (*)(void *, ILInt32, ILUInt16))fn)(*((void * *)(avalue[0])),
*((ILInt32 *)(avalue[1])), *((ILUInt16 *)(avalue[2])));
- }
-
- #endif
-
#ifndef _IL_Stdio_suppressed
--- 2345,2348 ----
***************
*** 2352,2355 ****
--- 2352,2356 ----
IL_METHOD("Clear", "()V", _IL_Stdio_Clear, marshal_vp)
IL_METHOD("ReadKey", "(&c&i&i)V", _IL_Stdio_ReadKey, marshal_vpppp)
+ IL_METHOD("StdWrite", "(ic)V", _IL_Stdio_StdWrite_ic, marshal_vpiS)
IL_METHOD("SetCursorPosition", "(ii)V", _IL_Stdio_SetCursorPosition,
marshal_vpii)
IL_METHOD("SetTextAttributes", "(i)V", _IL_Stdio_SetTextAttributes,
marshal_vpi)
***************
*** 2366,2370 ****
IL_METHOD("StdRead", "(i[Bii)i", _IL_Stdio_StdRead_iaBii,
marshal_ipipii)
IL_METHOD("StdWrite", "(i[Bii)V", _IL_Stdio_StdWrite_iaBii,
marshal_vpipii)
- IL_METHOD("StdWrite", "(ic)V", _IL_Stdio_StdWrite_ic, marshal_vpiS)
IL_METHOD("StdWrite", "(i[cii)V", _IL_Stdio_StdWrite_iacii,
marshal_vpipii)
IL_METHOD("StdWrite", "(ioSystem.String;)V",
_IL_Stdio_StdWrite_iString, marshal_vpip)
--- 2367,2370 ----
***************
*** 2840,2843 ****
--- 2840,2883 ----
#if !defined(HAVE_LIBFFI)
+ static void marshal_bpii(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILInt32,
ILInt32))fn)(*((void * *)(avalue[0])), *((ILInt32 *)(avalue[1])), *((ILInt32
*)(avalue[2])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_jpiip(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeUInt *)rvalue) = (*(ILNativeUInt (*)(void *, ILInt32,
ILInt32, void *))fn)(*((void * *)(avalue[0])), *((ILInt32 *)(avalue[1])),
*((ILInt32 *)(avalue[2])), *((void * *)(avalue[3])));
+ }
+
+ #endif
+
+ #ifndef _IL_PortMethods_suppressed
+
+ IL_METHOD_BEGIN(PortMethods_Methods)
+ IL_METHOD("GetRecommendedBufferSizes", "(&i&i&i)V",
_IL_PortMethods_GetRecommendedBufferSizes, marshal_vpppp)
+ IL_METHOD("IsValid", "(ii)Z", _IL_PortMethods_IsValid, marshal_bpii)
+ IL_METHOD("Modify", "(joPlatform.PortMethods/Parameters;)V",
_IL_PortMethods_Modify, marshal_vpjp)
+ IL_METHOD("GetBytesToRead", "(j)i", _IL_PortMethods_GetBytesToRead,
marshal_ipj)
+ IL_METHOD("GetBytesToWrite", "(j)i", _IL_PortMethods_GetBytesToWrite,
marshal_ipj)
+ IL_METHOD("ReadPins", "(j)i", _IL_PortMethods_ReadPins, marshal_ipj)
+ IL_METHOD("WritePins", "(jii)V", _IL_PortMethods_WritePins,
marshal_vpjii)
+ IL_METHOD("Close", "(j)V", _IL_PortMethods_Close, marshal_vpj)
+ IL_METHOD("DiscardInBuffer", "(j)V", _IL_PortMethods_DiscardInBuffer,
marshal_vpj)
+ IL_METHOD("DiscardOutBuffer", "(j)V", _IL_PortMethods_DiscardOutBuffer,
marshal_vpj)
+ IL_METHOD("IsAccessible", "(ii)Z", _IL_PortMethods_IsAccessible,
marshal_bpii)
+ IL_METHOD("Open", "(iioPlatform.PortMethods/Parameters;)j",
_IL_PortMethods_Open, marshal_jpiip)
+ IL_METHOD("DrainOutBuffer", "(j)V", _IL_PortMethods_DrainOutBuffer,
marshal_vpj)
+ IL_METHOD("Read", "(j[Bii)i", _IL_PortMethods_Read, marshal_ipjpii)
+ IL_METHOD("Write", "(j[Bii)V", _IL_PortMethods_Write, marshal_vpjpii)
+ IL_METHOD_END
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
static void marshal_lpl(void (*fn)(), void *rvalue, void **avalue)
{
***************
*** 3064,3067 ****
--- 3104,3110 ----
#ifndef _IL_ParameterBuilder_suppressed
{"ParameterBuilder", "System.Reflection.Emit",
ParameterBuilder_Methods},
+ #endif
+ #ifndef _IL_PortMethods_suppressed
+ {"PortMethods", "Platform", PortMethods_Methods},
#endif
#ifndef _IL_Process_suppressed
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnet/engine lib_serial.c, NONE, 1.1 Makefile.am, 1.67, 1.68 int_proto.h, 1.88, 1.89 int_table.c, 1.91, 1.92,
Rhys Weatherley <address@hidden> <=