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

uset_containsSome

関数
二つのUSetに共通要素があるかを判定する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

CHAR uset_containsSome(
    const USet* set1,
    const USet* set2
);

パラメーター

名前方向
set1USet*in
set2USet*in

戻り値の型: CHAR

各言語での呼び出し定義

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

CHAR uset_containsSome(
    const USet* set1,
    const USet* set2
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern sbyte uset_containsSome(
    ref IntPtr set1,   // USet*
    ref IntPtr set2   // USet*
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uset_containsSome(
    ByRef set1 As IntPtr,   ' USet*
    ByRef set2 As IntPtr   ' USet*
) As SByte
End Function
' set1 : USet*
' set2 : USet*
Declare PtrSafe Function uset_containsSome 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_containsSome = ctypes.cdll.icuuc.uset_containsSome
uset_containsSome.restype = ctypes.c_byte
uset_containsSome.argtypes = [
    ctypes.c_void_p,  # set1 : USet*
    ctypes.c_void_p,  # set2 : USet*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
uset_containsSome = Fiddle::Function.new(
  lib['uset_containsSome'],
  [
    Fiddle::TYPE_VOIDP,  # set1 : USet*
    Fiddle::TYPE_VOIDP,  # set2 : USet*
  ],
  Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uset_containsSome(
        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_containsSome(ref IntPtr set1, ref IntPtr set2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_containsSome' -Namespace Win32 -PassThru
# $api::uset_containsSome(set1, set2)
#uselib "icuuc.dll"
#func global uset_containsSome "uset_containsSome" sptr, sptr
; uset_containsSome set1, set2   ; 戻り値は stat
; set1 : USet* -> "sptr"
; set2 : USet* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global uset_containsSome "uset_containsSome" int, int
; res = uset_containsSome(set1, set2)
; set1 : USet* -> "int"
; set2 : USet* -> "int"
; CHAR uset_containsSome(USet* set1, USet* set2)
#uselib "icuuc.dll"
#cfunc global uset_containsSome "uset_containsSome" int, int
; res = uset_containsSome(set1, set2)
; set1 : USet* -> "int"
; set2 : USet* -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_containsSome = icuuc.NewProc("uset_containsSome")
)

// set1 (USet*), set2 (USet*)
r1, _, err := procuset_containsSome.Call(
	uintptr(set1),
	uintptr(set2),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // CHAR
function uset_containsSome(
  set1: Pointer;   // USet*
  set2: Pointer   // USet*
): Shortint; cdecl;
  external 'icuuc.dll' name 'uset_containsSome';
result := DllCall("icuuc\uset_containsSome"
    , "Ptr", set1   ; USet*
    , "Ptr", set2   ; USet*
    , "Cdecl Char")   ; return: CHAR
●uset_containsSome(set1, set2) = DLL("icuuc.dll", "char uset_containsSome(void*, void*)")
# 呼び出し: uset_containsSome(set1, set2)
# set1 : USet* -> "void*"
# set2 : USet* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。