Win32 API 日本語リファレンス
ホームGlobalization › u_foldCase

u_foldCase

関数
文字をケースフォールディング(大小無視化)する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

// icuuc.dll
#include <windows.h>

INT u_foldCase(
    INT c,
    DWORD options
);

パラメーター

名前方向
cINTin
optionsDWORDin

戻り値の型: INT

各言語での呼び出し定義

// icuuc.dll
#include <windows.h>

INT u_foldCase(
    INT c,
    DWORD options
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int u_foldCase(
    int c,   // INT
    uint options   // DWORD
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function u_foldCase(
    c As Integer,   ' INT
    options As UInteger   ' DWORD
) As Integer
End Function
' c : INT
' options : DWORD
Declare PtrSafe Function u_foldCase Lib "icuuc" ( _
    ByVal c As Long, _
    ByVal options As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

u_foldCase = ctypes.cdll.icuuc.u_foldCase
u_foldCase.restype = ctypes.c_int
u_foldCase.argtypes = [
    ctypes.c_int,  # c : INT
    wintypes.DWORD,  # options : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
u_foldCase = Fiddle::Function.new(
  lib['u_foldCase'],
  [
    Fiddle::TYPE_INT,  # c : INT
    -Fiddle::TYPE_INT,  # options : DWORD
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn u_foldCase(
        c: i32,  // INT
        options: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int u_foldCase(int c, uint options);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_u_foldCase' -Namespace Win32 -PassThru
# $api::u_foldCase(c, options)
#uselib "icuuc.dll"
#func global u_foldCase "u_foldCase" sptr, sptr
; u_foldCase c, options   ; 戻り値は stat
; c : INT -> "sptr"
; options : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global u_foldCase "u_foldCase" int, int
; res = u_foldCase(c, options)
; c : INT -> "int"
; options : DWORD -> "int"
; INT u_foldCase(INT c, DWORD options)
#uselib "icuuc.dll"
#cfunc global u_foldCase "u_foldCase" int, int
; res = u_foldCase(c, options)
; c : INT -> "int"
; options : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procu_foldCase = icuuc.NewProc("u_foldCase")
)

// c (INT), options (DWORD)
r1, _, err := procu_foldCase.Call(
	uintptr(c),
	uintptr(options),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function u_foldCase(
  c: Integer;   // INT
  options: DWORD   // DWORD
): Integer; cdecl;
  external 'icuuc.dll' name 'u_foldCase';
result := DllCall("icuuc\u_foldCase"
    , "Int", c   ; INT
    , "UInt", options   ; DWORD
    , "Cdecl Int")   ; return: INT
●u_foldCase(c, options) = DLL("icuuc.dll", "int u_foldCase(int, dword)")
# 呼び出し: u_foldCase(c, options)
# c : INT -> "int"
# options : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。