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_proto.h, 1.81, 1.82 int_table


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h, 1.81, 1.82 int_table.c, 1.84, 1.85 lib_string.c, 1.34, 1.35
Date: Fri, 29 Aug 2003 00:58:49 -0400

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

Modified Files:
        int_proto.h int_table.c lib_string.c 
Log Message:


Internalcalls for TextInfo; remove the title case conversion table
and functions because they are not required.


Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -r1.81 -r1.82
*** int_proto.h 29 Aug 2003 04:26:55 -0000      1.81
--- int_proto.h 29 Aug 2003 04:58:47 -0000      1.82
***************
*** 458,461 ****
--- 458,466 ----
  extern ILString * _IL_ParameterBuilder_ClrParameterGetName(ILExecThread * 
_thread, ILNativeInt _p1);
  
+ extern ILUInt16 _IL_TextInfo_ToLower_c(ILExecThread * _thread, ILObject * 
_this, ILUInt16 _p1);
+ extern ILUInt16 _IL_TextInfo_ToUpper_c(ILExecThread * _thread, ILObject * 
_this, ILUInt16 _p1);
+ extern ILString * _IL_TextInfo_ToLower_String(ILExecThread * _thread, 
ILObject * _this, ILString * _p1);
+ extern ILString * _IL_TextInfo_ToUpper_String(ILExecThread * _thread, 
ILObject * _this, ILString * _p1);
+ 
  extern ILInt32 _IL_CultureInfo_InternalCultureID(ILExecThread * _thread);
  extern ILString * _IL_CultureInfo_InternalCultureName(ILExecThread * _thread);

Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -r1.84 -r1.85
*** int_table.c 29 Aug 2003 04:26:55 -0000      1.84
--- int_table.c 29 Aug 2003 04:58:47 -0000      1.85
***************
*** 2192,2195 ****
--- 2192,2215 ----
  #endif
  
+ #if !defined(HAVE_LIBFFI)
+ 
+ static void marshal_SppS(void (*fn)(), void *rvalue, void **avalue)
+ {
+       *((ILNativeUInt *)rvalue) = (*(ILUInt16 (*)(void *, void *, 
ILUInt16))fn)(*((void * *)(avalue[0])), *((void * *)(avalue[1])), *((ILUInt16 
*)(avalue[2])));
+ }
+ 
+ #endif
+ 
+ #ifndef _IL_TextInfo_suppressed
+ 
+ IL_METHOD_BEGIN(TextInfo_Methods)
+       IL_METHOD("ToLower", "(Tc)c", _IL_TextInfo_ToLower_c, marshal_SppS)
+       IL_METHOD("ToUpper", "(Tc)c", _IL_TextInfo_ToUpper_c, marshal_SppS)
+       IL_METHOD("ToLower", "(ToSystem.String;)oSystem.String;", 
_IL_TextInfo_ToLower_String, marshal_pppp)
+       IL_METHOD("ToUpper", "(ToSystem.String;)oSystem.String;", 
_IL_TextInfo_ToUpper_String, marshal_pppp)
+ IL_METHOD_END
+ 
+ #endif
+ 
  #ifndef _IL_CultureInfo_suppressed
  
***************
*** 3028,3031 ****
--- 3048,3054 ----
  #ifndef _IL_TaskMethods_suppressed
        {"TaskMethods", "Platform", TaskMethods_Methods},
+ #endif
+ #ifndef _IL_TextInfo_suppressed
+       {"TextInfo", "System.Globalization", TextInfo_Methods},
  #endif
  #ifndef _IL_Thread_suppressed

Index: lib_string.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_string.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** lib_string.c        29 Aug 2003 04:26:55 -0000      1.34
--- lib_string.c        29 Aug 2003 04:58:47 -0000      1.35
***************
*** 2,6 ****
   * lib_string.c - Internalcall methods for "System.String".
   *
!  * Copyright (C) 2001  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 2,6 ----
   * lib_string.c - Internalcall methods for "System.String".
   *
!  * Copyright (C) 2001, 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 2008,2011 ****
--- 2008,2101 ----
                return 0;
        }
+ }
+ 
+ /*
+  * public virtual char ToLower(char c);
+  */
+ ILUInt16 _IL_TextInfo_ToLower_c(ILExecThread *_thread, ILObject *_this,
+                                                               ILUInt16 c)
+ {
+       if(c >= 'A' && c <= 'Z')
+       {
+               return (ILUInt16)(c - 'A' + 'a');
+       }
+       else if(c < 0x0080)
+       {
+               return c;
+       }
+       else
+       {
+               return ILUnicodeCharToLower(c);
+       }
+ }
+ 
+ /*
+  * public virtual char ToUpper(char c);
+  */
+ ILUInt16 _IL_TextInfo_ToUpper_c(ILExecThread *_thread, ILObject *_this,
+                                                               ILUInt16 c)
+ {
+       if(c >= 'a' && c <= 'z')
+       {
+               return (ILUInt16)(c - 'a' + 'A');
+       }
+       else if(c < 0x0080)
+       {
+               return c;
+       }
+       else
+       {
+               return ILUnicodeCharToUpper(c);
+       }
+ }
+ 
+ /*
+  * public virtual String ToLower(String str);
+  */
+ ILString *_IL_TextInfo_ToLower_String(ILExecThread *_thread, ILObject *_this,
+                                                                         
ILString *str)
+ {
+       System_String *newStr;
+       ILInt32 len;
+       if(!str)
+       {
+               ILExecThreadThrowArgNull(_thread, "str");
+               return 0;
+       }
+       len = ((System_String *)str)->length;
+       newStr = AllocString(_thread, len);
+       if(!newStr)
+       {
+               return 0;
+       }
+       ILUnicodeStringToLower(StringToBuffer(newStr),
+                                                  StringToBuffer(str),
+                                                  (unsigned long)(long)len);
+       return (ILString *)newStr;
+ }
+ 
+ /*
+  * public virtual String ToUpper(String str);
+  */
+ ILString * _IL_TextInfo_ToUpper_String(ILExecThread *_thread, ILObject *_this,
+                                                                          
ILString *str)
+ {
+       System_String *newStr;
+       ILInt32 len;
+       if(!str)
+       {
+               ILExecThreadThrowArgNull(_thread, "str");
+               return 0;
+       }
+       len = ((System_String *)str)->length;
+       newStr = AllocString(_thread, len);
+       if(!newStr)
+       {
+               return 0;
+       }
+       ILUnicodeStringToUpper(StringToBuffer(newStr),
+                                                  StringToBuffer(str),
+                                                  (unsigned long)(long)len);
+       return (ILString *)newStr;
  }
  





reply via email to

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