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

umutablecptrie_fromUCPMap

関数
コードポイントマップから可変トライを生成する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

UMutableCPTrie* umutablecptrie_fromUCPMap(
    const UCPMap* map,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
mapUCPMap*in
pErrorCodeUErrorCode*inout

戻り値の型: UMutableCPTrie*

各言語での呼び出し定義

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

UMutableCPTrie* umutablecptrie_fromUCPMap(
    const UCPMap* map,
    UErrorCode* pErrorCode
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr umutablecptrie_fromUCPMap(
    ref IntPtr map,   // UCPMap*
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function umutablecptrie_fromUCPMap(
    ByRef map As IntPtr,   ' UCPMap*
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' map : UCPMap*
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function umutablecptrie_fromUCPMap Lib "icu" ( _
    ByRef map 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_fromUCPMap = ctypes.cdll.icu.umutablecptrie_fromUCPMap
umutablecptrie_fromUCPMap.restype = ctypes.c_void_p
umutablecptrie_fromUCPMap.argtypes = [
    ctypes.c_void_p,  # map : UCPMap*
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
umutablecptrie_fromUCPMap = Fiddle::Function.new(
  lib['umutablecptrie_fromUCPMap'],
  [
    Fiddle::TYPE_VOIDP,  # map : UCPMap*
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icu")]
extern "C" {
    fn umutablecptrie_fromUCPMap(
        map: *const isize,  // UCPMap*
        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_fromUCPMap(ref IntPtr map, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_umutablecptrie_fromUCPMap' -Namespace Win32 -PassThru
# $api::umutablecptrie_fromUCPMap(map, pErrorCode)
#uselib "icu.dll"
#func global umutablecptrie_fromUCPMap "umutablecptrie_fromUCPMap" sptr, sptr
; umutablecptrie_fromUCPMap map, pErrorCode   ; 戻り値は stat
; map : UCPMap* -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icu.dll"
#cfunc global umutablecptrie_fromUCPMap "umutablecptrie_fromUCPMap" int, int
; res = umutablecptrie_fromUCPMap(map, pErrorCode)
; map : UCPMap* -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; UMutableCPTrie* umutablecptrie_fromUCPMap(UCPMap* map, UErrorCode* pErrorCode)
#uselib "icu.dll"
#cfunc global umutablecptrie_fromUCPMap "umutablecptrie_fromUCPMap" int, int
; res = umutablecptrie_fromUCPMap(map, pErrorCode)
; map : UCPMap* -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procumutablecptrie_fromUCPMap = icu.NewProc("umutablecptrie_fromUCPMap")
)

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