ホーム › Globalization › u_strFoldCase
u_strFoldCase
関数文字列をケースフォールドして正規化する。
シグネチャ
// icuuc.dll
#include <windows.h>
INT u_strFoldCase(
WORD* dest,
INT destCapacity,
const WORD* src,
INT srcLength,
DWORD options,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dest | WORD* | inout |
| destCapacity | INT | in |
| src | WORD* | in |
| srcLength | INT | in |
| options | DWORD | in |
| pErrorCode | UErrorCode* | inout |
戻り値の型: INT
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
INT u_strFoldCase(
WORD* dest,
INT destCapacity,
const WORD* src,
INT srcLength,
DWORD options,
UErrorCode* pErrorCode
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int u_strFoldCase(
ref ushort dest, // WORD* in/out
int destCapacity, // INT
ref ushort src, // WORD*
int srcLength, // INT
uint options, // DWORD
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function u_strFoldCase(
ByRef dest As UShort, ' WORD* in/out
destCapacity As Integer, ' INT
ByRef src As UShort, ' WORD*
srcLength As Integer, ' INT
options As UInteger, ' DWORD
ByRef pErrorCode As Integer ' UErrorCode* in/out
) As Integer
End Function' dest : WORD* in/out
' destCapacity : INT
' src : WORD*
' srcLength : INT
' options : DWORD
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function u_strFoldCase Lib "icuuc" ( _
ByRef dest As Integer, _
ByVal destCapacity As Long, _
ByRef src As Integer, _
ByVal srcLength As Long, _
ByVal options As Long, _
ByRef pErrorCode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
u_strFoldCase = ctypes.cdll.icuuc.u_strFoldCase
u_strFoldCase.restype = ctypes.c_int
u_strFoldCase.argtypes = [
ctypes.POINTER(ctypes.c_ushort), # dest : WORD* in/out
ctypes.c_int, # destCapacity : INT
ctypes.POINTER(ctypes.c_ushort), # src : WORD*
ctypes.c_int, # srcLength : INT
wintypes.DWORD, # options : DWORD
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
u_strFoldCase = Fiddle::Function.new(
lib['u_strFoldCase'],
[
Fiddle::TYPE_VOIDP, # dest : WORD* in/out
Fiddle::TYPE_INT, # destCapacity : INT
Fiddle::TYPE_VOIDP, # src : WORD*
Fiddle::TYPE_INT, # srcLength : INT
-Fiddle::TYPE_INT, # options : DWORD
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn u_strFoldCase(
dest: *mut u16, // WORD* in/out
destCapacity: i32, // INT
src: *const u16, // WORD*
srcLength: i32, // INT
options: u32, // DWORD
pErrorCode: *mut i32 // UErrorCode* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int u_strFoldCase(ref ushort dest, int destCapacity, ref ushort src, int srcLength, uint options, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_u_strFoldCase' -Namespace Win32 -PassThru
# $api::u_strFoldCase(dest, destCapacity, src, srcLength, options, pErrorCode)#uselib "icuuc.dll"
#func global u_strFoldCase "u_strFoldCase" sptr, sptr, sptr, sptr, sptr, sptr
; u_strFoldCase varptr(dest), destCapacity, varptr(src), srcLength, options, pErrorCode ; 戻り値は stat
; dest : WORD* in/out -> "sptr"
; destCapacity : INT -> "sptr"
; src : WORD* -> "sptr"
; srcLength : INT -> "sptr"
; options : DWORD -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuuc.dll" #cfunc global u_strFoldCase "u_strFoldCase" var, int, var, int, int, int ; res = u_strFoldCase(dest, destCapacity, src, srcLength, options, pErrorCode) ; dest : WORD* in/out -> "var" ; destCapacity : INT -> "int" ; src : WORD* -> "var" ; srcLength : INT -> "int" ; options : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #cfunc global u_strFoldCase "u_strFoldCase" sptr, int, sptr, int, int, int ; res = u_strFoldCase(varptr(dest), destCapacity, varptr(src), srcLength, options, pErrorCode) ; dest : WORD* in/out -> "sptr" ; destCapacity : INT -> "int" ; src : WORD* -> "sptr" ; srcLength : INT -> "int" ; options : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT u_strFoldCase(WORD* dest, INT destCapacity, WORD* src, INT srcLength, DWORD options, UErrorCode* pErrorCode) #uselib "icuuc.dll" #cfunc global u_strFoldCase "u_strFoldCase" var, int, var, int, int, int ; res = u_strFoldCase(dest, destCapacity, src, srcLength, options, pErrorCode) ; dest : WORD* in/out -> "var" ; destCapacity : INT -> "int" ; src : WORD* -> "var" ; srcLength : INT -> "int" ; options : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT u_strFoldCase(WORD* dest, INT destCapacity, WORD* src, INT srcLength, DWORD options, UErrorCode* pErrorCode) #uselib "icuuc.dll" #cfunc global u_strFoldCase "u_strFoldCase" intptr, int, intptr, int, int, int ; res = u_strFoldCase(varptr(dest), destCapacity, varptr(src), srcLength, options, pErrorCode) ; dest : WORD* in/out -> "intptr" ; destCapacity : INT -> "int" ; src : WORD* -> "intptr" ; srcLength : INT -> "int" ; options : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procu_strFoldCase = icuuc.NewProc("u_strFoldCase")
)
// dest (WORD* in/out), destCapacity (INT), src (WORD*), srcLength (INT), options (DWORD), pErrorCode (UErrorCode* in/out)
r1, _, err := procu_strFoldCase.Call(
uintptr(dest),
uintptr(destCapacity),
uintptr(src),
uintptr(srcLength),
uintptr(options),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction u_strFoldCase(
dest: Pointer; // WORD* in/out
destCapacity: Integer; // INT
src: Pointer; // WORD*
srcLength: Integer; // INT
options: DWORD; // DWORD
pErrorCode: Pointer // UErrorCode* in/out
): Integer; cdecl;
external 'icuuc.dll' name 'u_strFoldCase';result := DllCall("icuuc\u_strFoldCase"
, "Ptr", dest ; WORD* in/out
, "Int", destCapacity ; INT
, "Ptr", src ; WORD*
, "Int", srcLength ; INT
, "UInt", options ; DWORD
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Int") ; return: INT●u_strFoldCase(dest, destCapacity, src, srcLength, options, pErrorCode) = DLL("icuuc.dll", "int u_strFoldCase(void*, int, void*, int, dword, void*)")
# 呼び出し: u_strFoldCase(dest, destCapacity, src, srcLength, options, pErrorCode)
# dest : WORD* in/out -> "void*"
# destCapacity : INT -> "int"
# src : WORD* -> "void*"
# srcLength : INT -> "int"
# options : DWORD -> "dword"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。