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