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

ucol_getStrength

関数
コレータの比較強度レベルを取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

UColAttributeValue ucol_getStrength(
    const UCollator* coll
);

パラメーター

名前方向
collUCollator*in

戻り値の型: UColAttributeValue

各言語での呼び出し定義

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

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

ucol_getStrength = ctypes.cdll.icuin.ucol_getStrength
ucol_getStrength.restype = ctypes.c_int
ucol_getStrength.argtypes = [
    ctypes.c_void_p,  # coll : UCollator*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_getStrength = icuin.NewProc("ucol_getStrength")
)

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