ホーム › Globalization › ucptrie_getRange
ucptrie_getRange
関数コードポイントトライで同一値が連続する範囲を取得する。
シグネチャ
// icu.dll
#include <windows.h>
INT ucptrie_getRange(
const UCPTrie* trie,
INT start,
UCPMapRangeOption option,
DWORD surrogateValue,
UCPMapValueFilter* filter,
const void* context,
DWORD* pValue
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| trie | UCPTrie* | 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 ucptrie_getRange(
const UCPTrie* 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 ucptrie_getRange(
IntPtr trie, // UCPTrie*
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 ucptrie_getRange(
trie As IntPtr, ' UCPTrie*
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 : UCPTrie*
' start : INT
' option : UCPMapRangeOption
' surrogateValue : DWORD
' filter : UCPMapValueFilter* in/out
' context : void*
' pValue : DWORD* in/out
Declare PtrSafe Function ucptrie_getRange Lib "icu" ( _
ByVal 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
ucptrie_getRange = ctypes.cdll.icu.ucptrie_getRange
ucptrie_getRange.restype = ctypes.c_int
ucptrie_getRange.argtypes = [
ctypes.c_void_p, # trie : UCPTrie*
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')
ucptrie_getRange = Fiddle::Function.new(
lib['ucptrie_getRange'],
[
Fiddle::TYPE_VOIDP, # trie : UCPTrie*
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 ucptrie_getRange(
trie: *const UCPTrie, // UCPTrie*
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 ucptrie_getRange(IntPtr trie, int start, int option, uint surrogateValue, IntPtr filter, IntPtr context, ref uint pValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_ucptrie_getRange' -Namespace Win32 -PassThru
# $api::ucptrie_getRange(trie, start, option, surrogateValue, filter, context, pValue)#uselib "icu.dll"
#func global ucptrie_getRange "ucptrie_getRange" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ucptrie_getRange varptr(trie), start, option, surrogateValue, filter, context, varptr(pValue) ; 戻り値は stat
; trie : UCPTrie* -> "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 ucptrie_getRange "ucptrie_getRange" var, int, int, int, sptr, sptr, var ; res = ucptrie_getRange(trie, start, option, surrogateValue, filter, context, pValue) ; trie : UCPTrie* -> "var" ; 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 ucptrie_getRange "ucptrie_getRange" sptr, int, int, int, sptr, sptr, sptr ; res = ucptrie_getRange(varptr(trie), start, option, surrogateValue, filter, context, varptr(pValue)) ; trie : UCPTrie* -> "sptr" ; 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 ucptrie_getRange(UCPTrie* trie, INT start, UCPMapRangeOption option, DWORD surrogateValue, UCPMapValueFilter* filter, void* context, DWORD* pValue) #uselib "icu.dll" #cfunc global ucptrie_getRange "ucptrie_getRange" var, int, int, int, intptr, intptr, var ; res = ucptrie_getRange(trie, start, option, surrogateValue, filter, context, pValue) ; trie : UCPTrie* -> "var" ; 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 ucptrie_getRange(UCPTrie* trie, INT start, UCPMapRangeOption option, DWORD surrogateValue, UCPMapValueFilter* filter, void* context, DWORD* pValue) #uselib "icu.dll" #cfunc global ucptrie_getRange "ucptrie_getRange" intptr, int, int, int, intptr, intptr, intptr ; res = ucptrie_getRange(varptr(trie), start, option, surrogateValue, filter, context, varptr(pValue)) ; trie : UCPTrie* -> "intptr" ; 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")
procucptrie_getRange = icu.NewProc("ucptrie_getRange")
)
// trie (UCPTrie*), start (INT), option (UCPMapRangeOption), surrogateValue (DWORD), filter (UCPMapValueFilter* in/out), context (void*), pValue (DWORD* in/out)
r1, _, err := procucptrie_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 ucptrie_getRange(
trie: Pointer; // UCPTrie*
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 'ucptrie_getRange';result := DllCall("icu\ucptrie_getRange"
, "Ptr", trie ; UCPTrie*
, "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●ucptrie_getRange(trie, start, option, surrogateValue, filter, context, pValue) = DLL("icu.dll", "int ucptrie_getRange(void*, int, int, dword, void*, void*, void*)")
# 呼び出し: ucptrie_getRange(trie, start, option, surrogateValue, filter, context, pValue)
# trie : UCPTrie* -> "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`,…) を使用。