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*inout

戻り値の型: 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 trie, c, value, 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" int, int, int, int
; umutablecptrie_set trie, c, value, pErrorCode
; trie : UMutableCPTrie* in/out -> "int"
; c : INT -> "int"
; value : DWORD -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; void umutablecptrie_set(UMutableCPTrie* trie, INT c, DWORD value, UErrorCode* pErrorCode)
#uselib "icu.dll"
#func global umutablecptrie_set "umutablecptrie_set" int, int, int, int
; umutablecptrie_set trie, c, value, pErrorCode
; trie : UMutableCPTrie* in/out -> "int"
; c : INT -> "int"
; value : DWORD -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
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`,…) を使用。