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

uset_getRangeCount

関数
USetに含まれる連続範囲の個数を返す。
DLLicu.dll呼出規約cdecl

シグネチャ

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

INT uset_getRangeCount(
    const USet* set
);

パラメーター

名前方向
setUSet*in

戻り値の型: INT

各言語での呼び出し定義

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

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

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

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

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procuset_getRangeCount = icu.NewProc("uset_getRangeCount")
)

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