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

u_getPropertyValueName

関数
プロパティ値に対応する名前を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

LPSTR u_getPropertyValueName(
    UProperty property,
    INT value,
    UPropertyNameChoice nameChoice
);

パラメーター

名前方向
propertyUPropertyin
valueINTin
nameChoiceUPropertyNameChoicein

戻り値の型: 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   // LPSTR
function 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`,…) を使用。