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

uset_getSerializedSet

関数
直列化データから読み取り用USerializedSetを構築する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

CHAR uset_getSerializedSet(
    USerializedSet* fillSet,
    const WORD* src,
    INT srcLength
);

パラメーター

名前方向
fillSetUSerializedSet*inout
srcWORD*in
srcLengthINTin

戻り値の型: CHAR

各言語での呼び出し定義

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

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

uset_getSerializedSet = ctypes.cdll.icuuc.uset_getSerializedSet
uset_getSerializedSet.restype = ctypes.c_byte
uset_getSerializedSet.argtypes = [
    ctypes.c_void_p,  # fillSet : USerializedSet* in/out
    ctypes.POINTER(ctypes.c_ushort),  # src : WORD*
    ctypes.c_int,  # srcLength : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_getSerializedSet = icuuc.NewProc("uset_getSerializedSet")
)

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