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

ucol_setStrength

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

シグネチャ

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

void ucol_setStrength(
    UCollator* coll,
    UColAttributeValue strength
);

パラメーター

名前方向
collUCollator*inout
strengthUColAttributeValuein

戻り値の型: void

各言語での呼び出し定義

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

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

ucol_setStrength = ctypes.cdll.icuin.ucol_setStrength
ucol_setStrength.restype = None
ucol_setStrength.argtypes = [
    ctypes.c_void_p,  # coll : UCollator* in/out
    ctypes.c_int,  # strength : UColAttributeValue
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ucol_setStrength = Fiddle::Function.new(
  lib['ucol_setStrength'],
  [
    Fiddle::TYPE_VOIDP,  # coll : UCollator* in/out
    Fiddle::TYPE_INT,  # strength : UColAttributeValue
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucol_setStrength(
        coll: *mut isize,  // UCollator* in/out
        strength: i32  // UColAttributeValue
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucol_setStrength(ref IntPtr coll, int strength);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucol_setStrength' -Namespace Win32 -PassThru
# $api::ucol_setStrength(coll, strength)
#uselib "icuin.dll"
#func global ucol_setStrength "ucol_setStrength" sptr, sptr
; ucol_setStrength coll, strength
; coll : UCollator* in/out -> "sptr"
; strength : UColAttributeValue -> "sptr"
#uselib "icuin.dll"
#func global ucol_setStrength "ucol_setStrength" int, int
; ucol_setStrength coll, strength
; coll : UCollator* in/out -> "int"
; strength : UColAttributeValue -> "int"
; void ucol_setStrength(UCollator* coll, UColAttributeValue strength)
#uselib "icuin.dll"
#func global ucol_setStrength "ucol_setStrength" int, int
; ucol_setStrength coll, strength
; coll : UCollator* in/out -> "int"
; strength : UColAttributeValue -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_setStrength = icuin.NewProc("ucol_setStrength")
)

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