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

uset_closeOver

関数
大文字小文字など同値関係でUSetを拡張する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void uset_closeOver(
    USet* set,
    INT attributes
);

パラメーター

名前方向説明
setUSet*inout対象のUnicodeセット。閉包演算で関連文字が追加される。
attributesINTin閉包の種類を示すビットフラグ。USET_CASE_INSENSITIVEやUSET_ADD_CASE_MAPPINGSなどを指定する。

戻り値の型: void

各言語での呼び出し定義

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

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

uset_closeOver = ctypes.cdll.icuuc.uset_closeOver
uset_closeOver.restype = None
uset_closeOver.argtypes = [
    ctypes.c_void_p,  # set : USet* in/out
    ctypes.c_int,  # attributes : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
uset_closeOver = Fiddle::Function.new(
  lib['uset_closeOver'],
  [
    Fiddle::TYPE_VOIDP,  # set : USet* in/out
    Fiddle::TYPE_INT,  # attributes : INT
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uset_closeOver(
        set: *mut isize,  // USet* in/out
        attributes: i32  // INT
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uset_closeOver(ref IntPtr set, int attributes);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_closeOver' -Namespace Win32 -PassThru
# $api::uset_closeOver(set, attributes)
#uselib "icuuc.dll"
#func global uset_closeOver "uset_closeOver" sptr, sptr
; uset_closeOver varptr(set), attributes
; set : USet* in/out -> "sptr"
; attributes : INT -> "sptr"
出力引数:
#uselib "icuuc.dll"
#func global uset_closeOver "uset_closeOver" var, int
; uset_closeOver set, attributes
; set : USet* in/out -> "var"
; attributes : INT -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void uset_closeOver(USet* set, INT attributes)
#uselib "icuuc.dll"
#func global uset_closeOver "uset_closeOver" var, int
; uset_closeOver set, attributes
; set : USet* in/out -> "var"
; attributes : INT -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_closeOver = icuuc.NewProc("uset_closeOver")
)

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

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

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

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

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