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

ucol_setMaxVariable

関数
可変扱いとする最大文字グループを設定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void ucol_setMaxVariable(
    UCollator* coll,
    UColReorderCode group,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
collUCollator*inout
groupUColReorderCodein
pErrorCodeUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

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

ucol_setMaxVariable = ctypes.cdll.icuin.ucol_setMaxVariable
ucol_setMaxVariable.restype = None
ucol_setMaxVariable.argtypes = [
    ctypes.c_void_p,  # coll : UCollator* in/out
    ctypes.c_int,  # group : UColReorderCode
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_setMaxVariable = icuin.NewProc("ucol_setMaxVariable")
)

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