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対象のシリアライズ済みセット(USerializedSet)へのポインタ。
rangeIndexINTin取得する範囲の0始まりインデックス。
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`,…) を使用。
const std = @import("std");

extern "icuuc" fn uset_getSerializedRange(
    set: [*c]USerializedSet, // USerializedSet*
    rangeIndex: i32, // INT
    pStart: [*c]i32, // INT* in/out
    pEnd: [*c]i32 // INT* in/out
) callconv(.c) i8;
proc uset_getSerializedRange(
    set: ptr USerializedSet,  # USerializedSet*
    rangeIndex: int32,  # INT
    pStart: ptr int32,  # INT* in/out
    pEnd: ptr int32  # INT* in/out
): int8 {.importc: "uset_getSerializedRange", cdecl, dynlib: "icuuc.dll".}
pragma(lib, "icuuc");
extern(C)
byte uset_getSerializedRange(
    USerializedSet* set,   // USerializedSet*
    int rangeIndex,   // INT
    int* pStart,   // INT* in/out
    int* pEnd   // INT* in/out
);
ccall((:uset_getSerializedRange, "icuuc.dll"), Int8,
      (Ptr{USerializedSet}, Int32, Ptr{Int32}, Ptr{Int32}),
      set, rangeIndex, pStart, pEnd)
# set : USerializedSet* -> Ptr{USerializedSet}
# rangeIndex : INT -> Int32
# pStart : INT* in/out -> Ptr{Int32}
# pEnd : INT* in/out -> Ptr{Int32}
local ffi = require("ffi")
ffi.cdef[[
int8_t uset_getSerializedRange(
    void* set,
    int32_t rangeIndex,
    int32_t* pStart,
    int32_t* pEnd);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.uset_getSerializedRange(set, rangeIndex, pStart, pEnd)
-- set : USerializedSet*
-- rangeIndex : INT
-- pStart : INT* in/out
-- pEnd : INT* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const uset_getSerializedRange = lib.func('__cdecl', 'uset_getSerializedRange', 'int8_t', ['void *', 'int32_t', 'int32_t *', 'int32_t *']);
// uset_getSerializedRange(set, rangeIndex, pStart, pEnd)
// set : USerializedSet* -> 'void *'
// rangeIndex : INT -> 'int32_t'
// pStart : INT* in/out -> 'int32_t *'
// pEnd : INT* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuuc.dll", {
  uset_getSerializedRange: { parameters: ["pointer", "i32", "pointer", "pointer"], result: "i8" },
});
// lib.symbols.uset_getSerializedRange(set, rangeIndex, pStart, pEnd)
// set : USerializedSet* -> "pointer"
// rangeIndex : INT -> "i32"
// pStart : INT* in/out -> "pointer"
// pEnd : INT* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int8_t uset_getSerializedRange(
    void* set,
    int32_t rangeIndex,
    int32_t* pStart,
    int32_t* pEnd);
C, "icuuc.dll");
// $ffi->uset_getSerializedRange(set, rangeIndex, pStart, pEnd);
// set : USerializedSet*
// rangeIndex : INT
// pStart : INT* in/out
// pEnd : INT* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Icuuc extends Library {
    Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
    byte uset_getSerializedRange(
        Pointer set,   // USerializedSet*
        int rangeIndex,   // INT
        IntByReference pStart,   // INT* in/out
        IntByReference pEnd   // INT* in/out
    );
}
@[Link("icuuc")]
lib Libicuuc
  fun uset_getSerializedRange = uset_getSerializedRange(
    set : USerializedSet*,   # USerializedSet*
    rangeIndex : Int32,   # INT
    pStart : Int32*,   # INT* in/out
    pEnd : Int32*   # INT* in/out
  ) : Int8
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef uset_getSerializedRangeNative = Int8 Function(Pointer<Void>, Int32, Pointer<Int32>, Pointer<Int32>);
typedef uset_getSerializedRangeDart = int Function(Pointer<Void>, int, Pointer<Int32>, Pointer<Int32>);
final uset_getSerializedRange = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<uset_getSerializedRangeNative, uset_getSerializedRangeDart>('uset_getSerializedRange');
// set : USerializedSet* -> Pointer<Void>
// rangeIndex : INT -> Int32
// pStart : INT* in/out -> Pointer<Int32>
// pEnd : INT* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
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';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "uset_getSerializedRange"
  c_uset_getSerializedRange :: Ptr () -> Int32 -> Ptr Int32 -> Ptr Int32 -> IO Int8
-- set : USerializedSet* -> Ptr ()
-- rangeIndex : INT -> Int32
-- pStart : INT* in/out -> Ptr Int32
-- pEnd : INT* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let uset_getserializedrange =
  foreign "uset_getSerializedRange"
    ((ptr void) @-> int32_t @-> (ptr int32_t) @-> (ptr int32_t) @-> returning int8_t)
(* set : USerializedSet* -> (ptr void) *)
(* rangeIndex : INT -> int32_t *)
(* pStart : INT* in/out -> (ptr int32_t) *)
(* pEnd : INT* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)

(cffi:defcfun ("uset_getSerializedRange" uset-get-serialized-range :convention :cdecl) :int8
  (set :pointer)   ; USerializedSet*
  (range-index :int32)   ; INT
  (p-start :pointer)   ; INT* in/out
  (p-end :pointer))   ; INT* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $uset_getSerializedRange = Win32::API::More->new('icuuc',
    'char uset_getSerializedRange(LPVOID set, int rangeIndex, LPVOID pStart, LPVOID pEnd)');
# my $ret = $uset_getSerializedRange->Call($set, $rangeIndex, $pStart, $pEnd);
# set : USerializedSet* -> LPVOID
# rangeIndex : INT -> int
# pStart : INT* in/out -> LPVOID
# pEnd : INT* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型