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

umutablecptrie_buildImmutable

関数
可変トライから不変コードポイントトライを構築する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

UCPTrie* umutablecptrie_buildImmutable(
    UMutableCPTrie* trie,
    UCPTrieType type,
    UCPTrieValueWidth valueWidth,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
trieUMutableCPTrie*inout
typeUCPTrieTypein
valueWidthUCPTrieValueWidthin
pErrorCodeUErrorCode*inout

戻り値の型: UCPTrie*

各言語での呼び出し定義

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

UCPTrie* umutablecptrie_buildImmutable(
    UMutableCPTrie* trie,
    UCPTrieType type,
    UCPTrieValueWidth valueWidth,
    UErrorCode* pErrorCode
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr umutablecptrie_buildImmutable(
    ref IntPtr trie,   // UMutableCPTrie* in/out
    int type,   // UCPTrieType
    int valueWidth,   // UCPTrieValueWidth
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function umutablecptrie_buildImmutable(
    ByRef trie As IntPtr,   ' UMutableCPTrie* in/out
    type As Integer,   ' UCPTrieType
    valueWidth As Integer,   ' UCPTrieValueWidth
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' trie : UMutableCPTrie* in/out
' type : UCPTrieType
' valueWidth : UCPTrieValueWidth
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function umutablecptrie_buildImmutable Lib "icu" ( _
    ByRef trie As LongPtr, _
    ByVal type As Long, _
    ByVal valueWidth As Long, _
    ByRef pErrorCode As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

umutablecptrie_buildImmutable = ctypes.cdll.icu.umutablecptrie_buildImmutable
umutablecptrie_buildImmutable.restype = ctypes.c_void_p
umutablecptrie_buildImmutable.argtypes = [
    ctypes.c_void_p,  # trie : UMutableCPTrie* in/out
    ctypes.c_int,  # type : UCPTrieType
    ctypes.c_int,  # valueWidth : UCPTrieValueWidth
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
umutablecptrie_buildImmutable = Fiddle::Function.new(
  lib['umutablecptrie_buildImmutable'],
  [
    Fiddle::TYPE_VOIDP,  # trie : UMutableCPTrie* in/out
    Fiddle::TYPE_INT,  # type : UCPTrieType
    Fiddle::TYPE_INT,  # valueWidth : UCPTrieValueWidth
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icu")]
extern "C" {
    fn umutablecptrie_buildImmutable(
        trie: *mut isize,  // UMutableCPTrie* in/out
        type: i32,  // UCPTrieType
        valueWidth: i32,  // UCPTrieValueWidth
        pErrorCode: *mut i32  // UErrorCode* in/out
    ) -> *mut UCPTrie;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr umutablecptrie_buildImmutable(ref IntPtr trie, int type, int valueWidth, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_umutablecptrie_buildImmutable' -Namespace Win32 -PassThru
# $api::umutablecptrie_buildImmutable(trie, type, valueWidth, pErrorCode)
#uselib "icu.dll"
#func global umutablecptrie_buildImmutable "umutablecptrie_buildImmutable" sptr, sptr, sptr, sptr
; umutablecptrie_buildImmutable trie, type, valueWidth, pErrorCode   ; 戻り値は stat
; trie : UMutableCPTrie* in/out -> "sptr"
; type : UCPTrieType -> "sptr"
; valueWidth : UCPTrieValueWidth -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icu.dll"
#cfunc global umutablecptrie_buildImmutable "umutablecptrie_buildImmutable" int, int, int, int
; res = umutablecptrie_buildImmutable(trie, type, valueWidth, pErrorCode)
; trie : UMutableCPTrie* in/out -> "int"
; type : UCPTrieType -> "int"
; valueWidth : UCPTrieValueWidth -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; UCPTrie* umutablecptrie_buildImmutable(UMutableCPTrie* trie, UCPTrieType type, UCPTrieValueWidth valueWidth, UErrorCode* pErrorCode)
#uselib "icu.dll"
#cfunc global umutablecptrie_buildImmutable "umutablecptrie_buildImmutable" int, int, int, int
; res = umutablecptrie_buildImmutable(trie, type, valueWidth, pErrorCode)
; trie : UMutableCPTrie* in/out -> "int"
; type : UCPTrieType -> "int"
; valueWidth : UCPTrieValueWidth -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procumutablecptrie_buildImmutable = icu.NewProc("umutablecptrie_buildImmutable")
)

// trie (UMutableCPTrie* in/out), type (UCPTrieType), valueWidth (UCPTrieValueWidth), pErrorCode (UErrorCode* in/out)
r1, _, err := procumutablecptrie_buildImmutable.Call(
	uintptr(trie),
	uintptr(type),
	uintptr(valueWidth),
	uintptr(pErrorCode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // UCPTrie*
function umutablecptrie_buildImmutable(
  trie: Pointer;   // UMutableCPTrie* in/out
  type: Integer;   // UCPTrieType
  valueWidth: Integer;   // UCPTrieValueWidth
  pErrorCode: Pointer   // UErrorCode* in/out
): Pointer; cdecl;
  external 'icu.dll' name 'umutablecptrie_buildImmutable';
result := DllCall("icu\umutablecptrie_buildImmutable"
    , "Ptr", trie   ; UMutableCPTrie* in/out
    , "Int", type   ; UCPTrieType
    , "Int", valueWidth   ; UCPTrieValueWidth
    , "Ptr", pErrorCode   ; UErrorCode* in/out
    , "Cdecl Ptr")   ; return: UCPTrie*
●umutablecptrie_buildImmutable(trie, type, valueWidth, pErrorCode) = DLL("icu.dll", "void* umutablecptrie_buildImmutable(void*, int, int, void*)")
# 呼び出し: umutablecptrie_buildImmutable(trie, type, valueWidth, pErrorCode)
# trie : UMutableCPTrie* in/out -> "void*"
# type : UCPTrieType -> "int"
# valueWidth : UCPTrieValueWidth -> "int"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。