dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/engine int_table.c,1.42,1.43 int_proto.


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine int_table.c,1.42,1.43 int_proto.h,1.40,1.41 lib_file.c,1.5,1.6
Date: Tue, 24 Dec 2002 23:12:55 -0500

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv26482/engine

Modified Files:
        int_table.c int_proto.h lib_file.c 
Log Message:
Patch #885 -- Aditya Bansod's File.Copy() implementation


Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** int_table.c 21 Dec 2002 03:02:21 -0000      1.42
--- int_table.c 25 Dec 2002 04:12:53 -0000      1.43
***************
*** 1891,1894 ****
--- 1891,1971 ----
  #if !defined(HAVE_LIBFFI)
  
+ static void marshal_bppiiip(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, void *, ILInt32, 
ILInt32, ILInt32, void *))fn)(*((void * *)(avalue[0])), *((void * 
*)(avalue[1])), *((ILInt32 *)(avalue[2])), *((ILInt32 *)(avalue[3])), 
*((ILInt32 *)(avalue[4])), *((void * *)(avalue[5])));
+ }
+ 
+ #endif
+ 
+ #if !defined(HAVE_LIBFFI)
+ 
+ static void marshal_lpjli(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILInt64 *)rvalue) = (*(ILInt64 (*)(void *, ILNativeUInt, ILInt64, 
ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((ILInt64 *)(avalue[2])), *((ILInt32 *)(avalue[3])));
+ }
+ 
+ #endif
+ 
+ #if !defined(HAVE_LIBFFI)
+ 
+ static void marshal_bpjpii(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, void *, 
ILInt32, ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((void * *)(avalue[2])), *((ILInt32 *)(avalue[3])), *((ILInt32 *)(avalue[4])));
+ }
+ 
+ #endif
+ 
+ #if !defined(HAVE_LIBFFI)
+ 
+ static void marshal_ipjpii(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILNativeInt *)rvalue) = (*(ILInt32 (*)(void *, ILNativeUInt, void *, 
ILInt32, ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((void * *)(avalue[2])), *((ILInt32 *)(avalue[3])), *((ILInt32 *)(avalue[4])));
+ }
+ 
+ #endif
+ 
+ #if !defined(HAVE_LIBFFI)
+ 
+ static void marshal_bpjl(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, 
ILInt64))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((ILInt64 *)(avalue[2])));
+ }
+ 
+ #endif
+ 
+ #if !defined(HAVE_LIBFFI)
+ 
+ static void marshal_jp(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILNativeUInt *)rvalue) = (*(ILNativeUInt (*)(void *))fn)(*((void * 
*)(avalue[0])));
+ }
+ 
+ #endif
+ 
+ #ifndef _IL_FileMethods_suppressed
+ 
+ IL_METHOD_BEGIN(FileMethods_Methods)
+       IL_METHOD("ValidatePathname", "(oSystem.String;)Z", 
_IL_FileMethods_ValidatePathname, marshal_bpp)
+       IL_METHOD("Copy", "(oSystem.String;oSystem.String;)vPlatform.Errno;", 
_IL_FileMethods_Copy, marshal_ippp)
+       IL_METHOD("Exists", "(oSystem.String;)Z", _IL_FileMethods_Exists, 
marshal_bpp)
+       IL_METHOD("GetErrnoMessage", "(vPlatform.Errno;)oSystem.String;", 
_IL_FileMethods_GetErrnoMessage, marshal_ppi)
+       IL_METHOD("Open", 
"(oSystem.String;vSystem.IO.FileMode;vSystem.IO.FileAccess;vSystem.IO.FileShare;&j)Z",
 _IL_FileMethods_Open, marshal_bppiiip)
