ホーム › Globalization › u_getPropertyValueName
u_getPropertyValueName
関数プロパティ値に対応する名前を取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
LPSTR u_getPropertyValueName(
UProperty property,
INT value,
UPropertyNameChoice nameChoice
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| property | UProperty | in | 対象のUnicodeプロパティを示す列挙値。 |
| value | INT | in | 名称を取得するプロパティ値(整数)。 |
| nameChoice | UPropertyNameChoice | in | 取得する名称の種類(短縮名・長い名前など)を指定する列挙値。 |
戻り値の型: LPSTR
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
LPSTR u_getPropertyValueName(
UProperty property,
INT value,
UPropertyNameChoice nameChoice
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr u_getPropertyValueName(
int property, // UProperty
int value, // INT
int nameChoice // UPropertyNameChoice
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function u_getPropertyValueName(
[property] As Integer, ' UProperty
value As Integer, ' INT
nameChoice As Integer ' UPropertyNameChoice
) As IntPtr
End Function' property : UProperty
' value : INT
' nameChoice : UPropertyNameChoice
Declare PtrSafe Function u_getPropertyValueName Lib "icuuc" ( _
ByVal property As Long, _
ByVal value As Long, _
ByVal nameChoice As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
u_getPropertyValueName = ctypes.cdll.icuuc.u_getPropertyValueName
u_getPropertyValueName.restype = wintypes.LPSTR
u_getPropertyValueName.argtypes = [
ctypes.c_int, # property : UProperty
ctypes.c_int, # value : INT
ctypes.c_int, # nameChoice : UPropertyNameChoice
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
u_getPropertyValueName = Fiddle::Function.new(
lib['u_getPropertyValueName'],
[
Fiddle::TYPE_INT, # property : UProperty
Fiddle::TYPE_INT, # value : INT
Fiddle::TYPE_INT, # nameChoice : UPropertyNameChoice
],
Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn u_getPropertyValueName(
property: i32, // UProperty
value: i32, // INT
nameChoice: i32 // UPropertyNameChoice
) -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr u_getPropertyValueName(int property, int value, int nameChoice);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_u_getPropertyValueName' -Namespace Win32 -PassThru
# $api::u_getPropertyValueName(property, value, nameChoice)#uselib "icuuc.dll"
#func global u_getPropertyValueName "u_getPropertyValueName" sptr, sptr, sptr
; u_getPropertyValueName property, value, nameChoice ; 戻り値は stat
; property : UProperty -> "sptr"
; value : INT -> "sptr"
; nameChoice : UPropertyNameChoice -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuuc.dll"
#cfunc global u_getPropertyValueName "u_getPropertyValueName" int, int, int
; res = u_getPropertyValueName(property, value, nameChoice)
; property : UProperty -> "int"
; value : INT -> "int"
; nameChoice : UPropertyNameChoice -> "int"; LPSTR u_getPropertyValueName(UProperty property, INT value, UPropertyNameChoice nameChoice)
#uselib "icuuc.dll"
#cfunc global u_getPropertyValueName "u_getPropertyValueName" int, int, int
; res = u_getPropertyValueName(property, value, nameChoice)
; property : UProperty -> "int"
; value : INT -> "int"
; nameChoice : UPropertyNameChoice -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procu_getPropertyValueName = icuuc.NewProc("u_getPropertyValueName")
)
// property (UProperty), value (INT), nameChoice (UPropertyNameChoice)
r1, _, err := procu_getPropertyValueName.Call(
uintptr(property),
uintptr(value),
uintptr(nameChoice),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // LPSTRfunction u_getPropertyValueName(
property: Integer; // UProperty
value: Integer; // INT
nameChoice: Integer // UPropertyNameChoice
): PAnsiChar; cdecl;
external 'icuuc.dll' name 'u_getPropertyValueName';result := DllCall("icuuc\u_getPropertyValueName"
, "Int", property ; UProperty
, "Int", value ; INT
, "Int", nameChoice ; UPropertyNameChoice
, "Cdecl Ptr") ; return: LPSTR●u_getPropertyValueName(property, value, nameChoice) = DLL("icuuc.dll", "char* u_getPropertyValueName(int, int, int)")
# 呼び出し: u_getPropertyValueName(property, value, nameChoice)
# property : UProperty -> "int"
# value : INT -> "int"
# nameChoice : UPropertyNameChoice -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuuc" fn u_getPropertyValueName(
property: i32, // UProperty
value: i32, // INT
nameChoice: i32 // UPropertyNameChoice
) callconv(.c) [*c]const u8;proc u_getPropertyValueName(
property: int32, # UProperty
value: int32, # INT
nameChoice: int32 # UPropertyNameChoice
): cstring {.importc: "u_getPropertyValueName", cdecl, dynlib: "icuuc.dll".}pragma(lib, "icuuc");
extern(C)
const(char)* u_getPropertyValueName(
int property, // UProperty
int value, // INT
int nameChoice // UPropertyNameChoice
);ccall((:u_getPropertyValueName, "icuuc.dll"), Cstring,
(Int32, Int32, Int32),
property, value, nameChoice)
# property : UProperty -> Int32
# value : INT -> Int32
# nameChoice : UPropertyNameChoice -> Int32local ffi = require("ffi")
ffi.cdef[[
const char* u_getPropertyValueName(
int32_t property,
int32_t value,
int32_t nameChoice);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.u_getPropertyValueName(property, value, nameChoice)
-- property : UProperty
-- value : INT
-- nameChoice : UPropertyNameChoice
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const u_getPropertyValueName = lib.func('__cdecl', 'u_getPropertyValueName', 'void *', ['int32_t', 'int32_t', 'int32_t']);
// u_getPropertyValueName(property, value, nameChoice)
// property : UProperty -> 'int32_t'
// value : INT -> 'int32_t'
// nameChoice : UPropertyNameChoice -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuuc.dll", {
u_getPropertyValueName: { parameters: ["i32", "i32", "i32"], result: "pointer" },
});
// lib.symbols.u_getPropertyValueName(property, value, nameChoice)
// property : UProperty -> "i32"
// value : INT -> "i32"
// nameChoice : UPropertyNameChoice -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
const char* u_getPropertyValueName(
int32_t property,
int32_t value,
int32_t nameChoice);
C, "icuuc.dll");
// $ffi->u_getPropertyValueName(property, value, nameChoice);
// property : UProperty
// value : INT
// nameChoice : UPropertyNameChoice
// 構造体/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 Icuuc extends Library {
Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
Pointer u_getPropertyValueName(
int property, // UProperty
int value, // INT
int nameChoice // UPropertyNameChoice
);
}@[Link("icuuc")]
lib Libicuuc
fun u_getPropertyValueName = u_getPropertyValueName(
property : Int32, # UProperty
value : Int32, # INT
nameChoice : Int32 # UPropertyNameChoice
) : UInt8*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef u_getPropertyValueNameNative = Pointer<Utf8> Function(Int32, Int32, Int32);
typedef u_getPropertyValueNameDart = Pointer<Utf8> Function(int, int, int);
final u_getPropertyValueName = DynamicLibrary.open('icuuc.dll')
.lookupFunction<u_getPropertyValueNameNative, u_getPropertyValueNameDart>('u_getPropertyValueName');
// property : UProperty -> Int32
// value : INT -> Int32
// nameChoice : UPropertyNameChoice -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function u_getPropertyValueName(
property: Integer; // UProperty
value: Integer; // INT
nameChoice: Integer // UPropertyNameChoice
): PAnsiChar; cdecl;
external 'icuuc.dll' name 'u_getPropertyValueName';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "u_getPropertyValueName"
c_u_getPropertyValueName :: Int32 -> Int32 -> Int32 -> IO CString
-- property : UProperty -> Int32
-- value : INT -> Int32
-- nameChoice : UPropertyNameChoice -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let u_getpropertyvaluename =
foreign "u_getPropertyValueName"
(int32_t @-> int32_t @-> int32_t @-> returning string)
(* property : UProperty -> int32_t *)
(* value : INT -> int32_t *)
(* nameChoice : UPropertyNameChoice -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)
(cffi:defcfun ("u_getPropertyValueName" u-get-property-value-name :convention :cdecl) :string
(property :int32) ; UProperty
(value :int32) ; INT
(name-choice :int32)) ; UPropertyNameChoice
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $u_getPropertyValueName = Win32::API::More->new('icuuc',
'LPSTR u_getPropertyValueName(int property, int value, int nameChoice)');
# my $ret = $u_getPropertyValueName->Call($property, $value, $nameChoice);
# property : UProperty -> int
# value : INT -> int
# nameChoice : UPropertyNameChoice -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。