ホーム › Globalization › ucol_getMaxExpansion
ucol_getMaxExpansion
関数指定照合要素の最大展開数を取得する。
シグネチャ
// icuin.dll
#include <windows.h>
INT ucol_getMaxExpansion(
const UCollationElements* elems,
INT order
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| elems | UCollationElements* | in | 展開数を問い合わせる照合要素イテレータのハンドル。 |
| order | INT | in | 対象とする照合順序(照合要素の値)。 |
戻り値の型: INT
各言語での呼び出し定義
// icuin.dll
#include <windows.h>
INT ucol_getMaxExpansion(
const UCollationElements* elems,
INT order
);[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ucol_getMaxExpansion(
ref IntPtr elems, // UCollationElements*
int order // INT
);<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucol_getMaxExpansion(
ByRef elems As IntPtr, ' UCollationElements*
order As Integer ' INT
) As Integer
End Function' elems : UCollationElements*
' order : INT
Declare PtrSafe Function ucol_getMaxExpansion Lib "icuin" ( _
ByRef elems As LongPtr, _
ByVal order As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ucol_getMaxExpansion = ctypes.cdll.icuin.ucol_getMaxExpansion
ucol_getMaxExpansion.restype = ctypes.c_int
ucol_getMaxExpansion.argtypes = [
ctypes.c_void_p, # elems : UCollationElements*
ctypes.c_int, # order : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuin.dll')
ucol_getMaxExpansion = Fiddle::Function.new(
lib['ucol_getMaxExpansion'],
[
Fiddle::TYPE_VOIDP, # elems : UCollationElements*
Fiddle::TYPE_INT, # order : INT
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuin")]
extern "C" {
fn ucol_getMaxExpansion(
elems: *const isize, // UCollationElements*
order: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ucol_getMaxExpansion(ref IntPtr elems, int order);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucol_getMaxExpansion' -Namespace Win32 -PassThru
# $api::ucol_getMaxExpansion(elems, order)#uselib "icuin.dll"
#func global ucol_getMaxExpansion "ucol_getMaxExpansion" sptr, sptr
; ucol_getMaxExpansion varptr(elems), order ; 戻り値は stat
; elems : UCollationElements* -> "sptr"
; order : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuin.dll" #cfunc global ucol_getMaxExpansion "ucol_getMaxExpansion" var, int ; res = ucol_getMaxExpansion(elems, order) ; elems : UCollationElements* -> "var" ; order : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuin.dll" #cfunc global ucol_getMaxExpansion "ucol_getMaxExpansion" sptr, int ; res = ucol_getMaxExpansion(varptr(elems), order) ; elems : UCollationElements* -> "sptr" ; order : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT ucol_getMaxExpansion(UCollationElements* elems, INT order) #uselib "icuin.dll" #cfunc global ucol_getMaxExpansion "ucol_getMaxExpansion" var, int ; res = ucol_getMaxExpansion(elems, order) ; elems : UCollationElements* -> "var" ; order : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT ucol_getMaxExpansion(UCollationElements* elems, INT order) #uselib "icuin.dll" #cfunc global ucol_getMaxExpansion "ucol_getMaxExpansion" intptr, int ; res = ucol_getMaxExpansion(varptr(elems), order) ; elems : UCollationElements* -> "intptr" ; order : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuin = windows.NewLazySystemDLL("icuin.dll")
procucol_getMaxExpansion = icuin.NewProc("ucol_getMaxExpansion")
)
// elems (UCollationElements*), order (INT)
r1, _, err := procucol_getMaxExpansion.Call(
uintptr(elems),
uintptr(order),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ucol_getMaxExpansion(
elems: Pointer; // UCollationElements*
order: Integer // INT
): Integer; cdecl;
external 'icuin.dll' name 'ucol_getMaxExpansion';result := DllCall("icuin\ucol_getMaxExpansion"
, "Ptr", elems ; UCollationElements*
, "Int", order ; INT
, "Cdecl Int") ; return: INT●ucol_getMaxExpansion(elems, order) = DLL("icuin.dll", "int ucol_getMaxExpansion(void*, int)")
# 呼び出し: ucol_getMaxExpansion(elems, order)
# elems : UCollationElements* -> "void*"
# order : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuin" fn ucol_getMaxExpansion(
elems: [*c]isize, // UCollationElements*
order: i32 // INT
) callconv(.c) i32;proc ucol_getMaxExpansion(
elems: ptr int, # UCollationElements*
order: int32 # INT
): int32 {.importc: "ucol_getMaxExpansion", cdecl, dynlib: "icuin.dll".}pragma(lib, "icuin");
extern(C)
int ucol_getMaxExpansion(
ptrdiff_t* elems, // UCollationElements*
int order // INT
);ccall((:ucol_getMaxExpansion, "icuin.dll"), Int32,
(Ptr{Int}, Int32),
elems, order)
# elems : UCollationElements* -> Ptr{Int}
# order : INT -> Int32local ffi = require("ffi")
ffi.cdef[[
int32_t ucol_getMaxExpansion(
intptr_t* elems,
int32_t order);
]]
local icuin = ffi.load("icuin")
-- icuin.ucol_getMaxExpansion(elems, order)
-- elems : UCollationElements*
-- order : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuin.dll');
const ucol_getMaxExpansion = lib.func('__cdecl', 'ucol_getMaxExpansion', 'int32_t', ['intptr_t *', 'int32_t']);
// ucol_getMaxExpansion(elems, order)
// elems : UCollationElements* -> 'intptr_t *'
// order : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuin.dll", {
ucol_getMaxExpansion: { parameters: ["pointer", "i32"], result: "i32" },
});
// lib.symbols.ucol_getMaxExpansion(elems, order)
// elems : UCollationElements* -> "pointer"
// order : INT -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t ucol_getMaxExpansion(
intptr_t* elems,
int32_t order);
C, "icuin.dll");
// $ffi->ucol_getMaxExpansion(elems, order);
// elems : UCollationElements*
// order : INT
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Icuin extends Library {
Icuin INSTANCE = Native.load("icuin", Icuin.class);
int ucol_getMaxExpansion(
LongByReference elems, // UCollationElements*
int order // INT
);
}@[Link("icuin")]
lib Libicuin
fun ucol_getMaxExpansion = ucol_getMaxExpansion(
elems : LibC::SSizeT*, # UCollationElements*
order : Int32 # INT
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ucol_getMaxExpansionNative = Int32 Function(Pointer<IntPtr>, Int32);
typedef ucol_getMaxExpansionDart = int Function(Pointer<IntPtr>, int);
final ucol_getMaxExpansion = DynamicLibrary.open('icuin.dll')
.lookupFunction<ucol_getMaxExpansionNative, ucol_getMaxExpansionDart>('ucol_getMaxExpansion');
// elems : UCollationElements* -> Pointer<IntPtr>
// order : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ucol_getMaxExpansion(
elems: Pointer; // UCollationElements*
order: Integer // INT
): Integer; cdecl;
external 'icuin.dll' name 'ucol_getMaxExpansion';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "ucol_getMaxExpansion"
c_ucol_getMaxExpansion :: Ptr CIntPtr -> Int32 -> IO Int32
-- elems : UCollationElements* -> Ptr CIntPtr
-- order : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ucol_getmaxexpansion =
foreign "ucol_getMaxExpansion"
((ptr intptr_t) @-> int32_t @-> returning int32_t)
(* elems : UCollationElements* -> (ptr intptr_t) *)
(* order : INT -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuin (t "icuin.dll"))
(cffi:use-foreign-library icuin)
(cffi:defcfun ("ucol_getMaxExpansion" ucol-get-max-expansion :convention :cdecl) :int32
(elems :pointer) ; UCollationElements*
(order :int32)) ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ucol_getMaxExpansion = Win32::API::More->new('icuin',
'int ucol_getMaxExpansion(LPVOID elems, int order)');
# my $ret = $ucol_getMaxExpansion->Call($elems, $order);
# elems : UCollationElements* -> LPVOID
# order : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。