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結果を格納する対象のUSetオブジェクトへのポインタ。
propWORD*in対象プロパティの別名文字列(UTF-16)へのポインタ。
propLengthINTinpropの長さ(UChar単位)。NUL終端なら-1を指定できる。
valueWORD*in条件とするプロパティ値の別名文字列(UTF-16)。NULL可。
valueLengthINTinvalueの長さ(UChar単位)。NUL終端なら-1を指定できる。
ecUErrorCode*inoutICUのエラーコードを受け渡すポインタ。呼び出し前にU_ZERO_ERRORで初期化する。

戻り値の型: 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 varptr(set), varptr(prop), propLength, varptr(value), valueLength, varptr(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" var, var, int, var, int, var
; uset_applyPropertyAlias set, prop, propLength, value, valueLength, ec
; set : USet* in/out -> "var"
; prop : WORD* -> "var"
; propLength : INT -> "int"
; value : WORD* -> "var"
; valueLength : INT -> "int"
; ec : UErrorCode* in/out -> "var"
; ※出力/バッファ引数は 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" var, var, int, var, int, var
; uset_applyPropertyAlias set, prop, propLength, value, valueLength, ec
; set : USet* in/out -> "var"
; prop : WORD* -> "var"
; propLength : INT -> "int"
; value : WORD* -> "var"
; valueLength : INT -> "int"
; ec : UErrorCode* in/out -> "var"
; ※出力/バッファ引数は 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`,…) を使用。
const std = @import("std");

extern "icuuc" fn uset_applyPropertyAlias(
    set: [*c]isize, // USet* in/out
    prop: [*c]u16, // WORD*
    propLength: i32, // INT
    value: [*c]u16, // WORD*
    valueLength: i32, // INT
    ec: [*c]i32 // UErrorCode* in/out
) callconv(.c) void;
proc uset_applyPropertyAlias(
    set: ptr int,  # USet* in/out
    prop: ptr uint16,  # WORD*
    propLength: int32,  # INT
    value: ptr uint16,  # WORD*
    valueLength: int32,  # INT
    ec: ptr int32  # UErrorCode* in/out
) {.importc: "uset_applyPropertyAlias", cdecl, dynlib: "icuuc.dll".}
pragma(lib, "icuuc");
extern(C)
void uset_applyPropertyAlias(
    ptrdiff_t* set,   // USet* in/out
    ushort* prop,   // WORD*
    int propLength,   // INT
    ushort* value,   // WORD*
    int valueLength,   // INT
    int* ec   // UErrorCode* in/out
);
ccall((:uset_applyPropertyAlias, "icuuc.dll"), Cvoid,
      (Ptr{Int}, Ptr{UInt16}, Int32, Ptr{UInt16}, Int32, Ptr{Int32}),
      set, prop, propLength, value, valueLength, ec)
# set : USet* in/out -> Ptr{Int}
# prop : WORD* -> Ptr{UInt16}
# propLength : INT -> Int32
# value : WORD* -> Ptr{UInt16}
# valueLength : INT -> Int32
# ec : UErrorCode* in/out -> Ptr{Int32}
local ffi = require("ffi")
ffi.cdef[[
void uset_applyPropertyAlias(
    intptr_t* set,
    uint16_t* prop,
    int32_t propLength,
    uint16_t* value,
    int32_t valueLength,
    int32_t* ec);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.uset_applyPropertyAlias(set, prop, propLength, value, valueLength, ec)
-- set : USet* in/out
-- prop : WORD*
-- propLength : INT
-- value : WORD*
-- valueLength : INT
-- ec : UErrorCode* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const uset_applyPropertyAlias = lib.func('__cdecl', 'uset_applyPropertyAlias', 'void', ['intptr_t *', 'uint16_t *', 'int32_t', 'uint16_t *', 'int32_t', 'int32_t *']);
// uset_applyPropertyAlias(set, prop, propLength, value, valueLength, ec)
// set : USet* in/out -> 'intptr_t *'
// prop : WORD* -> 'uint16_t *'
// propLength : INT -> 'int32_t'
// value : WORD* -> 'uint16_t *'
// valueLength : INT -> 'int32_t'
// ec : UErrorCode* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuuc.dll", {
  uset_applyPropertyAlias: { parameters: ["pointer", "pointer", "i32", "pointer", "i32", "pointer"], result: "void" },
});
// lib.symbols.uset_applyPropertyAlias(set, prop, propLength, value, valueLength, ec)
// set : USet* in/out -> "pointer"
// prop : WORD* -> "pointer"
// propLength : INT -> "i32"
// value : WORD* -> "pointer"
// valueLength : INT -> "i32"
// ec : UErrorCode* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void uset_applyPropertyAlias(
    intptr_t* set,
    uint16_t* prop,
    int32_t propLength,
    uint16_t* value,
    int32_t valueLength,
    int32_t* ec);
C, "icuuc.dll");
// $ffi->uset_applyPropertyAlias(set, prop, propLength, value, valueLength, ec);
// set : USet* in/out
// prop : WORD*
// propLength : INT
// value : WORD*
// valueLength : INT
// ec : 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 Icuuc extends Library {
    Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
    void uset_applyPropertyAlias(
        LongByReference set,   // USet* in/out
        ShortByReference prop,   // WORD*
        int propLength,   // INT
        ShortByReference value,   // WORD*
        int valueLength,   // INT
        IntByReference ec   // UErrorCode* in/out
    );
}
@[Link("icuuc")]
lib Libicuuc
  fun uset_applyPropertyAlias = uset_applyPropertyAlias(
    set : LibC::SSizeT*,   # USet* in/out
    prop : UInt16*,   # WORD*
    propLength : Int32,   # INT
    value : UInt16*,   # WORD*
    valueLength : Int32,   # INT
    ec : Int32*   # UErrorCode* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef uset_applyPropertyAliasNative = Void Function(Pointer<IntPtr>, Pointer<Uint16>, Int32, Pointer<Uint16>, Int32, Pointer<Int32>);
typedef uset_applyPropertyAliasDart = void Function(Pointer<IntPtr>, Pointer<Uint16>, int, Pointer<Uint16>, int, Pointer<Int32>);
final uset_applyPropertyAlias = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<uset_applyPropertyAliasNative, uset_applyPropertyAliasDart>('uset_applyPropertyAlias');
// set : USet* in/out -> Pointer<IntPtr>
// prop : WORD* -> Pointer<Uint16>
// propLength : INT -> Int32
// value : WORD* -> Pointer<Uint16>
// valueLength : INT -> Int32
// ec : UErrorCode* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
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';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "uset_applyPropertyAlias"
  c_uset_applyPropertyAlias :: Ptr CIntPtr -> Ptr Word16 -> Int32 -> Ptr Word16 -> Int32 -> Ptr Int32 -> IO ()
-- set : USet* in/out -> Ptr CIntPtr
-- prop : WORD* -> Ptr Word16
-- propLength : INT -> Int32
-- value : WORD* -> Ptr Word16
-- valueLength : INT -> Int32
-- ec : UErrorCode* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let uset_applypropertyalias =
  foreign "uset_applyPropertyAlias"
    ((ptr intptr_t) @-> (ptr uint16_t) @-> int32_t @-> (ptr uint16_t) @-> int32_t @-> (ptr int32_t) @-> returning void)
(* set : USet* in/out -> (ptr intptr_t) *)
(* prop : WORD* -> (ptr uint16_t) *)
(* propLength : INT -> int32_t *)
(* value : WORD* -> (ptr uint16_t) *)
(* valueLength : INT -> int32_t *)
(* ec : UErrorCode* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)

(cffi:defcfun ("uset_applyPropertyAlias" uset-apply-property-alias :convention :cdecl) :void
  (set :pointer)   ; USet* in/out
  (prop :pointer)   ; WORD*
  (prop-length :int32)   ; INT
  (value :pointer)   ; WORD*
  (value-length :int32)   ; INT
  (ec :pointer))   ; UErrorCode* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $uset_applyPropertyAlias = Win32::API::More->new('icuuc',
    'void uset_applyPropertyAlias(LPVOID set, LPVOID prop, int propLength, LPVOID value, int valueLength, LPVOID ec)');
# my $ret = $uset_applyPropertyAlias->Call($set, $prop, $propLength, $value, $valueLength, $ec);
# set : USet* in/out -> LPVOID
# prop : WORD* -> LPVOID
# propLength : INT -> int
# value : WORD* -> LPVOID
# valueLength : INT -> int
# ec : UErrorCode* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型