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

uset_hasStrings

関数
USetが文字列要素を含むかどうかを判定する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

CHAR uset_hasStrings(
    const USet* set
);

パラメーター

名前方向
setUSet*in

戻り値の型: CHAR

各言語での呼び出し定義

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

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

uset_hasStrings = ctypes.cdll.icu.uset_hasStrings
uset_hasStrings.restype = ctypes.c_byte
uset_hasStrings.argtypes = [
    ctypes.c_void_p,  # set : USet*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icu.dll')
uset_hasStrings = Fiddle::Function.new(
  lib['uset_hasStrings'],
  [
    Fiddle::TYPE_VOIDP,  # set : USet*
  ],
  Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)
#[link(name = "icu")]
extern "C" {
    fn uset_hasStrings(
        set: *const isize  // USet*
    ) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icu.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte uset_hasStrings(ref IntPtr set);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icu_uset_hasStrings' -Namespace Win32 -PassThru
# $api::uset_hasStrings(set)
#uselib "icu.dll"
#func global uset_hasStrings "uset_hasStrings" sptr
; uset_hasStrings set   ; 戻り値は stat
; set : USet* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icu.dll"
#cfunc global uset_hasStrings "uset_hasStrings" int
; res = uset_hasStrings(set)
; set : USet* -> "int"
; CHAR uset_hasStrings(USet* set)
#uselib "icu.dll"
#cfunc global uset_hasStrings "uset_hasStrings" int
; res = uset_hasStrings(set)
; set : USet* -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procuset_hasStrings = icu.NewProc("uset_hasStrings")
)

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