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

ucnv_getUnicodeSet

関数
変換器が扱えるUnicode文字集合を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void ucnv_getUnicodeSet(
    const UConverter* cnv,
    USet* setFillIn,
    UConverterUnicodeSet whichSet,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
cnvUConverter*in
setFillInUSet*inout
whichSetUConverterUnicodeSetin
pErrorCodeUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

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

ucnv_getUnicodeSet = ctypes.cdll.icuuc.ucnv_getUnicodeSet
ucnv_getUnicodeSet.restype = None
ucnv_getUnicodeSet.argtypes = [
    ctypes.c_void_p,  # cnv : UConverter*
    ctypes.c_void_p,  # setFillIn : USet* in/out
    ctypes.c_int,  # whichSet : UConverterUnicodeSet
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ucnv_getUnicodeSet = Fiddle::Function.new(
  lib['ucnv_getUnicodeSet'],
  [
    Fiddle::TYPE_VOIDP,  # cnv : UConverter*
    Fiddle::TYPE_VOIDP,  # setFillIn : USet* in/out
    Fiddle::TYPE_INT,  # whichSet : UConverterUnicodeSet
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ucnv_getUnicodeSet(
        cnv: *const isize,  // UConverter*
        setFillIn: *mut isize,  // USet* in/out
        whichSet: i32,  // UConverterUnicodeSet
        pErrorCode: *mut i32  // UErrorCode* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucnv_getUnicodeSet(ref IntPtr cnv, ref IntPtr setFillIn, int whichSet, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucnv_getUnicodeSet' -Namespace Win32 -PassThru
# $api::ucnv_getUnicodeSet(cnv, setFillIn, whichSet, pErrorCode)
#uselib "icuuc.dll"
#func global ucnv_getUnicodeSet "ucnv_getUnicodeSet" sptr, sptr, sptr, sptr
; ucnv_getUnicodeSet cnv, setFillIn, whichSet, pErrorCode
; cnv : UConverter* -> "sptr"
; setFillIn : USet* in/out -> "sptr"
; whichSet : UConverterUnicodeSet -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
#uselib "icuuc.dll"
#func global ucnv_getUnicodeSet "ucnv_getUnicodeSet" int, int, int, int
; ucnv_getUnicodeSet cnv, setFillIn, whichSet, pErrorCode
; cnv : UConverter* -> "int"
; setFillIn : USet* in/out -> "int"
; whichSet : UConverterUnicodeSet -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; void ucnv_getUnicodeSet(UConverter* cnv, USet* setFillIn, UConverterUnicodeSet whichSet, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#func global ucnv_getUnicodeSet "ucnv_getUnicodeSet" int, int, int, int
; ucnv_getUnicodeSet cnv, setFillIn, whichSet, pErrorCode
; cnv : UConverter* -> "int"
; setFillIn : USet* in/out -> "int"
; whichSet : UConverterUnicodeSet -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procucnv_getUnicodeSet = icuuc.NewProc("ucnv_getUnicodeSet")
)

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