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

ucnv_getFromUCallBack

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

シグネチャ

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

void ucnv_getFromUCallBack(
    const UConverter* converter,
    UConverterFromUCallback* action,
    const void** context
);

パラメーター

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

戻り値の型: void

各言語での呼び出し定義

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

void ucnv_getFromUCallBack(
    const UConverter* converter,
    UConverterFromUCallback* action,
    const void** context
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucnv_getFromUCallBack(
    ref IntPtr converter,   // UConverter*
    IntPtr action,   // UConverterFromUCallback* in/out
    IntPtr context   // void**
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucnv_getFromUCallBack(
    ByRef converter As IntPtr,   ' UConverter*
    action As IntPtr,   ' UConverterFromUCallback* in/out
    context As IntPtr   ' void**
)
End Sub
' converter : UConverter*
' action : UConverterFromUCallback* in/out
' context : void**
Declare PtrSafe Sub ucnv_getFromUCallBack 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_getFromUCallBack = ctypes.cdll.icuuc.ucnv_getFromUCallBack
ucnv_getFromUCallBack.restype = None
ucnv_getFromUCallBack.argtypes = [
    ctypes.c_void_p,  # converter : UConverter*
    ctypes.c_void_p,  # action : UConverterFromUCallback* in/out
    ctypes.c_void_p,  # context : void**
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ucnv_getFromUCallBack = Fiddle::Function.new(
  lib['ucnv_getFromUCallBack'],
  [
    Fiddle::TYPE_VOIDP,  # converter : UConverter*
    Fiddle::TYPE_VOIDP,  # action : UConverterFromUCallback* in/out
    Fiddle::TYPE_VOIDP,  # context : void**
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ucnv_getFromUCallBack(
        converter: *const isize,  // UConverter*
        action: *mut *const core::ffi::c_void,  // UConverterFromUCallback* 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_getFromUCallBack(ref IntPtr converter, IntPtr action, IntPtr context);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucnv_getFromUCallBack' -Namespace Win32 -PassThru
# $api::ucnv_getFromUCallBack(converter, action, context)
#uselib "icuuc.dll"
#func global ucnv_getFromUCallBack "ucnv_getFromUCallBack" sptr, sptr, sptr
; ucnv_getFromUCallBack converter, action, context
; converter : UConverter* -> "sptr"
; action : UConverterFromUCallback* in/out -> "sptr"
; context : void** -> "sptr"
#uselib "icuuc.dll"
#func global ucnv_getFromUCallBack "ucnv_getFromUCallBack" int, sptr, sptr
; ucnv_getFromUCallBack converter, action, context
; converter : UConverter* -> "int"
; action : UConverterFromUCallback* in/out -> "sptr"
; context : void** -> "sptr"
; void ucnv_getFromUCallBack(UConverter* converter, UConverterFromUCallback* action, void** context)
#uselib "icuuc.dll"
#func global ucnv_getFromUCallBack "ucnv_getFromUCallBack" int, intptr, intptr
; ucnv_getFromUCallBack converter, action, context
; converter : UConverter* -> "int"
; action : UConverterFromUCallback* in/out -> "intptr"
; context : void** -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procucnv_getFromUCallBack = icuuc.NewProc("ucnv_getFromUCallBack")
)

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