Some MSVCRT MultiByte Function Semistubs

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Jul 11 12:48:42 CDT 2001


Hallo,

appended patch lets VC msdev.exe proceed some more steps with bulitin
msvcrt. The functions added are semistubs, implementing only the pure ascii
side of the functions mostly, warning the user however with a fixme if a
real multibyte string is given.

Changelog
	dlls/msvcrt/msvcrt.spec, dlls/msvcrt/msvcrt/mbcs.c
	Semistubs for _ismbcdigit,_ismbcspace,_mbslwr,_mbsnbcmp,_mbsspn
	
Bye

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/msvcrt/msvcrt.spec
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/msvcrt.spec,v
retrieving revision 1.18
diff -u -r1.18 msvcrt.spec
--- wine/dlls/msvcrt/msvcrt.spec	2001/06/19 03:46:27	1.18
+++ wine/dlls/msvcrt/msvcrt.spec	2001/07/11 17:44:29
@@ -299,7 +299,7 @@
 @ cdecl _ismbbtrail(long) _ismbbtrail
 @ stub _ismbcalnum #(long)
 @ stub _ismbcalpha #(long)
-@ stub _ismbcdigit #(long)
+@ cdecl _ismbcdigit (long) _ismbcdigit
 @ stub _ismbcgraph #(long)
 @ cdecl _ismbchira(long) _ismbchira
 @ cdecl _ismbckata(long) _ismbckata
@@ -310,7 +310,7 @@
 @ stub _ismbclower #(long)
 @ stub _ismbcprint #(long)
 @ stub _ismbcpunct #(long)
-@ stub _ismbcspace #(long)
+@ cdecl _ismbcspace (long) _ismbcspace
 @ stub _ismbcsymbol #(long)
 @ stub _ismbcupper #(long)
 @ cdecl _ismbslead(ptr ptr) _ismbslead
@@ -364,12 +364,12 @@
 @ stub _mbsicoll #(str str)
 @ cdecl _mbsinc(str) _mbsinc
 @ cdecl _mbslen(str) _mbslen
-@ stub _mbslwr #(str)
+@ cdecl _mbslwr (str)_mbslwr
 @ stub _mbsnbcat #(str str long)
-@ stub _mbsnbcmp #(str str long)
+@ cdecl _mbsnbcmp (str str long) _mbsnbcmp
 @ stub _mbsnbcnt #(ptr long)
 @ stub _mbsnbcoll #(str str long)
-@ stub _mbsnbcpy #(ptr str long)
+@ cdecl _mbsnbcpy (ptr str long) _mbsnbcpy
 @ stub _mbsnbicmp #(str str long)
 @ stub _mbsnbicoll #(str str long)
 @ stub _mbsnbset #(str long long)
@@ -387,7 +387,7 @@
 @ cdecl _mbsrchr(str long) _mbsrchr
 @ stub _mbsrev #(str)
 @ cdecl _mbsset(str long) _mbsset
-@ stub _mbsspn #(str str)
+@ cdecl _mbsspn (str str) _mbsspn
 @ stub _mbsspnp #(str str)
 @ cdecl _mbsstr(str str) strstr
 @ stub _mbstok #(str str)
Index: wine/dlls/msvcrt/mbcs.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/mbcs.c,v
retrieving revision 1.6
diff -u -r1.6 mbcs.c
--- wine/dlls/msvcrt/mbcs.c	2001/06/19 18:20:48	1.6
+++ wine/dlls/msvcrt/mbcs.c	2001/07/11 17:44:29
@@ -495,3 +495,103 @@
   return strncat(dst, src, len); /* ASCII CP */
 }
 
+/*********************************************************************
+ *              _ismbcdigit(MSVCRT.@)
+ */
+int _ismbcdigit( unsigned int ch)
+{
+  if (ch <0x100)
+    return isdigit(ch);
+  else 
+    {
+      FIXME("Handle MBC chars\n");
+      return 0;
+    }
+}
+/*********************************************************************
+ *              _mbsnbcmp(MSVCRT.@)
+ */
+
+int _mbsnbcmp( const unsigned char *str,const unsigned char *cmp, MSVCRT_size_t len )
+{
+
+  if (!len)
+    return 0;
+  if(MSVCRT___mb_cur_max > 1)
+    {
+      FIXME("%s %s %d\n",str,cmp,len);
+      return 0;
+    }
+  return strncmp(str,cmp,len);
+}
+
+/*********************************************************************
+ *              _mbslwr(MSVCRT.@)
+ */
+unsigned char * _mbslwr(  unsigned char *string    )
+{
+  unsigned char *p;
+ 
+  if(MSVCRT___mb_cur_max > 1)
+    {
+      FIXME("%s\n",string);
+      return string;
+    }
+  p = string;
+  while (*p)
+    {
+      *p= tolower(*p);
+      p++;
+    }
+  return string;
+}
+/*********************************************************************
+ *              _mbsnbcpy(MSVCRT.@)
+ */
+unsigned char * _mbsnbcpy(unsigned char *dest,const unsigned char *src,MSVCRT_size_t n)
+{
+  if(MSVCRT___mb_cur_max > 1)
+    {
+      FIXME("%s %d\n",src,n);
+      return dest;
+    }
+  return strncpy(dest, src, n);
+}
+/*********************************************************************
+ *              __mbsspn(MSVCRT.@)
+ */
+MSVCRT_size_t _mbsspn(const unsigned char *string, const unsigned char *set)
+{
+  char *p=(char *)string ,*q;
+
+  for (;*p; p++)
+    {
+      if (MSVCRT_isleadbyte(*p))
+	{
+	  for (q= (char *)set; *q; q++)
+	    {
+	      if (!q[1])
+		break;
+	      if ((*p == *q) &&  (p[1] == q[1]))
+		break;
+	      q++;
+	    }
+	  if (*++p == '\0')
+	    break;
+	}
+      else
+	for (q= (char *)set; *q; q++)
+	  if (*p == *q)
+	    break;
+    }
+  return (DWORD)p - (DWORD)string;
+}
+
+int _ismbcspace( unsigned int c)
+{
+
+  if (c <0x100)
+    return isspace(c);
+  FIXME("%c\n",c);
+  return 0;
+}




More information about the wine-patches mailing list