ホーム › Globalization › umutablecptrie_setRange
umutablecptrie_setRange
関数可変トライに指定範囲の値をまとめて設定する。
シグネチャ
// icu.dll
#include <windows.h>
void umutablecptrie_setRange(
UMutableCPTrie* trie,
INT start,
INT end,
DWORD value,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| trie | UMutableCPTrie* | inout | 値を設定する可変トライへのポインタ。 |
| start | INT | in | 設定範囲の開始コードポイント(含む)。 |
| end | INT | in | 設定範囲の終了コードポイント(含む)。 |
| value | DWORD | in | 範囲内の全コードポイントに割り当てる値。 |
| pErrorCode | UErrorCode* | inout | ICOのエラーコードを入出力するポインタ。事前にU_ZERO_ERRORで初期化する。 |
戻り値の型: void
各言語での呼び出し定義
// icu.dll
#include <windows.h>
void umutablecptrie_setRange(
UMutableCPTrie* trie,
INT start,
INT end,
DWORD value,
UErrorCode* pErrorCode
);[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void umutablecptrie_setRange(
ref IntPtr trie, // UMutableCPTrie* in/out
int start, // INT
int end, // INT
uint value, // DWORD
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub umutablecptrie_setRange(
ByRef trie As IntPtr, ' UMutableCPTrie* in/out
start As Integer, ' INT
[end] As Integer, ' INT
value As UInteger, ' DWORD
ByRef pErrorCode As Integer ' UErrorCode* in/out
)
End Sub' trie : UMutableCPTrie* in/out
' start : INT
' end : INT
' value : DWORD
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Sub umutablecptrie_setRange Lib "icu" ( _
ByRef trie As LongPtr, _
ByVal start As Long, _
ByVal end As Long, _
ByVal value As Long, _
ByRef pErrorCode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
umutablecptrie_setRange = ctypes.cdll.icu.umutablecptrie_setRange
umutablecptrie_setRange.restype = None
umutablecptrie_setRange.argtypes = [
ctypes.c_void_p, # trie : UMutableCPTrie* in/out
ctypes.c_int, # start : INT
ctypes.c_int, # end : INT
wintypes.DWORD, # value : DWORD
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icu.dll')
umutablecptrie_setRange = Fiddle::Function.new(
lib['umutablecptrie_setRange'],
[
Fiddle::TYPE_VOIDP, # trie : UMutableCPTrie* in/out
Fiddle::TYPE_INT, # start : INT
Fiddle::TYPE_INT, # end : INT
-Fiddle::TYPE_INT, # value : DWORD
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icu")]
extern "C" {
fn umutablecptrie_setRange(
trie: *mut isize, // UMutableCPTrie* in/out
start: i32, // INT
end: i32, // INT
value: u32, // DWORD
pErrorCode: *mut i32 // UErrorCode* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void umutablecptrie_setRange(ref IntPtr trie, int start, int end, uint value, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_umutablecptrie_setRange' -Namespace Win32 -PassThru
# $api::umutablecptrie_setRange(trie, start, end, value, pErrorCode)#uselib "icu.dll"
#func global umutablecptrie_setRange "umutablecptrie_setRange" sptr, sptr, sptr, sptr, sptr
; umutablecptrie_setRange varptr(trie), start, end, value, varptr(pErrorCode)
; trie : UMutableCPTrie* in/out -> "sptr"
; start : INT -> "sptr"
; end : INT -> "sptr"
; value : DWORD -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"出力引数:
#uselib "icu.dll" #func global umutablecptrie_setRange "umutablecptrie_setRange" var, int, int, int, var ; umutablecptrie_setRange trie, start, end, value, pErrorCode ; trie : UMutableCPTrie* in/out -> "var" ; start : INT -> "int" ; end : INT -> "int" ; value : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icu.dll" #func global umutablecptrie_setRange "umutablecptrie_setRange" sptr, int, int, int, sptr ; umutablecptrie_setRange varptr(trie), start, end, value, varptr(pErrorCode) ; trie : UMutableCPTrie* in/out -> "sptr" ; start : INT -> "int" ; end : INT -> "int" ; value : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void umutablecptrie_setRange(UMutableCPTrie* trie, INT start, INT end, DWORD value, UErrorCode* pErrorCode) #uselib "icu.dll" #func global umutablecptrie_setRange "umutablecptrie_setRange" var, int, int, int, var ; umutablecptrie_setRange trie, start, end, value, pErrorCode ; trie : UMutableCPTrie* in/out -> "var" ; start : INT -> "int" ; end : INT -> "int" ; value : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void umutablecptrie_setRange(UMutableCPTrie* trie, INT start, INT end, DWORD value, UErrorCode* pErrorCode) #uselib "icu.dll" #func global umutablecptrie_setRange "umutablecptrie_setRange" intptr, int, int, int, intptr ; umutablecptrie_setRange varptr(trie), start, end, value, varptr(pErrorCode) ; trie : UMutableCPTrie* in/out -> "intptr" ; start : INT -> "int" ; end : INT -> "int" ; value : DWORD -> "int" ; pErrorCode : UErrorCode* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icu = windows.NewLazySystemDLL("icu.dll")
procumutablecptrie_setRange = icu.NewProc("umutablecptrie_setRange")
)
// trie (UMutableCPTrie* in/out), start (INT), end (INT), value (DWORD), pErrorCode (UErrorCode* in/out)
r1, _, err := procumutablecptrie_setRange.Call(
uintptr(trie),
uintptr(start),
uintptr(end),
uintptr(value),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure umutablecptrie_setRange(
trie: Pointer; // UMutableCPTrie* in/out
start: Integer; // INT
end: Integer; // INT
value: DWORD; // DWORD
pErrorCode: Pointer // UErrorCode* in/out
); cdecl;
external 'icu.dll' name 'umutablecptrie_setRange';result := DllCall("icu\umutablecptrie_setRange"
, "Ptr", trie ; UMutableCPTrie* in/out
, "Int", start ; INT
, "Int", end ; INT
, "UInt", value ; DWORD
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Int") ; return: void●umutablecptrie_setRange(trie, start, end, value, pErrorCode) = DLL("icu.dll", "int umutablecptrie_setRange(void*, int, int, dword, void*)")
# 呼び出し: umutablecptrie_setRange(trie, start, end, value, pErrorCode)
# trie : UMutableCPTrie* in/out -> "void*"
# start : INT -> "int"
# end : INT -> "int"
# value : DWORD -> "dword"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icu" fn umutablecptrie_setRange(
trie: [*c]isize, // UMutableCPTrie* in/out
start: i32, // INT
end: i32, // INT
value: u32, // DWORD
pErrorCode: [*c]i32 // UErrorCode* in/out
) callconv(.c) void;proc umutablecptrie_setRange(
trie: ptr int, # UMutableCPTrie* in/out
start: int32, # INT
`end`: int32, # INT
value: uint32, # DWORD
pErrorCode: ptr int32 # UErrorCode* in/out
) {.importc: "umutablecptrie_setRange", cdecl, dynlib: "icu.dll".}pragma(lib, "icu");
extern(C)
void umutablecptrie_setRange(
ptrdiff_t* trie, // UMutableCPTrie* in/out
int start, // INT
int end, // INT
uint value, // DWORD
int* pErrorCode // UErrorCode* in/out
);ccall((:umutablecptrie_setRange, "icu.dll"), Cvoid,
(Ptr{Int}, Int32, Int32, UInt32, Ptr{Int32}),
trie, start, end, value, pErrorCode)
# trie : UMutableCPTrie* in/out -> Ptr{Int}
# start : INT -> Int32
# end : INT -> Int32
# value : DWORD -> UInt32
# pErrorCode : UErrorCode* in/out -> Ptr{Int32}local ffi = require("ffi")
ffi.cdef[[
void umutablecptrie_setRange(
intptr_t* trie,
int32_t start,
int32_t end,
uint32_t value,
int32_t* pErrorCode);
]]
local icu = ffi.load("icu")
-- icu.umutablecptrie_setRange(trie, start, end, value, pErrorCode)
-- trie : UMutableCPTrie* in/out
-- start : INT
-- end : INT
-- value : DWORD
-- pErrorCode : UErrorCode* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icu.dll');
const umutablecptrie_setRange = lib.func('__cdecl', 'umutablecptrie_setRange', 'void', ['intptr_t *', 'int32_t', 'int32_t', 'uint32_t', 'int32_t *']);
// umutablecptrie_setRange(trie, start, end, value, pErrorCode)
// trie : UMutableCPTrie* in/out -> 'intptr_t *'
// start : INT -> 'int32_t'
// end : INT -> 'int32_t'
// value : DWORD -> 'uint32_t'
// pErrorCode : UErrorCode* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icu.dll", {
umutablecptrie_setRange: { parameters: ["pointer", "i32", "i32", "u32", "pointer"], result: "void" },
});
// lib.symbols.umutablecptrie_setRange(trie, start, end, value, pErrorCode)
// trie : UMutableCPTrie* in/out -> "pointer"
// start : INT -> "i32"
// end : INT -> "i32"
// value : DWORD -> "u32"
// pErrorCode : UErrorCode* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void umutablecptrie_setRange(
intptr_t* trie,
int32_t start,
int32_t end,
uint32_t value,
int32_t* pErrorCode);
C, "icu.dll");
// $ffi->umutablecptrie_setRange(trie, start, end, value, pErrorCode);
// trie : UMutableCPTrie* in/out
// start : INT
// end : INT
// value : DWORD
// pErrorCode : UErrorCode* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Icu extends Library {
Icu INSTANCE = Native.load("icu", Icu.class);
void umutablecptrie_setRange(
LongByReference trie, // UMutableCPTrie* in/out
int start, // INT
int end, // INT
int value, // DWORD
IntByReference pErrorCode // UErrorCode* in/out
);
}@[Link("icu")]
lib Libicu
fun umutablecptrie_setRange = umutablecptrie_setRange(
trie : LibC::SSizeT*, # UMutableCPTrie* in/out
start : Int32, # INT
end_ : Int32, # INT
value : UInt32, # DWORD
pErrorCode : Int32* # UErrorCode* in/out
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef umutablecptrie_setRangeNative = Void Function(Pointer<IntPtr>, Int32, Int32, Uint32, Pointer<Int32>);
typedef umutablecptrie_setRangeDart = void Function(Pointer<IntPtr>, int, int, int, Pointer<Int32>);
final umutablecptrie_setRange = DynamicLibrary.open('icu.dll')
.lookupFunction<umutablecptrie_setRangeNative, umutablecptrie_setRangeDart>('umutablecptrie_setRange');
// trie : UMutableCPTrie* in/out -> Pointer<IntPtr>
// start : INT -> Int32
// end : INT -> Int32
// value : DWORD -> Uint32
// pErrorCode : UErrorCode* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure umutablecptrie_setRange(
trie: Pointer; // UMutableCPTrie* in/out
start: Integer; // INT
end: Integer; // INT
value: DWORD; // DWORD
pErrorCode: Pointer // UErrorCode* in/out
); cdecl;
external 'icu.dll' name 'umutablecptrie_setRange';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "umutablecptrie_setRange"
c_umutablecptrie_setRange :: Ptr CIntPtr -> Int32 -> Int32 -> Word32 -> Ptr Int32 -> IO ()
-- trie : UMutableCPTrie* in/out -> Ptr CIntPtr
-- start : INT -> Int32
-- end : INT -> Int32
-- value : DWORD -> Word32
-- pErrorCode : UErrorCode* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let umutablecptrie_setrange =
foreign "umutablecptrie_setRange"
((ptr intptr_t) @-> int32_t @-> int32_t @-> uint32_t @-> (ptr int32_t) @-> returning void)
(* trie : UMutableCPTrie* in/out -> (ptr intptr_t) *)
(* start : INT -> int32_t *)
(* end : INT -> int32_t *)
(* value : DWORD -> uint32_t *)
(* pErrorCode : UErrorCode* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icu (t "icu.dll"))
(cffi:use-foreign-library icu)
(cffi:defcfun ("umutablecptrie_setRange" umutablecptrie-set-range :convention :cdecl) :void
(trie :pointer) ; UMutableCPTrie* in/out
(start :int32) ; INT
(end :int32) ; INT
(value :uint32) ; DWORD
(p-error-code :pointer)) ; UErrorCode* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $umutablecptrie_setRange = Win32::API::More->new('icu',
'void umutablecptrie_setRange(LPVOID trie, int start, int end, DWORD value, LPVOID pErrorCode)');
# my $ret = $umutablecptrie_setRange->Call($trie, $start, $end, $value, $pErrorCode);
# trie : UMutableCPTrie* in/out -> LPVOID
# start : INT -> int
# end : INT -> int
# value : DWORD -> DWORD
# pErrorCode : UErrorCode* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型