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

ucol_getMaxExpansion

関数
指定照合要素の最大展開数を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

INT ucol_getMaxExpansion(
    const UCollationElements* elems,
    INT order
);

パラメーター

名前方向
elemsUCollationElements*in
orderINTin

戻り値の型: INT

各言語での呼び出し定義

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

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

ucol_getMaxExpansion = ctypes.cdll.icuin.ucol_getMaxExpansion
ucol_getMaxExpansion.restype = ctypes.c_int
ucol_getMaxExpansion.argtypes = [
    ctypes.c_void_p,  # elems : UCollationElements*
    ctypes.c_int,  # order : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_getMaxExpansion = icuin.NewProc("ucol_getMaxExpansion")
)

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