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

ucnv_getToUCallBack

関数
変換器のUnicode方向への変換コールバックを取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void ucnv_getToUCallBack(
    const UConverter* converter,
    UConverterToUCallback* action,
    const void** context
);

パラメーター

名前方向
converterUConverter*in
actionUConverterToUCallback*inout
contextvoid**in

戻り値の型: void

各言語での呼び出し定義

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

void ucnv_getToUCallBack(
    const UConverter* converter,
    UConverterToUCallback* action,
    const void** context
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucnv_getToUCallBack(
    ref IntPtr converter,   // UConverter*
    IntPtr action,   // UConverterToUCallback* in/out
    IntPtr context   // void**
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucnv_getToUCallBack(
    ByRef converter As IntPtr,   ' UConverter*
    action As IntPtr,   ' UConverterToUCallback* in/out
    context As IntPtr   ' void**
)
End Sub
' converter : UConverter*
' action : UConverterToUCallback* in/out
' context : void**
Declare PtrSafe Sub ucnv_getToUCallBack Lib "icuuc" ( _
    ByRef converter As LongPtr, _
    ByVal action As LongPtr, _
    ByVal context As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucnv_getToUCallBack = ctypes.cdll.icuuc.ucnv_getToUCallBack
ucnv_getToUCallBack.restype = None
ucnv_getToUCallBack.argtypes = [
    ctypes.c_void_p,  # converter : UConverter*
    ctypes.c_void_p,  # action : UConverterToUCallback* in/out
    ctypes.c_void_p,  # context : void**
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procucnv_getToUCallBack = icuuc.NewProc("ucnv_getToUCallBack")
)

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