ホーム › Globalization › ulocdata_getExemplarSet
ulocdata_getExemplarSet
関数ロケールの例示文字集合を取得する。
シグネチャ
// icuin.dll
#include <windows.h>
USet* ulocdata_getExemplarSet(
ULocaleData* uld,
USet* fillIn,
DWORD options,
ULocaleDataExemplarSetType extype,
UErrorCode* status
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| uld | ULocaleData* | inout | 代表文字集合を取得する対象のロケールデータオブジェクトのハンドル。 |
| fillIn | USet* | inout | 結果を格納する既存のUSet。NULLで新規に確保される。 |
| options | DWORD | in | 文字集合取得のオプションフラグ(大文字小文字化など)。 |
| extype | ULocaleDataExemplarSetType | in | 取得する代表集合の種別(標準、補助、句読点など)。 |
| status | UErrorCode* | inout | エラーコードへのポインタ。呼び出し前に初期化する必要がある。 |
戻り値の型: USet*
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
USet* ulocdata_getExemplarSet(
ULocaleData* uld,
USet* fillIn,
DWORD options,
ULocaleDataExemplarSetType extype,
UErrorCode* status
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ulocdata_getExemplarSet(
ref IntPtr uld, // ULocaleData* in/out
ref IntPtr fillIn, // USet* in/out
uint options, // DWORD
int extype, // ULocaleDataExemplarSetType
ref int status // UErrorCode* in/out
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ulocdata_getExemplarSet(
ByRef uld As IntPtr, ' ULocaleData* in/out
ByRef fillIn As IntPtr, ' USet* in/out
options As UInteger, ' DWORD
extype As Integer, ' ULocaleDataExemplarSetType
ByRef status As Integer ' UErrorCode* in/out
) As IntPtr
End Function' uld : ULocaleData* in/out
' fillIn : USet* in/out
' options : DWORD
' extype : ULocaleDataExemplarSetType
' status : UErrorCode* in/out
Declare PtrSafe Function ulocdata_getExemplarSet Lib "icuin" ( _
ByRef uld As LongPtr, _
ByRef fillIn As LongPtr, _
ByVal options As Long, _
ByVal extype As Long, _
ByRef status As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ulocdata_getExemplarSet = ctypes.cdll.icuin.ulocdata_getExemplarSet
ulocdata_getExemplarSet.restype = ctypes.c_void_p
ulocdata_getExemplarSet.argtypes = [
ctypes.c_void_p, # uld : ULocaleData* in/out
ctypes.c_void_p, # fillIn : USet* in/out
wintypes.DWORD, # options : DWORD
ctypes.c_int, # extype : ULocaleDataExemplarSetType
ctypes.c_void_p, # status : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
ulocdata_getExemplarSet = Fiddle::Function.new(
lib['ulocdata_getExemplarSet'],
[
Fiddle::TYPE_VOIDP, # uld : ULocaleData* in/out
Fiddle::TYPE_VOIDP, # fillIn : USet* in/out
-Fiddle::TYPE_INT, # options : DWORD
Fiddle::TYPE_INT, # extype : ULocaleDataExemplarSetType
Fiddle::TYPE_VOIDP, # status : UErrorCode* in/out
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn ulocdata_getExemplarSet(
uld: *mut isize, // ULocaleData* in/out
fillIn: *mut isize, // USet* in/out
options: u32, // DWORD
extype: i32, // ULocaleDataExemplarSetType
status: *mut i32 // UErrorCode* in/out
) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ulocdata_getExemplarSet(ref IntPtr uld, ref IntPtr fillIn, uint options, int extype, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ulocdata_getExemplarSet' -Namespace Win32 -PassThru
# $api::ulocdata_getExemplarSet(uld, fillIn, options, extype, status)#uselib "icuin.dll"
#func global ulocdata_getExemplarSet "ulocdata_getExemplarSet" sptr, sptr, sptr, sptr, sptr
; ulocdata_getExemplarSet varptr(uld), varptr(fillIn), options, extype, varptr(status) ; 戻り値は stat
; uld : ULocaleData* in/out -> "sptr"
; fillIn : USet* in/out -> "sptr"
; options : DWORD -> "sptr"
; extype : ULocaleDataExemplarSetType -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuin.dll" #cfunc global ulocdata_getExemplarSet "ulocdata_getExemplarSet" var, var, int, int, var ; res = ulocdata_getExemplarSet(uld, fillIn, options, extype, status) ; uld : ULocaleData* in/out -> "var" ; fillIn : USet* in/out -> "var" ; options : DWORD -> "int" ; extype : ULocaleDataExemplarSetType -> "int" ; status : UErrorCode* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global ulocdata_getExemplarSet "ulocdata_getExemplarSet" sptr, sptr, int, int, sptr ; res = ulocdata_getExemplarSet(varptr(uld), varptr(fillIn), options, extype, varptr(status)) ; uld : ULocaleData* in/out -> "sptr" ; fillIn : USet* in/out -> "sptr" ; options : DWORD -> "int" ; extype : ULocaleDataExemplarSetType -> "int" ; status : UErrorCode* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; USet* ulocdata_getExemplarSet(ULocaleData* uld, USet* fillIn, DWORD options, ULocaleDataExemplarSetType extype, UErrorCode* status) #uselib "icuin.dll" #cfunc global ulocdata_getExemplarSet "ulocdata_getExemplarSet" var, var, int, int, var ; res = ulocdata_getExemplarSet(uld, fillIn, options, extype, status) ; uld : ULocaleData* in/out -> "var" ; fillIn : USet* in/out -> "var" ; options : DWORD -> "int" ; extype : ULocaleDataExemplarSetType -> "int" ; status : UErrorCode* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; USet* ulocdata_getExemplarSet(ULocaleData* uld, USet* fillIn, DWORD options, ULocaleDataExemplarSetType extype, UErrorCode* status) #uselib "icuin.dll" #cfunc global ulocdata_getExemplarSet "ulocdata_getExemplarSet" intptr, intptr, int, int, intptr ; res = ulocdata_getExemplarSet(varptr(uld), varptr(fillIn), options, extype, varptr(status)) ; uld : ULocaleData* in/out -> "intptr" ; fillIn : USet* in/out -> "intptr" ; options : DWORD -> "int" ; extype : ULocaleDataExemplarSetType -> "int" ; status : UErrorCode* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
proculocdata_getExemplarSet = icuin.NewProc("ulocdata_getExemplarSet")
)
// uld (ULocaleData* in/out), fillIn (USet* in/out), options (DWORD), extype (ULocaleDataExemplarSetType), status (UErrorCode* in/out)
r1, _, err := proculocdata_getExemplarSet.Call(
uintptr(uld),
uintptr(fillIn),
uintptr(options),
uintptr(extype),
uintptr(status),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // USet*function ulocdata_getExemplarSet(
uld: Pointer; // ULocaleData* in/out
fillIn: Pointer; // USet* in/out
options: DWORD; // DWORD
extype: Integer; // ULocaleDataExemplarSetType
status: Pointer // UErrorCode* in/out
): Pointer; cdecl;
external 'icuin.dll' name 'ulocdata_getExemplarSet';result := DllCall("icuin\ulocdata_getExemplarSet"
, "Ptr", uld ; ULocaleData* in/out
, "Ptr", fillIn ; USet* in/out
, "UInt", options ; DWORD
, "Int", extype ; ULocaleDataExemplarSetType
, "Ptr", status ; UErrorCode* in/out
, "Cdecl Ptr") ; return: USet*●ulocdata_getExemplarSet(uld, fillIn, options, extype, status) = DLL("icuin.dll", "void* ulocdata_getExemplarSet(void*, void*, dword, int, void*)")
# 呼び出し: ulocdata_getExemplarSet(uld, fillIn, options, extype, status)
# uld : ULocaleData* in/out -> "void*"
# fillIn : USet* in/out -> "void*"
# options : DWORD -> "dword"
# extype : ULocaleDataExemplarSetType -> "int"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuin" fn ulocdata_getExemplarSet(
uld: [*c]isize, // ULocaleData* in/out
fillIn: [*c]isize, // USet* in/out
options: u32, // DWORD
extype: i32, // ULocaleDataExemplarSetType
status: [*c]i32 // UErrorCode* in/out
) callconv(.c) [*c]isize;proc ulocdata_getExemplarSet(
uld: ptr int, # ULocaleData* in/out
fillIn: ptr int, # USet* in/out
options: uint32, # DWORD
extype: int32, # ULocaleDataExemplarSetType
status: ptr int32 # UErrorCode* in/out
): ptr int {.importc: "ulocdata_getExemplarSet", cdecl, dynlib: "icuin.dll".}pragma(lib, "icuin");
extern(C)
ptrdiff_t* ulocdata_getExemplarSet(
ptrdiff_t* uld, // ULocaleData* in/out
ptrdiff_t* fillIn, // USet* in/out
uint options, // DWORD
int extype, // ULocaleDataExemplarSetType
int* status // UErrorCode* in/out
);ccall((:ulocdata_getExemplarSet, "icuin.dll"), Ptr{Int},
(Ptr{Int}, Ptr{Int}, UInt32, Int32, Ptr{Int32}),
uld, fillIn, options, extype, status)
# uld : ULocaleData* in/out -> Ptr{Int}
# fillIn : USet* in/out -> Ptr{Int}
# options : DWORD -> UInt32
# extype : ULocaleDataExemplarSetType -> Int32
# status : UErrorCode* in/out -> Ptr{Int32}local ffi = require("ffi")
ffi.cdef[[
intptr_t* ulocdata_getExemplarSet(
intptr_t* uld,
intptr_t* fillIn,
uint32_t options,
int32_t extype,
int32_t* status);
]]
local icuin = ffi.load("icuin")
-- icuin.ulocdata_getExemplarSet(uld, fillIn, options, extype, status)
-- uld : ULocaleData* in/out
-- fillIn : USet* in/out
-- options : DWORD
-- extype : ULocaleDataExemplarSetType
-- status : UErrorCode* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuin.dll');
const ulocdata_getExemplarSet = lib.func('__cdecl', 'ulocdata_getExemplarSet', 'intptr_t *', ['intptr_t *', 'intptr_t *', 'uint32_t', 'int32_t', 'int32_t *']);
// ulocdata_getExemplarSet(uld, fillIn, options, extype, status)
// uld : ULocaleData* in/out -> 'intptr_t *'
// fillIn : USet* in/out -> 'intptr_t *'
// options : DWORD -> 'uint32_t'
// extype : ULocaleDataExemplarSetType -> 'int32_t'
// status : UErrorCode* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuin.dll", {
ulocdata_getExemplarSet: { parameters: ["pointer", "pointer", "u32", "i32", "pointer"], result: "pointer" },
});
// lib.symbols.ulocdata_getExemplarSet(uld, fillIn, options, extype, status)
// uld : ULocaleData* in/out -> "pointer"
// fillIn : USet* in/out -> "pointer"
// options : DWORD -> "u32"
// extype : ULocaleDataExemplarSetType -> "i32"
// status : UErrorCode* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
intptr_t* ulocdata_getExemplarSet(
intptr_t* uld,
intptr_t* fillIn,
uint32_t options,
int32_t extype,
int32_t* status);
C, "icuin.dll");
// $ffi->ulocdata_getExemplarSet(uld, fillIn, options, extype, status);
// uld : ULocaleData* in/out
// fillIn : USet* in/out
// options : DWORD
// extype : ULocaleDataExemplarSetType
// status : UErrorCode* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Icuin extends Library {
Icuin INSTANCE = Native.load("icuin", Icuin.class);
Pointer ulocdata_getExemplarSet(
LongByReference uld, // ULocaleData* in/out
LongByReference fillIn, // USet* in/out
int options, // DWORD
int extype, // ULocaleDataExemplarSetType
IntByReference status // UErrorCode* in/out
);
}@[Link("icuin")]
lib Libicuin
fun ulocdata_getExemplarSet = ulocdata_getExemplarSet(
uld : LibC::SSizeT*, # ULocaleData* in/out
fillIn : LibC::SSizeT*, # USet* in/out
options : UInt32, # DWORD
extype : Int32, # ULocaleDataExemplarSetType
status : Int32* # UErrorCode* in/out
) : LibC::SSizeT*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ulocdata_getExemplarSetNative = Pointer<IntPtr> Function(Pointer<IntPtr>, Pointer<IntPtr>, Uint32, Int32, Pointer<Int32>);
typedef ulocdata_getExemplarSetDart = Pointer<IntPtr> Function(Pointer<IntPtr>, Pointer<IntPtr>, int, int, Pointer<Int32>);
final ulocdata_getExemplarSet = DynamicLibrary.open('icuin.dll')
.lookupFunction<ulocdata_getExemplarSetNative, ulocdata_getExemplarSetDart>('ulocdata_getExemplarSet');
// uld : ULocaleData* in/out -> Pointer<IntPtr>
// fillIn : USet* in/out -> Pointer<IntPtr>
// options : DWORD -> Uint32
// extype : ULocaleDataExemplarSetType -> Int32
// status : UErrorCode* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ulocdata_getExemplarSet(
uld: Pointer; // ULocaleData* in/out
fillIn: Pointer; // USet* in/out
options: DWORD; // DWORD
extype: Integer; // ULocaleDataExemplarSetType
status: Pointer // UErrorCode* in/out
): Pointer; cdecl;
external 'icuin.dll' name 'ulocdata_getExemplarSet';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "ulocdata_getExemplarSet"
c_ulocdata_getExemplarSet :: Ptr CIntPtr -> Ptr CIntPtr -> Word32 -> Int32 -> Ptr Int32 -> IO (Ptr CIntPtr)
-- uld : ULocaleData* in/out -> Ptr CIntPtr
-- fillIn : USet* in/out -> Ptr CIntPtr
-- options : DWORD -> Word32
-- extype : ULocaleDataExemplarSetType -> Int32
-- status : UErrorCode* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ulocdata_getexemplarset =
foreign "ulocdata_getExemplarSet"
((ptr intptr_t) @-> (ptr intptr_t) @-> uint32_t @-> int32_t @-> (ptr int32_t) @-> returning (ptr intptr_t))
(* uld : ULocaleData* in/out -> (ptr intptr_t) *)
(* fillIn : USet* in/out -> (ptr intptr_t) *)
(* options : DWORD -> uint32_t *)
(* extype : ULocaleDataExemplarSetType -> int32_t *)
(* status : UErrorCode* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuin (t "icuin.dll"))
(cffi:use-foreign-library icuin)
(cffi:defcfun ("ulocdata_getExemplarSet" ulocdata-get-exemplar-set :convention :cdecl) :pointer
(uld :pointer) ; ULocaleData* in/out
(fill-in :pointer) ; USet* in/out
(options :uint32) ; DWORD
(extype :int32) ; ULocaleDataExemplarSetType
(status :pointer)) ; UErrorCode* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ulocdata_getExemplarSet = Win32::API::More->new('icuin',
'LPVOID ulocdata_getExemplarSet(LPVOID uld, LPVOID fillIn, DWORD options, int extype, LPVOID status)');
# my $ret = $ulocdata_getExemplarSet->Call($uld, $fillIn, $options, $extype, $status);
# uld : ULocaleData* in/out -> LPVOID
# fillIn : USet* in/out -> LPVOID
# options : DWORD -> DWORD
# extype : ULocaleDataExemplarSetType -> int
# status : UErrorCode* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。