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

utrace_setFunctions

関数
ICUトレース用のコールバック関数を登録する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void utrace_setFunctions(
    const void* context,
    UTraceEntry e,
    UTraceExit x,
    UTraceData d
);

パラメーター

名前方向
contextvoid*in
eUTraceEntryin
xUTraceExitin
dUTraceDatain

戻り値の型: void

各言語での呼び出し定義

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

void utrace_setFunctions(
    const void* context,
    UTraceEntry e,
    UTraceExit x,
    UTraceData d
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void utrace_setFunctions(
    IntPtr context,   // void*
    IntPtr e,   // UTraceEntry
    IntPtr x,   // UTraceExit
    IntPtr d   // UTraceData
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub utrace_setFunctions(
    context As IntPtr,   ' void*
    e As IntPtr,   ' UTraceEntry
    x As IntPtr,   ' UTraceExit
    d As IntPtr   ' UTraceData
)
End Sub
' context : void*
' e : UTraceEntry
' x : UTraceExit
' d : UTraceData
Declare PtrSafe Sub utrace_setFunctions Lib "icuuc" ( _
    ByVal context As LongPtr, _
    ByVal e As LongPtr, _
    ByVal x As LongPtr, _
    ByVal d As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

utrace_setFunctions = ctypes.cdll.icuuc.utrace_setFunctions
utrace_setFunctions.restype = None
utrace_setFunctions.argtypes = [
    ctypes.POINTER(None),  # context : void*
    ctypes.c_void_p,  # e : UTraceEntry
    ctypes.c_void_p,  # x : UTraceExit
    ctypes.c_void_p,  # d : UTraceData
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
utrace_setFunctions = Fiddle::Function.new(
  lib['utrace_setFunctions'],
  [
    Fiddle::TYPE_VOIDP,  # context : void*
    Fiddle::TYPE_VOIDP,  # e : UTraceEntry
    Fiddle::TYPE_VOIDP,  # x : UTraceExit
    Fiddle::TYPE_VOIDP,  # d : UTraceData
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn utrace_setFunctions(
        context: *const (),  // void*
        e: *const core::ffi::c_void,  // UTraceEntry
        x: *const core::ffi::c_void,  // UTraceExit
        d: *const core::ffi::c_void  // UTraceData
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void utrace_setFunctions(IntPtr context, IntPtr e, IntPtr x, IntPtr d);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_utrace_setFunctions' -Namespace Win32 -PassThru
# $api::utrace_setFunctions(context, e, x, d)
#uselib "icuuc.dll"
#func global utrace_setFunctions "utrace_setFunctions" sptr, sptr, sptr, sptr
; utrace_setFunctions context, e, x, d
; context : void* -> "sptr"
; e : UTraceEntry -> "sptr"
; x : UTraceExit -> "sptr"
; d : UTraceData -> "sptr"
#uselib "icuuc.dll"
#func global utrace_setFunctions "utrace_setFunctions" sptr, sptr, sptr, sptr
; utrace_setFunctions context, e, x, d
; context : void* -> "sptr"
; e : UTraceEntry -> "sptr"
; x : UTraceExit -> "sptr"
; d : UTraceData -> "sptr"
; void utrace_setFunctions(void* context, UTraceEntry e, UTraceExit x, UTraceData d)
#uselib "icuuc.dll"
#func global utrace_setFunctions "utrace_setFunctions" intptr, intptr, intptr, intptr
; utrace_setFunctions context, e, x, d
; context : void* -> "intptr"
; e : UTraceEntry -> "intptr"
; x : UTraceExit -> "intptr"
; d : UTraceData -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procutrace_setFunctions = icuuc.NewProc("utrace_setFunctions")
)

// context (void*), e (UTraceEntry), x (UTraceExit), d (UTraceData)
r1, _, err := procutrace_setFunctions.Call(
	uintptr(context),
	uintptr(e),
	uintptr(x),
	uintptr(d),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure utrace_setFunctions(
  context: Pointer;   // void*
  e: Pointer;   // UTraceEntry
  x: Pointer;   // UTraceExit
  d: Pointer   // UTraceData
); cdecl;
  external 'icuuc.dll' name 'utrace_setFunctions';
result := DllCall("icuuc\utrace_setFunctions"
    , "Ptr", context   ; void*
    , "Ptr", e   ; UTraceEntry
    , "Ptr", x   ; UTraceExit
    , "Ptr", d   ; UTraceData
    , "Cdecl Int")   ; return: void
●utrace_setFunctions(context, e, x, d) = DLL("icuuc.dll", "int utrace_setFunctions(void*, void*, void*, void*)")
# 呼び出し: utrace_setFunctions(context, e, x, d)
# context : void* -> "void*"
# e : UTraceEntry -> "void*"
# x : UTraceExit -> "void*"
# d : UTraceData -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。