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

uset_retainAll

関数
別のUSetとの共通要素のみを対象に残す。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void uset_retainAll(
    USet* set,
    const USet* retain
);

パラメーター

名前方向
setUSet*inout
retainUSet*in

戻り値の型: void

各言語での呼び出し定義

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

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

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

lib = Fiddle.dlopen('icuuc.dll')
uset_retainAll = Fiddle::Function.new(
  lib['uset_retainAll'],
  [
    Fiddle::TYPE_VOIDP,  # set : USet* in/out
    Fiddle::TYPE_VOIDP,  # retain : USet*
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uset_retainAll(
        set: *mut isize,  // USet* in/out
        retain: *const isize  // USet*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uset_retainAll(ref IntPtr set, ref IntPtr retain);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_retainAll' -Namespace Win32 -PassThru
# $api::uset_retainAll(set, retain)
#uselib "icuuc.dll"
#func global uset_retainAll "uset_retainAll" sptr, sptr
; uset_retainAll set, retain
; set : USet* in/out -> "sptr"
; retain : USet* -> "sptr"
#uselib "icuuc.dll"
#func global uset_retainAll "uset_retainAll" int, int
; uset_retainAll set, retain
; set : USet* in/out -> "int"
; retain : USet* -> "int"
; void uset_retainAll(USet* set, USet* retain)
#uselib "icuuc.dll"
#func global uset_retainAll "uset_retainAll" int, int
; uset_retainAll set, retain
; set : USet* in/out -> "int"
; retain : USet* -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_retainAll = icuuc.NewProc("uset_retainAll")
)

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