ホーム › Globalization › umutablecptrie_fromUCPTrie
umutablecptrie_fromUCPTrie
関数不変トライから可変トライを生成する。
シグネチャ
// icu.dll
#include <windows.h>
UMutableCPTrie* umutablecptrie_fromUCPTrie(
const UCPTrie* trie,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| trie | UCPTrie* | in |
| pErrorCode | UErrorCode* | inout |
戻り値の型: UMutableCPTrie*
各言語での呼び出し定義
// icu.dll
#include <windows.h>
UMutableCPTrie* umutablecptrie_fromUCPTrie(
const UCPTrie* trie,
UErrorCode* pErrorCode
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr umutablecptrie_fromUCPTrie(
IntPtr trie, // UCPTrie*
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function umutablecptrie_fromUCPTrie(
trie As IntPtr, ' UCPTrie*
ByRef pErrorCode As Integer ' UErrorCode* in/out
) As IntPtr
End Function' trie : UCPTrie*
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function umutablecptrie_fromUCPTrie Lib "icu" ( _
ByVal trie As LongPtr, _
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_fromUCPTrie = ctypes.cdll.icu.umutablecptrie_fromUCPTrie
umutablecptrie_fromUCPTrie.restype = ctypes.c_void_p
umutablecptrie_fromUCPTrie.argtypes = [
ctypes.c_void_p, # trie : UCPTrie*
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icu.dll')
umutablecptrie_fromUCPTrie = Fiddle::Function.new(
lib['umutablecptrie_fromUCPTrie'],
[
Fiddle::TYPE_VOIDP, # trie : UCPTrie*
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "icu")]
extern "C" {
fn umutablecptrie_fromUCPTrie(
trie: *const UCPTrie, // UCPTrie*
pErrorCode: *mut i32 // UErrorCode* in/out
) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr umutablecptrie_fromUCPTrie(IntPtr trie, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_umutablecptrie_fromUCPTrie' -Namespace Win32 -PassThru
# $api::umutablecptrie_fromUCPTrie(trie, pErrorCode)#uselib "icu.dll"
#func global umutablecptrie_fromUCPTrie "umutablecptrie_fromUCPTrie" sptr, sptr
; umutablecptrie_fromUCPTrie varptr(trie), pErrorCode ; 戻り値は stat
; trie : UCPTrie* -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icu.dll" #cfunc global umutablecptrie_fromUCPTrie "umutablecptrie_fromUCPTrie" var, int ; res = umutablecptrie_fromUCPTrie(trie, pErrorCode) ; trie : UCPTrie* -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icu.dll" #cfunc global umutablecptrie_fromUCPTrie "umutablecptrie_fromUCPTrie" sptr, int ; res = umutablecptrie_fromUCPTrie(varptr(trie), pErrorCode) ; trie : UCPTrie* -> "sptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; UMutableCPTrie* umutablecptrie_fromUCPTrie(UCPTrie* trie, UErrorCode* pErrorCode) #uselib "icu.dll" #cfunc global umutablecptrie_fromUCPTrie "umutablecptrie_fromUCPTrie" var, int ; res = umutablecptrie_fromUCPTrie(trie, pErrorCode) ; trie : UCPTrie* -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; UMutableCPTrie* umutablecptrie_fromUCPTrie(UCPTrie* trie, UErrorCode* pErrorCode) #uselib "icu.dll" #cfunc global umutablecptrie_fromUCPTrie "umutablecptrie_fromUCPTrie" intptr, int ; res = umutablecptrie_fromUCPTrie(varptr(trie), pErrorCode) ; trie : UCPTrie* -> "intptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icu = windows.NewLazySystemDLL("icu.dll")
procumutablecptrie_fromUCPTrie = icu.NewProc("umutablecptrie_fromUCPTrie")
)
// trie (UCPTrie*), pErrorCode (UErrorCode* in/out)
r1, _, err := procumutablecptrie_fromUCPTrie.Call(
uintptr(trie),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UMutableCPTrie*function umutablecptrie_fromUCPTrie(
trie: Pointer; // UCPTrie*
pErrorCode: Pointer // UErrorCode* in/out
): Pointer; cdecl;
external 'icu.dll' name 'umutablecptrie_fromUCPTrie';result := DllCall("icu\umutablecptrie_fromUCPTrie"
, "Ptr", trie ; UCPTrie*
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Ptr") ; return: UMutableCPTrie*●umutablecptrie_fromUCPTrie(trie, pErrorCode) = DLL("icu.dll", "void* umutablecptrie_fromUCPTrie(void*, void*)")
# 呼び出し: umutablecptrie_fromUCPTrie(trie, pErrorCode)
# trie : UCPTrie* -> "void*"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。