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

u_enumCharNames

関数
指定範囲の文字名をコールバックで列挙する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void u_enumCharNames(
    INT start,
    INT limit,
    UEnumCharNamesFn* fn,
    void* context,
    UCharNameChoice nameChoice,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
startINTin
limitINTin
fnUEnumCharNamesFn*inout
contextvoid*inout
nameChoiceUCharNameChoicein
pErrorCodeUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

void u_enumCharNames(
    INT start,
    INT limit,
    UEnumCharNamesFn* fn,
    void* context,
    UCharNameChoice nameChoice,
    UErrorCode* pErrorCode
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void u_enumCharNames(
    int start,   // INT
    int limit,   // INT
    IntPtr fn,   // UEnumCharNamesFn* in/out
    IntPtr context,   // void* in/out
    int nameChoice,   // UCharNameChoice
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub u_enumCharNames(
    start As Integer,   ' INT
    limit As Integer,   ' INT
    fn As IntPtr,   ' UEnumCharNamesFn* in/out
    context As IntPtr,   ' void* in/out
    nameChoice As Integer,   ' UCharNameChoice
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
)
End Sub
' start : INT
' limit : INT
' fn : UEnumCharNamesFn* in/out
' context : void* in/out
' nameChoice : UCharNameChoice
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Sub u_enumCharNames Lib "icuuc" ( _
    ByVal start As Long, _
    ByVal limit As Long, _
    ByVal fn As LongPtr, _
    ByVal context As LongPtr, _
    ByVal nameChoice As Long, _
    ByRef pErrorCode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

u_enumCharNames = ctypes.cdll.icuuc.u_enumCharNames
u_enumCharNames.restype = None
u_enumCharNames.argtypes = [
    ctypes.c_int,  # start : INT
    ctypes.c_int,  # limit : INT
    ctypes.c_void_p,  # fn : UEnumCharNamesFn* in/out
    ctypes.POINTER(None),  # context : void* in/out
    ctypes.c_int,  # nameChoice : UCharNameChoice
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
u_enumCharNames = Fiddle::Function.new(
  lib['u_enumCharNames'],
  [
    Fiddle::TYPE_INT,  # start : INT
    Fiddle::TYPE_INT,  # limit : INT
    Fiddle::TYPE_VOIDP,  # fn : UEnumCharNamesFn* in/out
    Fiddle::TYPE_VOIDP,  # context : void* in/out
    Fiddle::TYPE_INT,  # nameChoice : UCharNameChoice
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn u_enumCharNames(
        start: i32,  // INT
        limit: i32,  // INT
        fn: *mut *const core::ffi::c_void,  // UEnumCharNamesFn* in/out
        context: *mut (),  // void* in/out
        nameChoice: i32,  // UCharNameChoice
        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 u_enumCharNames(int start, int limit, IntPtr fn, IntPtr context, int nameChoice, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_u_enumCharNames' -Namespace Win32 -PassThru
# $api::u_enumCharNames(start, limit, fn, context, nameChoice, pErrorCode)
#uselib "icuuc.dll"
#func global u_enumCharNames "u_enumCharNames" sptr, sptr, sptr, sptr, sptr, sptr
; u_enumCharNames start, limit, fn, context, nameChoice, pErrorCode
; start : INT -> "sptr"
; limit : INT -> "sptr"
; fn : UEnumCharNamesFn* in/out -> "sptr"
; context : void* in/out -> "sptr"
; nameChoice : UCharNameChoice -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
#uselib "icuuc.dll"
#func global u_enumCharNames "u_enumCharNames" int, int, sptr, sptr, int, int
; u_enumCharNames start, limit, fn, context, nameChoice, pErrorCode
; start : INT -> "int"
; limit : INT -> "int"
; fn : UEnumCharNamesFn* in/out -> "sptr"
; context : void* in/out -> "sptr"
; nameChoice : UCharNameChoice -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; void u_enumCharNames(INT start, INT limit, UEnumCharNamesFn* fn, void* context, UCharNameChoice nameChoice, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#func global u_enumCharNames "u_enumCharNames" int, int, intptr, intptr, int, int
; u_enumCharNames start, limit, fn, context, nameChoice, pErrorCode
; start : INT -> "int"
; limit : INT -> "int"
; fn : UEnumCharNamesFn* in/out -> "intptr"
; context : void* in/out -> "intptr"
; nameChoice : UCharNameChoice -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procu_enumCharNames = icuuc.NewProc("u_enumCharNames")
)

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