+       IL_METHOD("GetErrno", "()vPlatform.Errno;", _IL_FileMethods_GetErrno, 
marshal_ip)
+       IL_METHOD("HasAsync", "()Z", _IL_FileMethods_HasAsync, marshal_bp)
+       IL_METHOD("CanSeek", "(j)Z", _IL_FileMethods_CanSeek, marshal_bpj)
+       IL_METHOD("CheckHandleAccess", "(jvSystem.IO.FileAccess;)Z", 
_IL_FileMethods_CheckHandleAccess, marshal_bpji)
+       IL_METHOD("Seek", "(jlvSystem.IO.SeekOrigin;)l", _IL_FileMethods_Seek, 
marshal_lpjli)
+       IL_METHOD("Write", "(j[Bii)Z", _IL_FileMethods_Write, marshal_bpjpii)
+       IL_METHOD("Close", "(j)Z", _IL_FileMethods_Close, marshal_bpj)
+       IL_METHOD("FlushWrite", "(j)Z", _IL_FileMethods_FlushWrite, marshal_bpj)
+       IL_METHOD("Read", "(j[Bii)i", _IL_FileMethods_Read, marshal_ipjpii)
+       IL_METHOD("SetLength", "(jl)Z", _IL_FileMethods_SetLength, marshal_bpjl)
+       IL_METHOD("GetInvalidHandle", "()j", _IL_FileMethods_GetInvalidHandle, 
marshal_jp)
+ IL_METHOD_END
+ 
+ #endif
+ 
+ #if !defined(HAVE_LIBFFI)
+ 
  static void marshal_vpjpipi(void (*fn)(), void *rvalue, void **avalue)
  {
***************
*** 1963,2051 ****
        IL_METHOD("GetLogicalDrives", "()[oSystem.String;", 
_IL_DirMethods_GetLogicalDrives, marshal_pp)
        IL_METHOD("GetPathInfo", "()vPlatform.PathInfo;", 
_IL_DirMethods_GetPathInfo, marshal_vpp)
-       IL_METHOD("GetCurrentDirectory", "()oSystem.String;", 
_IL_DirMethods_GetCurrentDirectory, marshal_pp)
-       IL_METHOD("ChangeDirectory", "(oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_ChangeDirectory, marshal_ipp)
-       IL_METHOD("Delete", "(oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_Delete, marshal_ipp)
-       IL_METHOD("GetLastAccess", "(oSystem.String;&l)vPlatform.Errno;", 
_IL_DirMethods_GetLastAccess, marshal_ippp)
-       IL_METHOD("GetFilesInDirectory", 
"(oSystem.String;&[vPlatform.InternalFileInfo;)vPlatform.Errno;", 
_IL_DirMethods_GetFilesInDirectory, marshal_ippp)
        IL_METHOD("Rename", "(oSystem.String;oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_Rename, marshal_ippp)
        IL_METHOD("GetCreationTime", "(oSystem.String;&l)vPlatform.Errno;", 
_IL_DirMethods_GetCreationTime, marshal_ippp)
        IL_METHOD("GetLastModification", "(oSystem.String;&l)vPlatform.Errno;", 
_IL_DirMethods_GetLastModification, marshal_ippp)
        IL_METHOD("Copy", "(oSystem.String;oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_Copy, marshal_ippp)
- IL_METHOD_END
- 
- #endif
- 
- #if !defined(HAVE_LIBFFI)
- 
- static void marshal_bppiiip(void (*fn)(), void *rvalue, void **avalue)
- {
-       *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, void *, ILInt32, 
ILInt32, ILInt32, void *))fn)(*((void * *)(avalue[0])), *((void * 
*)(avalue[1])), *((ILInt32 *)(avalue[2])), *((ILInt32 *)(avalue[3])), 
*((ILInt32 *)(avalue[4])), *((void * *)(avalue[5])));
- }
- 
- #endif
- 
- #if !defined(HAVE_LIBFFI)
- 
- static void marshal_lpjli(void (*fn)(), void *rvalue, void **avalue)
- {
-       *((ILInt64 *)rvalue) = (*(ILInt64 (*)(void *, ILNativeUInt, ILInt64, 
ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((ILInt64 *)(avalue[2])), *((ILInt32 *)(avalue[3])));
- }
- 
- #endif
- 
- #if !defined(HAVE_LIBFFI)
- 
- static void marshal_bpjpii(void (*fn)(), void *rvalue, void **avalue)
- {
-       *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, void *, 
ILInt32, ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((void * *)(avalue[2])), *((ILInt32 *)(avalue[3])), *((ILInt32 *)(avalue[4])));
- }
- 
- #endif
- 
- #if !defined(HAVE_LIBFFI)
- 
- static void marshal_ipjpii(void (*fn)(), void *rvalue, void **avalue)
- {
-       *((ILNativeInt *)rvalue) = (*(ILInt32 (*)(void *, ILNativeUInt, void *, 
ILInt32, ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((void * *)(avalue[2])), *((ILInt32 *)(avalue[3])), *((ILInt32 *)(avalue[4])));
- }
- 
- #endif
- 
- #if !defined(HAVE_LIBFFI)
- 
- static void marshal_bpjl(void (*fn)(), void *rvalue, void **avalue)
- {
-       *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, 
ILInt64))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), 
*((ILInt64 *)(avalue[2])));
- }
- 
- #endif
- 
- #if !defined(HAVE_LIBFFI)
- 
- static void marshal_jp(void (*fn)(), void *rvalue, void **avalue)
- {
-       *((ILNativeUInt *)rvalue) = (*(ILNativeUInt (*)(void *))fn)(*((void * 
*)(avalue[0])));
- }
- 
- #endif
- 
- #ifndef _IL_FileMethods_suppressed
- 
- IL_METHOD_BEGIN(FileMethods_Methods)
-       IL_METHOD("GetErrnoMessage", "(vPlatform.Errno;)oSystem.String;", 
_IL_FileMethods_GetErrnoMessage, marshal_ppi)
-       IL_METHOD("ValidatePathname", "(oSystem.String;)Z", 
_IL_FileMethods_ValidatePathname, marshal_bpp)
-       IL_METHOD("Open", 
"(oSystem.String;vSystem.IO.FileMode;vSystem.IO.FileAccess;vSystem.IO.FileShare;&j)Z",
 _IL_FileMethods_Open, marshal_bppiiip)
-       IL_METHOD("GetErrno", "()vPlatform.Errno;", _IL_FileMethods_GetErrno, 
marshal_ip)
-       IL_METHOD("HasAsync", "()Z", _IL_FileMethods_HasAsync, marshal_bp)
-       IL_METHOD("CanSeek", "(j)Z", _IL_FileMethods_CanSeek, marshal_bpj)
-       IL_METHOD("CheckHandleAccess", "(jvSystem.IO.FileAccess;)Z", 
_IL_FileMethods_CheckHandleAccess, marshal_bpji)
-       IL_METHOD("Seek", "(jlvSystem.IO.SeekOrigin;)l", _IL_FileMethods_Seek, 
marshal_lpjli)
-       IL_METHOD("Write", "(j[Bii)Z", _IL_FileMethods_Write, marshal_bpjpii)
-       IL_METHOD("Close", "(j)Z", _IL_FileMethods_Close, marshal_bpj)
-       IL_METHOD("FlushWrite", "(j)Z", _IL_FileMethods_FlushWrite, marshal_bpj)
-       IL_METHOD("Read", "(j[Bii)i", _IL_FileMethods_Read, marshal_ipjpii)
-       IL_METHOD("SetLength", "(jl)Z", _IL_FileMethods_SetLength, marshal_bpjl)
-       IL_METHOD("GetInvalidHandle", "()j", _IL_FileMethods_GetInvalidHandle, 
marshal_jp)
-       IL_METHOD("Exists", "(oSystem.String;)Z", _IL_FileMethods_Exists, 
marshal_bpp)
  IL_METHOD_END
  
--- 2040,2052 ----
        IL_METHOD("GetLogicalDrives", "()[oSystem.String;", 
_IL_DirMethods_GetLogicalDrives, marshal_pp)
        IL_METHOD("GetPathInfo", "()vPlatform.PathInfo;", 
_IL_DirMethods_GetPathInfo, marshal_vpp)
        IL_METHOD("Rename", "(oSystem.String;oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_Rename, marshal_ippp)
+       IL_METHOD("Delete", "(oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_Delete, marshal_ipp)
        IL_METHOD("GetCreationTime", "(oSystem.String;&l)vPlatform.Errno;", 
_IL_DirMethods_GetCreationTime, marshal_ippp)
+       IL_METHOD("GetLastAccess", "(oSystem.String;&l)vPlatform.Errno;", 
_IL_DirMethods_GetLastAccess, marshal_ippp)
        IL_METHOD("GetLastModification", "(oSystem.String;&l)vPlatform.Errno;", 
_IL_DirMethods_GetLastModification, marshal_ippp)
+       IL_METHOD("GetCurrentDirectory", "()oSystem.String;", 
_IL_DirMethods_GetCurrentDirectory, marshal_pp)
+       IL_METHOD("ChangeDirectory", "(oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_ChangeDirectory, marshal_ipp)
+       IL_METHOD("GetFilesInDirectory", 
"(oSystem.String;&[vPlatform.InternalFileInfo;)vPlatform.Errno;", 
_IL_DirMethods_GetFilesInDirectory, marshal_ippp)
        IL_METHOD("Copy", "(oSystem.String;oSystem.String;)vPlatform.Errno;", 
_IL_DirMethods_Copy, marshal_ippp)
  IL_METHOD_END
  

Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** int_proto.h 21 Dec 2002 03:02:21 -0000      1.40
--- int_proto.h 25 Dec 2002 04:12:53 -0000      1.41
***************
*** 380,383 ****
--- 380,400 ----
  extern ILInt32 _IL_StackFrame_InternalGetTotalFrames(ILExecThread * _thread);
  
+ extern ILBool _IL_FileMethods_ValidatePathname(ILExecThread * _thread, 
ILString * path);
+ extern ILInt32 _IL_FileMethods_Copy(ILExecThread * _thread, ILString * src, 
ILString * dest);
+ extern ILBool _IL_FileMethods_Exists(ILExecThread * _thread, ILString * path);
+ extern ILString * _IL_FileMethods_GetErrnoMessage(ILExecThread * _thread, 
ILInt32 error);
+ extern ILBool _IL_FileMethods_Open(ILExecThread * _thread, ILString * path, 
ILInt32 mode, ILInt32 access, ILInt32 share, ILNativeInt * handle);
+ extern ILInt32 _IL_FileMethods_GetErrno(ILExecThread * _thread);
+ extern ILBool _IL_FileMethods_HasAsync(ILExecThread * _thread);
+ extern ILBool _IL_FileMethods_CanSeek(ILExecThread * _thread, ILNativeInt 
handle);
+ extern ILBool _IL_FileMethods_CheckHandleAccess(ILExecThread * _thread, 
ILNativeInt handle, ILInt32 access);
+ extern ILInt64 _IL_FileMethods_Seek(ILExecThread * _thread, ILNativeInt 
handle, ILInt64 offset, ILInt32 origin);
+ extern ILBool _IL_FileMethods_Write(ILExecThread * _thread, ILNativeInt 
handle, System_Array * buffer, ILInt32 offset, ILInt32 count);
+ extern ILBool _IL_FileMethods_Close(ILExecThread * _thread, ILNativeInt 
handle);
+ extern ILBool _IL_FileMethods_FlushWrite(ILExecThread * _thread, ILNativeInt 
handle);
+ extern ILInt32 _IL_FileMethods_Read(ILExecThread * _thread, ILNativeInt 
handle, System_Array * buffer, ILInt32 offset, ILInt32 count);
+ extern ILBool _IL_FileMethods_SetLength(ILExecThread * _thread, ILNativeInt 
handle, ILInt64 value);
+ extern ILNativeInt _IL_FileMethods_GetInvalidHandle(ILExecThread * _thread);
+ 
  extern void _IL_CryptoMethods_Decrypt(ILExecThread * _thread, ILNativeInt 
state, System_Array * inBuffer, ILInt32 inOffset, System_Array * outBuffer, 
ILInt32 outOffset);
  extern void _IL_CryptoMethods_Encrypt(ILExecThread * _thread, ILNativeInt 
state, System_Array * inBuffer, ILInt32 inOffset, System_Array * outBuffer, 
ILInt32 outOffset);
***************
*** 409,437 ****
  extern System_Array * _IL_DirMethods_GetLogicalDrives(ILExecThread * _thread);
  extern void _IL_DirMethods_GetPathInfo(ILExecThread * _thread, void * 
_result);
- extern ILString * _IL_DirMethods_GetCurrentDirectory(ILExecThread * _thread);
- extern ILInt32 _IL_DirMethods_ChangeDirectory(ILExecThread * _thread, 
ILString * name);
- extern ILInt32 _IL_DirMethods_Delete(ILExecThread * _thread, ILString * path);
- extern ILInt32 _IL_DirMethods_GetLastAccess(ILExecThread * _thread, ILString 
* path, ILInt64 * lastac);
- extern ILInt32 _IL_DirMethods_GetFilesInDirectory(ILExecThread * _thread, 
ILString * path, System_Array * * files);
  extern ILInt32 _IL_DirMethods_Rename(ILExecThread * _thread, ILString * 
old_name, ILString * new_name);
  extern ILInt32 _IL_DirMethods_GetCreationTime(ILExecThread * _thread, 
ILString * path, ILInt64 * create_time);
  extern ILInt32 _IL_DirMethods_GetLastModification(ILExecThread * _thread, 
ILString * path, ILInt64 * last_mod);
  extern ILInt32 _IL_DirMethods_Copy(ILExecThread * _thread, ILString * src, 
ILString * dest);
- 
- extern ILString * _IL_FileMethods_GetErrnoMessage(ILExecThread * _thread, 
ILInt32 error);
- extern ILBool _IL_FileMethods_ValidatePathname(ILExecThread * _thread, 
ILString * path);
- extern ILBool _IL_FileMethods_Open(ILExecThread * _thread, ILString * path, 
ILInt32 mode, ILInt32 access, ILInt32 share, ILNativeInt * handle);
- extern ILInt32 _IL_FileMethods_GetErrno(ILExecThread * _thread);
- extern ILBool _IL_FileMethods_HasAsync(ILExecThread * _thread);
- extern ILBool _IL_FileMethods_CanSeek(ILExecThread * _thread, ILNativeInt 
handle);
- extern ILBool _IL_FileMethods_CheckHandleAccess(ILExecThread * _thread, 
ILNativeInt handle, ILInt32 access);
- extern ILInt64 _IL_FileMethods_Seek(ILExecThread * _thread, ILNativeInt 
handle, ILInt64 offset, ILInt32 origin);
- extern ILBool _IL_FileMethods_Write(ILExecThread * _thread, ILNativeInt 
handle, System_Array * buffer, ILInt32 offset, ILInt32 count);
- extern ILBool _IL_FileMethods_Close(ILExecThread * _thread, ILNativeInt 
handle);
- extern ILBool _IL_FileMethods_FlushWrite(ILExecThread * _thread, ILNativeInt 
handle);
- extern ILInt32 _IL_FileMethods_Read(ILExecThread * _thread, ILNativeInt 
handle, System_Array * buffer, ILInt32 offset, ILInt32 count);
- extern ILBool _IL_FileMethods_SetLength(ILExecThread * _thread, ILNativeInt 
handle, ILInt64 value);
- extern ILNativeInt _IL_FileMethods_GetInvalidHandle(ILExecThread * _thread);
- extern ILBool _IL_FileMethods_Exists(ILExecThread * _thread, ILString * path);
  
  extern ILString * _IL_InfoMethods_GetRuntimeVersion(ILExecThread * _thread);
--- 426,438 ----
  extern System_Array * _IL_DirMethods_GetLogicalDrives(ILExecThread * _thread);
  extern void _IL_DirMethods_GetPathInfo(ILExecThread * _thread, void * 
_result);
  extern ILInt32 _IL_DirMethods_Rename(ILExecThread * _thread, ILString * 
old_name, ILString * new_name);
+ extern ILInt32 _IL_DirMethods_Delete(ILExecThread * _thread, ILString * path);
  extern ILInt32 _IL_DirMethods_GetCreationTime(ILExecThread * _thread, 
ILString * path, ILInt64 * create_time);
+ extern ILInt32 _IL_DirMethods_GetLastAccess(ILExecThread * _thread, ILString 
* path, ILInt64 * lastac);
  extern ILInt32 _IL_DirMethods_GetLastModification(ILExecThread * _thread, 
ILString * path, ILInt64 * last_mod);
+ extern ILString * _IL_DirMethods_GetCurrentDirectory(ILExecThread * _thread);
+ extern ILInt32 _IL_DirMethods_ChangeDirectory(ILExecThread * _thread, 
ILString * name);
+ extern ILInt32 _IL_DirMethods_GetFilesInDirectory(ILExecThread * _thread, 
ILString * path, System_Array * * files);
  extern ILInt32 _IL_DirMethods_Copy(ILExecThread * _thread, ILString * src, 
ILString * dest);
  
  extern ILString * _IL_InfoMethods_GetRuntimeVersion(ILExecThread * _thread);

Index: lib_file.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_file.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** lib_file.c  21 Dec 2002 03:02:21 -0000      1.5
--- lib_file.c  25 Dec 2002 04:12:53 -0000      1.6
***************
*** 194,195 ****
--- 194,210 ----
        }
  }
+ 
+ /*
+  * public static Errno Copy(String src, String dest);
+  */
+ ILInt32 _IL_FileMethods_Copy(ILExecThread *_thread,
+                                                       ILString *src, ILString 
*dest)
+ {
+       char * src_ansi  = ILStringToAnsi(_thread, src );
+       char * dest_ansi = ILStringToAnsi(_thread, dest);
+       if(src_ansi == NULL || dest_ansi == NULL)
+       {
+               return IL_ERRNO_ENOMEM;
+       }
+       return ILCopyFile(src_ansi, dest_ansi);
+ }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]