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

ucol_greaterOrEqual

関数
照合順で前者が後者以上か判定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

CHAR ucol_greaterOrEqual(
    const UCollator* coll,
    const WORD* source,
    INT sourceLength,
    const WORD* target,
    INT targetLength
);

パラメーター

名前方向説明
collUCollator*in比較に用いる照合器(UCollator)を指す。
sourceWORD*in比較元のUTF-16文字列を指す。
sourceLengthINTinsourceの長さをUChar単位で指定する。-1でNUL終端。
targetWORD*in比較先のUTF-16文字列を指す。
targetLengthINTintargetの長さをUChar単位で指定する。-1でNUL終端。

戻り値の型: CHAR

各言語での呼び出し定義

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

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

ucol_greaterOrEqual = ctypes.cdll.icuin.ucol_greaterOrEqual
ucol_greaterOrEqual.restype = ctypes.c_byte
ucol_greaterOrEqual.argtypes = [
    ctypes.c_void_p,  # coll : UCollator*
    ctypes.POINTER(ctypes.c_ushort),  # source : WORD*
    ctypes.c_int,  # sourceLength : INT
    ctypes.POINTER(ctypes.c_ushort),  # target : WORD*
    ctypes.c_int,  # targetLength : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_greaterOrEqual = icuin.NewProc("ucol_greaterOrEqual")
)

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