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

uset_applyPropertyAlias

関数
プロパティ名と値の別名でUSetを設定する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void uset_applyPropertyAlias(
    USet* set,
    const WORD* prop,
    INT propLength,
    const WORD* value,
    INT valueLength,
    UErrorCode* ec
);

パラメーター

名前方向
setUSet*inout
propWORD*in
propLengthINTin
valueWORD*in
valueLengthINTin
ecUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

void uset_applyPropertyAlias(
    USet* set,
    const WORD* prop,
    INT propLength,
    const WORD* value,
    INT valueLength,
    UErrorCode* ec
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uset_applyPropertyAlias(
    ref IntPtr set,   // USet* in/out
    ref ushort prop,   // WORD*
    int propLength,   // INT
    ref ushort value,   // WORD*
    int valueLength,   // INT
    ref int ec   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uset_applyPropertyAlias(
    ByRef [set] As IntPtr,   ' USet* in/out
    ByRef prop As UShort,   ' WORD*
    propLength As Integer,   ' INT
    ByRef value As UShort,   ' WORD*
    valueLength As Integer,   ' INT
    ByRef ec As Integer   ' UErrorCode* in/out
)
End Sub
' set : USet* in/out
' prop : WORD*
' propLength : INT
' value : WORD*
' valueLength : INT
' ec : UErrorCode* in/out
Declare PtrSafe Sub uset_applyPropertyAlias Lib "icuuc" ( _
    ByRef set As LongPtr, _
    ByRef prop As Integer, _
    ByVal propLength As Long, _
    ByRef value As Integer, _
    ByVal valueLength As Long, _
    ByRef ec As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

uset_applyPropertyAlias = ctypes.cdll.icuuc.uset_applyPropertyAlias
uset_applyPropertyAlias.restype = None
uset_applyPropertyAlias.argtypes = [
    ctypes.c_void_p,  # set : USet* in/out
    ctypes.POINTER(ctypes.c_ushort),  # prop : WORD*
    ctypes.c_int,  # propLength : INT
    ctypes.POINTER(ctypes.c_ushort),  # value : WORD*
    ctypes.c_int,  # valueLength : INT
    ctypes.c_void_p,  # ec : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
uset_applyPropertyAlias = Fiddle::Function.new(
  lib['uset_applyPropertyAlias'],
  [
    Fiddle::TYPE_VOIDP,  # set : USet* in/out
    Fiddle::TYPE_VOIDP,  # prop : WORD*
    Fiddle::TYPE_INT,  # propLength : INT
    Fiddle::TYPE_VOIDP,  # value : WORD*
    Fiddle::TYPE_INT,  # valueLength : INT
    Fiddle::TYPE_VOIDP,  # ec : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uset_applyPropertyAlias(
        set: *mut isize,  // USet* in/out
        prop: *const u16,  // WORD*
        propLength: i32,  // INT
        value: *const u16,  // WORD*
        valueLength: i32,  // INT
        ec: *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 uset_applyPropertyAlias(ref IntPtr set, ref ushort prop, int propLength, ref ushort value, int valueLength, ref int ec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_applyPropertyAlias' -Namespace Win32 -PassThru
# $api::uset_applyPropertyAlias(set, prop, propLength, value, valueLength, ec)
#uselib "icuuc.dll"
#func global uset_applyPropertyAlias "uset_applyPropertyAlias" sptr, sptr, sptr, sptr, sptr, sptr
; uset_applyPropertyAlias set, varptr(prop), propLength, varptr(value), valueLength, ec
; set : USet* in/out -> "sptr"
; prop : WORD* -> "sptr"
; propLength : INT -> "sptr"
; value : WORD* -> "sptr"
; valueLength : INT -> "sptr"
; ec : UErrorCode* in/out -> "sptr"
出力引数:
#uselib "icuuc.dll"
#func global uset_applyPropertyAlias "uset_applyPropertyAlias" int, var, int, var, int, int
; uset_applyPropertyAlias set, prop, propLength, value, valueLength, ec
; set : USet* in/out -> "int"
; prop : WORD* -> "var"
; propLength : INT -> "int"
; value : WORD* -> "var"
; valueLength : INT -> "int"
; ec : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void uset_applyPropertyAlias(USet* set, WORD* prop, INT propLength, WORD* value, INT valueLength, UErrorCode* ec)
#uselib "icuuc.dll"
#func global uset_applyPropertyAlias "uset_applyPropertyAlias" int, var, int, var, int, int
; uset_applyPropertyAlias set, prop, propLength, value, valueLength, ec
; set : USet* in/out -> "int"
; prop : WORD* -> "var"
; propLength : INT -> "int"
; value : WORD* -> "var"
; valueLength : INT -> "int"
; ec : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_applyPropertyAlias = icuuc.NewProc("uset_applyPropertyAlias")
)

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