ホーム › Globalization › uset_containsAll
uset_containsAll
関数USetが別のUSetを完全に包含するかを判定する。
シグネチャ
// icuuc.dll
#include <windows.h>
CHAR uset_containsAll(
const USet* set1,
const USet* set2
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| set1 | USet* | in | 判定対象のUnicodeセット(包含する側)。 |
| set2 | USet* | in | set1に全要素が含まれるか検査されるUnicodeセット(部分集合候補)。 |
戻り値の型: CHAR
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
CHAR uset_containsAll(
const USet* set1,
const USet* set2
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern sbyte uset_containsAll(
ref IntPtr set1, // USet*
ref IntPtr set2 // USet*
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uset_containsAll(
ByRef set1 As IntPtr, ' USet*
ByRef set2 As IntPtr ' USet*
) As SByte
End Function' set1 : USet*
' set2 : USet*
Declare PtrSafe Function uset_containsAll Lib "icuuc" ( _
ByRef set1 As LongPtr, _
ByRef set2 As LongPtr) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
uset_containsAll = ctypes.cdll.icuuc.uset_containsAll
uset_containsAll.restype = ctypes.c_byte
uset_containsAll.argtypes = [
ctypes.c_void_p, # set1 : USet*
ctypes.c_void_p, # set2 : USet*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
uset_containsAll = Fiddle::Function.new(
lib['uset_containsAll'],
[
Fiddle::TYPE_VOIDP, # set1 : USet*
Fiddle::TYPE_VOIDP, # set2 : USet*
],
Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn uset_containsAll(
set1: *const isize, // USet*
set2: *const isize // USet*
) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte uset_containsAll(ref IntPtr set1, ref IntPtr set2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_containsAll' -Namespace Win32 -PassThru
# $api::uset_containsAll(set1, set2)#uselib "icuuc.dll"
#func global uset_containsAll "uset_containsAll" sptr, sptr
; uset_containsAll varptr(set1), varptr(set2) ; 戻り値は stat
; set1 : USet* -> "sptr"
; set2 : USet* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuuc.dll" #cfunc global uset_containsAll "uset_containsAll" var, var ; res = uset_containsAll(set1, set2) ; set1 : USet* -> "var" ; set2 : USet* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #cfunc global uset_containsAll "uset_containsAll" sptr, sptr ; res = uset_containsAll(varptr(set1), varptr(set2)) ; set1 : USet* -> "sptr" ; set2 : USet* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; CHAR uset_containsAll(USet* set1, USet* set2) #uselib "icuuc.dll" #cfunc global uset_containsAll "uset_containsAll" var, var ; res = uset_containsAll(set1, set2) ; set1 : USet* -> "var" ; set2 : USet* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; CHAR uset_containsAll(USet* set1, USet* set2) #uselib "icuuc.dll" #cfunc global uset_containsAll "uset_containsAll" intptr, intptr ; res = uset_containsAll(varptr(set1), varptr(set2)) ; set1 : USet* -> "intptr" ; set2 : USet* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procuset_containsAll = icuuc.NewProc("uset_containsAll")
)
// set1 (USet*), set2 (USet*)
r1, _, err := procuset_containsAll.Call(
uintptr(set1),
uintptr(set2),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CHARfunction uset_containsAll(
set1: Pointer; // USet*
set2: Pointer // USet*
): Shortint; cdecl;
external 'icuuc.dll' name 'uset_containsAll';result := DllCall("icuuc\uset_containsAll"
, "Ptr", set1 ; USet*
, "Ptr", set2 ; USet*
, "Cdecl Char") ; return: CHAR●uset_containsAll(set1, set2) = DLL("icuuc.dll", "char uset_containsAll(void*, void*)")
# 呼び出し: uset_containsAll(set1, set2)
# set1 : USet* -> "void*"
# set2 : USet* -> "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_containsAll(
set1: [*c]isize, // USet*
set2: [*c]isize // USet*
) callconv(.c) i8;proc uset_containsAll(
set1: ptr int, # USet*
set2: ptr int # USet*
): int8 {.importc: "uset_containsAll", cdecl, dynlib: "icuuc.dll".}pragma(lib, "icuuc");
extern(C)
byte uset_containsAll(
ptrdiff_t* set1, // USet*
ptrdiff_t* set2 // USet*
);ccall((:uset_containsAll, "icuuc.dll"), Int8,
(Ptr{Int}, Ptr{Int}),
set1, set2)
# set1 : USet* -> Ptr{Int}
# set2 : USet* -> Ptr{Int}local ffi = require("ffi")
ffi.cdef[[
int8_t uset_containsAll(
intptr_t* set1,
intptr_t* set2);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.uset_containsAll(set1, set2)
-- set1 : USet*
-- set2 : USet*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const uset_containsAll = lib.func('__cdecl', 'uset_containsAll', 'int8_t', ['intptr_t *', 'intptr_t *']);
// uset_containsAll(set1, set2)
// set1 : USet* -> 'intptr_t *'
// set2 : USet* -> 'intptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuuc.dll", {
uset_containsAll: { parameters: ["pointer", "pointer"], result: "i8" },
});
// lib.symbols.uset_containsAll(set1, set2)
// set1 : USet* -> "pointer"
// set2 : USet* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int8_t uset_containsAll(
intptr_t* set1,
intptr_t* set2);
C, "icuuc.dll");
// $ffi->uset_containsAll(set1, set2);
// set1 : USet*
// set2 : USet*
// 構造体/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);
byte uset_containsAll(
LongByReference set1, // USet*
LongByReference set2 // USet*
);
}@[Link("icuuc")]
lib Libicuuc
fun uset_containsAll = uset_containsAll(
set1 : LibC::SSizeT*, # USet*
set2 : LibC::SSizeT* # USet*
) : Int8
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef uset_containsAllNative = Int8 Function(Pointer<IntPtr>, Pointer<IntPtr>);
typedef uset_containsAllDart = int Function(Pointer<IntPtr>, Pointer<IntPtr>);
final uset_containsAll = DynamicLibrary.open('icuuc.dll')
.lookupFunction<uset_containsAllNative, uset_containsAllDart>('uset_containsAll');
// set1 : USet* -> Pointer<IntPtr>
// set2 : USet* -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function uset_containsAll(
set1: Pointer; // USet*
set2: Pointer // USet*
): Shortint; cdecl;
external 'icuuc.dll' name 'uset_containsAll';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "uset_containsAll"
c_uset_containsAll :: Ptr CIntPtr -> Ptr CIntPtr -> IO Int8
-- set1 : USet* -> Ptr CIntPtr
-- set2 : USet* -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let uset_containsall =
foreign "uset_containsAll"
((ptr intptr_t) @-> (ptr intptr_t) @-> returning int8_t)
(* set1 : USet* -> (ptr intptr_t) *)
(* set2 : USet* -> (ptr intptr_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)
(cffi:defcfun ("uset_containsAll" uset-contains-all :convention :cdecl) :int8
(set1 :pointer) ; USet*
(set2 :pointer)) ; USet*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $uset_containsAll = Win32::API::More->new('icuuc',
'char uset_containsAll(LPVOID set1, LPVOID set2)');
# my $ret = $uset_containsAll->Call($set1, $set2);
# set1 : USet* -> LPVOID
# set2 : USet* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。