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

uset_applyIntPropertyValue

関数
整数プロパティ値に一致する文字をUSetに設定する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void uset_applyIntPropertyValue(
    USet* set,
    UProperty prop,
    INT value,
    UErrorCode* ec
);

パラメーター

名前方向説明
setUSet*inout結果を格納する対象のUSetオブジェクトへのポインタ。
propUPropertyin対象とするUnicodeプロパティを示す列挙値。
valueINTin条件とするプロパティ値。この値を持つ全文字を集合とする。
ecUErrorCode*inoutICUのエラーコードを受け渡すポインタ。呼び出し前にU_ZERO_ERRORで初期化する。

戻り値の型: void

各言語での呼び出し定義

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

void uset_applyIntPropertyValue(
    USet* set,
    UProperty prop,
    INT value,
    UErrorCode* ec
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uset_applyIntPropertyValue(
    ref IntPtr set,   // USet* in/out
    int prop,   // UProperty
    int value,   // INT
    ref int ec   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uset_applyIntPropertyValue(
    ByRef [set] As IntPtr,   ' USet* in/out
    prop As Integer,   ' UProperty
    value As Integer,   ' INT
    ByRef ec As Integer   ' UErrorCode* in/out
)
End Sub
' set : USet* in/out
' prop : UProperty
' value : INT
' ec : UErrorCode* in/out
Declare PtrSafe Sub uset_applyIntPropertyValue Lib "icuuc" ( _
    ByRef set As LongPtr, _
    ByVal prop As Long, _
    ByVal value 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_applyIntPropertyValue = ctypes.cdll.icuuc.uset_applyIntPropertyValue
uset_applyIntPropertyValue.restype = None
uset_applyIntPropertyValue.argtypes = [
    ctypes.c_void_p,  # set : USet* in/out
    ctypes.c_int,  # prop : UProperty
    ctypes.c_int,  # value : INT
    ctypes.c_void_p,  # ec : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_applyIntPropertyValue = icuuc.NewProc("uset_applyIntPropertyValue")
)

// set (USet* in/out), prop (UProperty), value (INT), ec (UErrorCode* in/out)
r1, _, err := procuset_applyIntPropertyValue.Call(
	uintptr(set),
	uintptr(prop),
	uintptr(value),
	uintptr(ec),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure uset_applyIntPropertyValue(
  set: Pointer;   // USet* in/out
  prop: Integer;   // UProperty
  value: Integer;   // INT
  ec: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icuuc.dll' name 'uset_applyIntPropertyValue';
result := DllCall("icuuc\uset_applyIntPropertyValue"
    , "Ptr", set   ; USet* in/out
    , "Int", prop   ; UProperty
    , "Int", value   ; INT
    , "Ptr", ec   ; UErrorCode* in/out
    , "Cdecl Int")   ; return: void
●uset_applyIntPropertyValue(set, prop, value, ec) = DLL("icuuc.dll", "int uset_applyIntPropertyValue(void*, int, int, void*)")
# 呼び出し: uset_applyIntPropertyValue(set, prop, value, ec)
# set : USet* in/out -> "void*"
# prop : UProperty -> "int"
# value : 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_applyIntPropertyValue(
    set: [*c]isize, // USet* in/out
    prop: i32, // UProperty
    value: i32, // INT
    ec: [*c]i32 // UErrorCode* in/out
) callconv(.c) void;
proc uset_applyIntPropertyValue(
    set: ptr int,  # USet* in/out
    prop: int32,  # UProperty
    value: int32,  # INT
    ec: ptr int32  # UErrorCode* in/out
) {.importc: "uset_applyIntPropertyValue", cdecl, dynlib: "icuuc.dll".}
pragma(lib, "icuuc");
extern(C)
void uset_applyIntPropertyValue(
    ptrdiff_t* set,   // USet* in/out
    int prop,   // UProperty
    int value,   // INT
    int* ec   // UErrorCode* in/out
);
ccall((:uset_applyIntPropertyValue, "icuuc.dll"), Cvoid,
      (Ptr{Int}, Int32, Int32, Ptr{Int32}),
      set, prop, value, ec)
# set : USet* in/out -> Ptr{Int}
# prop : UProperty -> Int32
# value : INT -> Int32
# ec : UErrorCode* in/out -> Ptr{Int32}
local ffi = require("ffi")
ffi.cdef[[
void uset_applyIntPropertyValue(
    intptr_t* set,
    int32_t prop,
    int32_t value,
    int32_t* ec);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.uset_applyIntPropertyValue(set, prop, value, ec)
-- set : USet* in/out
-- prop : UProperty
-- value : INT
-- ec : UErrorCode* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const uset_applyIntPropertyValue = lib.func('__cdecl', 'uset_applyIntPropertyValue', 'void', ['intptr_t *', 'int32_t', 'int32_t', 'int32_t *']);
// uset_applyIntPropertyValue(set, prop, value, ec)
// set : USet* in/out -> 'intptr_t *'
// prop : UProperty -> 'int32_t'
// value : INT -> 'int32_t'
// ec : UErrorCode* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuuc.dll", {
  uset_applyIntPropertyValue: { parameters: ["pointer", "i32", "i32", "pointer"], result: "void" },
});
// lib.symbols.uset_applyIntPropertyValue(set, prop, value, ec)
// set : USet* in/out -> "pointer"
// prop : UProperty -> "i32"
// value : INT -> "i32"
// ec : UErrorCode* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void uset_applyIntPropertyValue(
    intptr_t* set,
    int32_t prop,
    int32_t value,
    int32_t* ec);
C, "icuuc.dll");
// $ffi->uset_applyIntPropertyValue(set, prop, value, ec);
// set : USet* in/out
// prop : UProperty
// value : 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_applyIntPropertyValue(
        LongByReference set,   // USet* in/out
        int prop,   // UProperty
        int value,   // INT
        IntByReference ec   // UErrorCode* in/out
    );
}
@[Link("icuuc")]
lib Libicuuc
  fun uset_applyIntPropertyValue = uset_applyIntPropertyValue(
    set : LibC::SSizeT*,   # USet* in/out
    prop : Int32,   # UProperty
    value : Int32,   # INT
    ec : Int32*   # UErrorCode* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef uset_applyIntPropertyValueNative = Void Function(Pointer<IntPtr>, Int32, Int32, Pointer<Int32>);
typedef uset_applyIntPropertyValueDart = void Function(Pointer<IntPtr>, int, int, Pointer<Int32>);
final uset_applyIntPropertyValue = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<uset_applyIntPropertyValueNative, uset_applyIntPropertyValueDart>('uset_applyIntPropertyValue');
// set : USet* in/out -> Pointer<IntPtr>
// prop : UProperty -> Int32
// value : INT -> Int32
// ec : UErrorCode* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure uset_applyIntPropertyValue(
  set: Pointer;   // USet* in/out
  prop: Integer;   // UProperty
  value: Integer;   // INT
  ec: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icuuc.dll' name 'uset_applyIntPropertyValue';
import Foreign
import Foreign.C.Types
import Foreign.C.String

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

let uset_applyintpropertyvalue =
  foreign "uset_applyIntPropertyValue"
    ((ptr intptr_t) @-> int32_t @-> int32_t @-> (ptr int32_t) @-> returning void)
(* set : USet* in/out -> (ptr intptr_t) *)
(* prop : UProperty -> int32_t *)
(* value : 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_applyIntPropertyValue" uset-apply-int-property-value :convention :cdecl) :void
  (set :pointer)   ; USet* in/out
  (prop :int32)   ; UProperty
  (value :int32)   ; INT
  (ec :pointer))   ; UErrorCode* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $uset_applyIntPropertyValue = Win32::API::More->new('icuuc',
    'void uset_applyIntPropertyValue(LPVOID set, int prop, int value, LPVOID ec)');
# my $ret = $uset_applyIntPropertyValue->Call($set, $prop, $value, $ec);
# set : USet* in/out -> LPVOID
# prop : UProperty -> int
# value : INT -> int
# ec : UErrorCode* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型