ホーム › Globalization › ucol_greater
ucol_greater
関数照合順で前者が後者より大きいか判定する。
シグネチャ
// icuin.dll
#include <windows.h>
CHAR ucol_greater(
const UCollator* coll,
const WORD* source,
INT sourceLength,
const WORD* target,
INT targetLength
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| coll | UCollator* | in |
| source | WORD* | in |
| sourceLength | INT | in |
| target | WORD* | in |
| targetLength | INT | in |
戻り値の型: CHAR
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
CHAR ucol_greater(
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_greater(
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_greater(
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_greater 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_greater = ctypes.cdll.icuin.ucol_greater
ucol_greater.restype = ctypes.c_byte
ucol_greater.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_greater = Fiddle::Function.new(
lib['ucol_greater'],
[
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_greater(
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_greater(ref IntPtr coll, ref ushort source, int sourceLength, ref ushort target, int targetLength);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucol_greater' -Namespace Win32 -PassThru
# $api::ucol_greater(coll, source, sourceLength, target, targetLength)#uselib "icuin.dll"
#func global ucol_greater "ucol_greater" sptr, sptr, sptr, sptr, sptr
; ucol_greater 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_greater "ucol_greater" int, var, int, var, int ; res = ucol_greater(coll, source, sourceLength, target, targetLength) ; coll : UCollator* -> "int" ; source : WORD* -> "var" ; sourceLength : INT -> "int" ; target : WORD* -> "var" ; targetLength : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global ucol_greater "ucol_greater" int, sptr, int, sptr, int ; res = ucol_greater(coll, varptr(source), sourceLength, varptr(target), targetLength) ; coll : UCollator* -> "int" ; source : WORD* -> "sptr" ; sourceLength : INT -> "int" ; target : WORD* -> "sptr" ; targetLength : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; CHAR ucol_greater(UCollator* coll, WORD* source, INT sourceLength, WORD* target, INT targetLength) #uselib "icuin.dll" #cfunc global ucol_greater "ucol_greater" int, var, int, var, int ; res = ucol_greater(coll, source, sourceLength, target, targetLength) ; coll : UCollator* -> "int" ; source : WORD* -> "var" ; sourceLength : INT -> "int" ; target : WORD* -> "var" ; targetLength : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; CHAR ucol_greater(UCollator* coll, WORD* source, INT sourceLength, WORD* target, INT targetLength) #uselib "icuin.dll" #cfunc global ucol_greater "ucol_greater" int, intptr, int, intptr, int ; res = ucol_greater(coll, varptr(source), sourceLength, varptr(target), targetLength) ; coll : UCollator* -> "int" ; source : WORD* -> "intptr" ; sourceLength : INT -> "int" ; target : WORD* -> "intptr" ; targetLength : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procucol_greater = icuin.NewProc("ucol_greater")
)
// coll (UCollator*), source (WORD*), sourceLength (INT), target (WORD*), targetLength (INT)
r1, _, err := procucol_greater.Call(
uintptr(coll),
uintptr(source),
uintptr(sourceLength),
uintptr(target),
uintptr(targetLength),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CHARfunction ucol_greater(
coll: Pointer; // UCollator*
source: Pointer; // WORD*
sourceLength: Integer; // INT
target: Pointer; // WORD*
targetLength: Integer // INT
): Shortint; cdecl;
external 'icuin.dll' name 'ucol_greater';result := DllCall("icuin\ucol_greater"
, "Ptr", coll ; UCollator*
, "Ptr", source ; WORD*
, "Int", sourceLength ; INT
, "Ptr", target ; WORD*
, "Int", targetLength ; INT
, "Cdecl Char") ; return: CHAR●ucol_greater(coll, source, sourceLength, target, targetLength) = DLL("icuin.dll", "char ucol_greater(void*, void*, int, void*, int)")
# 呼び出し: ucol_greater(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`,…) を使用。