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

umutablecptrie_set

関数
可変トライに指定コードポイントの値を設定する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

void umutablecptrie_set(
    UMutableCPTrie* trie,
    INT c,
    DWORD value,
    UErrorCode* pErrorCode
);

パラメーター

名前方向説明
trieUMutableCPTrie*inout値を設定する可変トライへのポインタ。
cINTin値を設定する対象のコードポイント。
valueDWORDinコードポイントに割り当てる値。
pErrorCodeUErrorCode*inoutICOのエラーコードを入出力するポインタ。事前にU_ZERO_ERRORで初期化する。

戻り値の型: void

各言語での呼び出し定義

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

void umutablecptrie_set(
    UMutableCPTrie* trie,
    INT c,
    DWORD value,
    UErrorCode* pErrorCode
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void umutablecptrie_set(
    ref IntPtr trie,   // UMutableCPTrie* in/out
    int c,   // INT
    uint value,   // DWORD
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub umutablecptrie_set(
    ByRef trie As IntPtr,   ' UMutableCPTrie* in/out
    c As Integer,   ' INT
    value As UInteger,   ' DWORD
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
)
End Sub
' trie : UMutableCPTrie* in/out
' c : INT
' value : DWORD
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Sub umutablecptrie_set Lib "icu" ( _
    ByRef trie As LongPtr, _
    ByVal c 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_set = ctypes.cdll.icu.umutablecptrie_set
umutablecptrie_set.restype = None
umutablecptrie_set.argtypes = [
    ctypes.c_void_p,  # trie : UMutableCPTrie* in/out
    ctypes.c_int,  # c : INT
    wintypes.DWORD,  # value : DWORD
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
umutablecptrie_set = Fiddle::Function.new(
  lib['umutablecptrie_set'],
  [
    Fiddle::TYPE_VOIDP,  # trie : UMutableCPTrie* in/out
    Fiddle::TYPE_INT,  # c : 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_set(
        trie: *mut isize,  // UMutableCPTrie* in/out
        c: 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_set(ref IntPtr trie, int c, uint value, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_umutablecptrie_set' -Namespace Win32 -PassThru
# $api::umutablecptrie_set(trie, c, value, pErrorCode)
#uselib "icu.dll"
#func global umutablecptrie_set "umutablecptrie_set" sptr, sptr, sptr, sptr
; umutablecptrie_set varptr(trie), c, value, varptr(pErrorCode)
; trie : UMutableCPTrie* in/out -> "sptr"
; c : INT -> "sptr"
; value : DWORD -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
出力引数:
#uselib "icu.dll"
#func global umutablecptrie_set "umutablecptrie_set" var, int, int, var
; umutablecptrie_set trie, c, value, pErrorCode
; trie : UMutableCPTrie* in/out -> "var"
; c : INT -> "int"
; value : DWORD -> "int"
; pErrorCode : UErrorCode* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void umutablecptrie_set(UMutableCPTrie* trie, INT c, DWORD value, UErrorCode* pErrorCode)
#uselib "icu.dll"
#func global umutablecptrie_set "umutablecptrie_set" var, int, int, var
; umutablecptrie_set trie, c, value, pErrorCode
; trie : UMutableCPTrie* in/out -> "var"
; c : INT -> "int"
; value : DWORD -> "int"
; pErrorCode : UErrorCode* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procumutablecptrie_set = icu.NewProc("umutablecptrie_set")
)

// trie (UMutableCPTrie* in/out), c (INT), value (DWORD), pErrorCode (UErrorCode* in/out)
r1, _, err := procumutablecptrie_set.Call(
	uintptr(trie),
	uintptr(c),
	uintptr(value),
	uintptr(pErrorCode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure umutablecptrie_set(
  trie: Pointer;   // UMutableCPTrie* in/out
  c: Integer;   // INT
  value: DWORD;   // DWORD
  pErrorCode: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icu.dll' name 'umutablecptrie_set';
result := DllCall("icu\umutablecptrie_set"
    , "Ptr", trie   ; UMutableCPTrie* in/out
    , "Int", c   ; INT
    , "UInt", value   ; DWORD
    , "Ptr", pErrorCode   ; UErrorCode* in/out
    , "Cdecl Int")   ; return: void
●umutablecptrie_set(trie, c, value, pErrorCode) = DLL("icu.dll", "int umutablecptrie_set(void*, int, dword, void*)")
# 呼び出し: umutablecptrie_set(trie, c, value, pErrorCode)
# trie : UMutableCPTrie* in/out -> "void*"
# c : 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_set(
    trie: [*c]isize, // UMutableCPTrie* in/out
    c: i32, // INT
    value: u32, // DWORD
    pErrorCode: [*c]i32 // UErrorCode* in/out
) callconv(.c) void;
proc umutablecptrie_set(
    trie: ptr int,  # UMutableCPTrie* in/out
    c: int32,  # INT
    value: uint32,  # DWORD
    pErrorCode: ptr int32  # UErrorCode* in/out
) {.importc: "umutablecptrie_set", cdecl, dynlib: "icu.dll".}
pragma(lib, "icu");
extern(C)
void umutablecptrie_set(
    ptrdiff_t* trie,   // UMutableCPTrie* in/out
    int c,   // INT
    uint value,   // DWORD
    int* pErrorCode   // UErrorCode* in/out
);
ccall((:umutablecptrie_set, "icu.dll"), Cvoid,
      (Ptr{Int}, Int32, UInt32, Ptr{Int32}),
      trie, c, value, pErrorCode)
# trie : UMutableCPTrie* in/out -> Ptr{Int}
# c : INT -> Int32
# value : DWORD -> UInt32
# pErrorCode : UErrorCode* in/out -> Ptr{Int32}
local ffi = require("ffi")
ffi.cdef[[
void umutablecptrie_set(
    intptr_t* trie,
    int32_t c,
    uint32_t value,
    int32_t* pErrorCode);
]]
local icu = ffi.load("icu")
-- icu.umutablecptrie_set(trie, c, value, pErrorCode)
-- trie : UMutableCPTrie* in/out
-- c : 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_set = lib.func('__cdecl', 'umutablecptrie_set', 'void', ['intptr_t *', 'int32_t', 'uint32_t', 'int32_t *']);
// umutablecptrie_set(trie, c, value, pErrorCode)
// trie : UMutableCPTrie* in/out -> 'intptr_t *'
// c : INT -> 'int32_t'
// value : DWORD -> 'uint32_t'
// pErrorCode : UErrorCode* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icu.dll", {
  umutablecptrie_set: { parameters: ["pointer", "i32", "u32", "pointer"], result: "void" },
});
// lib.symbols.umutablecptrie_set(trie, c, value, pErrorCode)
// trie : UMutableCPTrie* in/out -> "pointer"
// c : INT -> "i32"
// value : DWORD -> "u32"
// pErrorCode : UErrorCode* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void umutablecptrie_set(
    intptr_t* trie,
    int32_t c,
    uint32_t value,
    int32_t* pErrorCode);
C, "icu.dll");
// $ffi->umutablecptrie_set(trie, c, value, pErrorCode);
// trie : UMutableCPTrie* in/out
// c : 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_set(
        LongByReference trie,   // UMutableCPTrie* in/out
        int c,   // INT
        int value,   // DWORD
        IntByReference pErrorCode   // UErrorCode* in/out
    );
}
@[Link("icu")]
lib Libicu
  fun umutablecptrie_set = umutablecptrie_set(
    trie : LibC::SSizeT*,   # UMutableCPTrie* in/out
    c : 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_setNative = Void Function(Pointer<IntPtr>, Int32, Uint32, Pointer<Int32>);
typedef umutablecptrie_setDart = void Function(Pointer<IntPtr>, int, int, Pointer<Int32>);
final umutablecptrie_set = DynamicLibrary.open('icu.dll')
    .lookupFunction<umutablecptrie_setNative, umutablecptrie_setDart>('umutablecptrie_set');
// trie : UMutableCPTrie* in/out -> Pointer<IntPtr>
// c : INT -> Int32
// value : DWORD -> Uint32
// pErrorCode : UErrorCode* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure umutablecptrie_set(
  trie: Pointer;   // UMutableCPTrie* in/out
  c: Integer;   // INT
  value: DWORD;   // DWORD
  pErrorCode: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icu.dll' name 'umutablecptrie_set';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "umutablecptrie_set"
  c_umutablecptrie_set :: Ptr CIntPtr -> Int32 -> Word32 -> Ptr Int32 -> IO ()
-- trie : UMutableCPTrie* in/out -> Ptr CIntPtr
-- c : INT -> Int32
-- value : DWORD -> Word32
-- pErrorCode : UErrorCode* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let umutablecptrie_set =
  foreign "umutablecptrie_set"
    ((ptr intptr_t) @-> int32_t @-> uint32_t @-> (ptr int32_t) @-> returning void)
(* trie : UMutableCPTrie* in/out -> (ptr intptr_t) *)
(* c : 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_set" umutablecptrie-set :convention :cdecl) :void
  (trie :pointer)   ; UMutableCPTrie* in/out
  (c :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_set = Win32::API::More->new('icu',
    'void umutablecptrie_set(LPVOID trie, int c, DWORD value, LPVOID pErrorCode)');
# my $ret = $umutablecptrie_set->Call($trie, $c, $value, $pErrorCode);
# trie : UMutableCPTrie* in/out -> LPVOID
# c : INT -> int
# value : DWORD -> DWORD
# pErrorCode : UErrorCode* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型