Changeset 1735 for trunk/src


Ignore:
Timestamp:
Nov 14, 1999, 2:09:59 PM (26 years ago)
Author:
achimha
Message:

implemented most missing undocumented string function

Location:
trunk/src/comctl32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/comctl32.def

    r1565 r1735  
    1 ; $Id: comctl32.def,v 1.12 1999-11-02 21:44:01 achimha Exp $
     1; $Id: comctl32.def,v 1.13 1999-11-14 13:09:58 achimha Exp $
    22LIBRARY COMCTL32 INITINSTANCE
    33DESCRIPTION 'COMCTL32 Common Controls Library'
     
    132132  StrChrW             = _COMCTL32_StrChrW@8        @358
    133133  StrCmpNA            = _COMCTL32_StrCmpNA@12      @352
     134  StrCmpNIA           = _COMCTL32_StrCmpNIA@12     @353
    134135  StrCmpNW            = _COMCTL32_StrCmpNW@12      @360
    135136  StrRChrA            = _COMCTL32_StrRChrA@12      @351
  • trunk/src/comctl32/comctl32undoc.c

    r1615 r1735  
    1 /* $Id: comctl32undoc.c,v 1.14 1999-11-05 13:01:32 achimha Exp $ */
     1/* $Id: comctl32undoc.c,v 1.15 1999-11-14 13:09:59 achimha Exp $ */
    22/*
    33 * Undocumented functions from COMCTL32.DLL
     
    18311831 */
    18321832LPWSTR WINAPI COMCTL32_StrChrW( LPCWSTR lpStart, WORD wMatch) {
    1833   dprintf(("COMCTL32: StrChrW - unimplemented stub\n"));
    1834 //  return CRTDLL_wcschr(lpStart, wMatch);
    1835   return 0;
     1833  return (unsigned short*)wcschr(lpStart, wMatch);
    18361834}
    18371835
     
    18451843
    18461844/**************************************************************************
     1845 * StrCmpNIA [COMCTL32.353]
     1846 *
     1847 */
     1848INT WINAPI COMCTL32_StrCmpNIA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) {
     1849  //AH: Inline helper function from WINE
     1850    int res;
     1851    if (!nChar) return 0;
     1852    while ((--nChar > 0) && *lpStr1)
     1853      if ((res = toupper(*lpStr1++) - toupper(*lpStr2++))) return res;
     1854    return toupper(*lpStr1) - toupper(*lpStr2);
     1855}
     1856
     1857/**************************************************************************
    18471858 * StrCmpNW [COMCTL32.360]
    18481859 *
    18491860 */
    18501861INT WINAPI COMCTL32_StrCmpNW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) {
    1851   dprintf(("COMCTL32: StrCmpNW - unimplemented stub\n"));
    1852 //  return lstrncmpW(lpStr1, lpStr2, nChar);
    1853   return 0;
     1862  return wcsncmp(lpStr1, lpStr2, nChar);
    18541863}
    18551864
     
    18641873}
    18651874
     1875/***********************************************************************
     1876 *           ChrCmpA   
     1877 * This fuction returns FALSE if both words match, TRUE otherwise...
     1878 */
     1879static BOOL ChrCmpA( WORD word1, WORD word2) {
     1880  if (LOBYTE(word1) == LOBYTE(word2)) {
     1881    if (IsDBCSLeadByte(LOBYTE(word1))) {
     1882      return (word1 != word2);
     1883    }
     1884    return FALSE;
     1885  }
     1886  return TRUE;
     1887}
     1888
    18661889/**************************************************************************
    18671890 * StrRChrA [COMCTL32.351]
     
    18691892 */
    18701893LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch) {
    1871   dprintf(("COMCTL32: lstrrchr - unimplemented stub\n"));
    1872 //  return lstrrchr(lpStart, lpEnd, wMatch);
     1894  LPCSTR lpGotIt = NULL;
     1895
     1896  if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
     1897
     1898  for(; lpStart < lpEnd; lpStart = CharNextA(lpStart))
     1899    if (!ChrCmpA( GET_WORD(lpStart), wMatch))
     1900      lpGotIt = lpStart;
     1901   
     1902  return ((LPSTR)lpGotIt);
     1903
    18731904  return 0;
    18741905}
    18751906
     1907/***********************************************************************
     1908 *           ChrCmpW   
     1909 * This fuction returns FALSE if both words match, TRUE otherwise...
     1910 */
     1911static BOOL ChrCmpW( WORD word1, WORD word2) {
     1912  return (word1 != word2);
     1913}
     1914
    18761915/**************************************************************************
    18771916 * StrRChrW [COMCTL32.359]
    18781917 *
    18791918 */
    1880 LPWSTR WINAPI COMCTL32_StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch) {
    1881   dprintf(("COMCTL32: StrRChrW - unimplemented stub\n"));
    1882 //  return lstrrchrw(lpStart, lpEnd, wMatch);
    1883   return 0;
    1884 }
     1919LPWSTR WINAPI COMCTL32_StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch)
     1920{
     1921  //AH: Inline Wine helper function
     1922  LPCWSTR lpGotIt = NULL;
     1923
     1924  if (!lpEnd) lpEnd = lpStart + lstrlenW(lpStart);
     1925
     1926  for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
     1927    if (!ChrCmpW( GET_WORD(lpStart), wMatch))
     1928      lpGotIt = lpStart;
     1929   
     1930  return (LPWSTR)lpGotIt;
     1931}
     1932
    18851933
    18861934/**************************************************************************
     
    18971945 */
    18981946LPWSTR WINAPI COMCTL32_StrStrW( LPCWSTR lpFirst, LPCWSTR lpSrch) {
    1899   dprintf(("COMCTL32: StrStrW - unimplemented stub\n"));
    1900 //  return strstrw(lpFirst, lpSrch);
    1901   return 0;
     1947  return (unsigned short*)wcsstr(lpFirst, lpSrch);
    19021948}
    19031949
     
    19091955  LPWSTR lpLoop = lpStr;
    19101956
    1911   dprintf(("COMCTL32: StrSpnW - unimplemented stub\n"));
    1912   return 0;
    1913 
    19141957  /* validate ptr */
    19151958  if ((lpStr == 0) || (lpSet == 0)) return 0;
     
    19171960/* while(*lpLoop) { if lpLoop++; } */
    19181961
    1919 //  for(; (*lpLoop != 0); lpLoop++)
    1920 //    if( CRTDLL_wcschr(lpSet, *(WORD*)lpLoop))
    1921 //      return (INT)(lpLoop-lpStr);
    1922 
    1923 //  return (INT)(lpLoop-lpStr);
     1962  for(; (*lpLoop != 0); lpLoop++)
     1963    if (wcschr(lpSet, *(WORD*)lpLoop))
     1964      return (INT)(lpLoop-lpStr);
     1965
     1966  return (INT)(lpLoop-lpStr);
    19241967}
    19251968
Note: See TracChangeset for help on using the changeset viewer.