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

uset_getSerializedRange

関数
直列化済み集合の指定範囲の開始終了値を取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

CHAR uset_getSerializedRange(
    const USerializedSet* set,
    INT rangeIndex,
    INT* pStart,
    INT* pEnd
);

パラメーター

名前方向
setUSerializedSet*in
rangeIndexINTin
pStartINT*inout
pEndINT*inout

戻り値の型: CHAR

各言語での呼び出し定義

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

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

uset_getSerializedRange = ctypes.cdll.icuuc.uset_getSerializedRange
uset_getSerializedRange.restype = ctypes.c_byte
uset_getSerializedRange.argtypes = [
    ctypes.c_void_p,  # set : USerializedSet*
    ctypes.c_int,  # rangeIndex : INT
    ctypes.POINTER(ctypes.c_int),  # pStart : INT* in/out
    ctypes.POINTER(ctypes.c_int),  # pEnd : INT* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
uset_getSerializedRange = Fiddle::Function.new(
  lib['uset_getSerializedRange'],
  [
    Fiddle::TYPE_VOIDP,  # set : USerializedSet*
    Fiddle::TYPE_INT,  # rangeIndex : INT
    Fiddle::TYPE_VOIDP,  # pStart : INT* in/out
    Fiddle::TYPE_VOIDP,  # pEnd : INT* in/out
  ],
  Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uset_getSerializedRange(
        set: *const USerializedSet,  // USerializedSet*
        rangeIndex: i32,  // INT
        pStart: *mut i32,  // INT* in/out
        pEnd: *mut i32  // INT* in/out
    ) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte uset_getSerializedRange(IntPtr set, int rangeIndex, ref int pStart, ref int pEnd);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_getSerializedRange' -Namespace Win32 -PassThru
# $api::uset_getSerializedRange(set, rangeIndex, pStart, pEnd)
#uselib "icuuc.dll"
#func global uset_getSerializedRange "uset_getSerializedRange" sptr, sptr, sptr, sptr
; uset_getSerializedRange varptr(set), rangeIndex, varptr(pStart), varptr(pEnd)   ; 戻り値は stat
; set : USerializedSet* -> "sptr"
; rangeIndex : INT -> "sptr"
; pStart : INT* in/out -> "sptr"
; pEnd : INT* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuuc.dll"
#cfunc global uset_getSerializedRange "uset_getSerializedRange" var, int, var, var
; res = uset_getSerializedRange(set, rangeIndex, pStart, pEnd)
; set : USerializedSet* -> "var"
; rangeIndex : INT -> "int"
; pStart : INT* in/out -> "var"
; pEnd : INT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; CHAR uset_getSerializedRange(USerializedSet* set, INT rangeIndex, INT* pStart, INT* pEnd)
#uselib "icuuc.dll"
#cfunc global uset_getSerializedRange "uset_getSerializedRange" var, int, var, var
; res = uset_getSerializedRange(set, rangeIndex, pStart, pEnd)
; set : USerializedSet* -> "var"
; rangeIndex : INT -> "int"
; pStart : INT* in/out -> "var"
; pEnd : INT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_getSerializedRange = icuuc.NewProc("uset_getSerializedRange")
)

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