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

ucptrie_internalSmallU8Index

関数
小型トライのUTF-8用内部インデックスを取得する内部関数。
DLLicu.dll呼出規約cdecl

シグネチャ

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

INT ucptrie_internalSmallU8Index(
    const UCPTrie* trie,
    INT lt1,
    BYTE t2,
    BYTE t3
);

パラメーター

名前方向
trieUCPTrie*in
lt1INTin
t2BYTEin
t3BYTEin

戻り値の型: INT

各言語での呼び出し定義

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

INT ucptrie_internalSmallU8Index(
    const UCPTrie* trie,
    INT lt1,
    BYTE t2,
    BYTE t3
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ucptrie_internalSmallU8Index(
    IntPtr trie,   // UCPTrie*
    int lt1,   // INT
    byte t2,   // BYTE
    byte t3   // BYTE
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucptrie_internalSmallU8Index(
    trie As IntPtr,   ' UCPTrie*
    lt1 As Integer,   ' INT
    t2 As Byte,   ' BYTE
    t3 As Byte   ' BYTE
) As Integer
End Function
' trie : UCPTrie*
' lt1 : INT
' t2 : BYTE
' t3 : BYTE
Declare PtrSafe Function ucptrie_internalSmallU8Index Lib "icu" ( _
    ByVal trie As LongPtr, _
    ByVal lt1 As Long, _
    ByVal t2 As Byte, _
    ByVal t3 As Byte) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucptrie_internalSmallU8Index = ctypes.cdll.icu.ucptrie_internalSmallU8Index
ucptrie_internalSmallU8Index.restype = ctypes.c_int
ucptrie_internalSmallU8Index.argtypes = [
    ctypes.c_void_p,  # trie : UCPTrie*
    ctypes.c_int,  # lt1 : INT
    ctypes.c_ubyte,  # t2 : BYTE
    ctypes.c_ubyte,  # t3 : BYTE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procucptrie_internalSmallU8Index = icu.NewProc("ucptrie_internalSmallU8Index")
)

// trie (UCPTrie*), lt1 (INT), t2 (BYTE), t3 (BYTE)
r1, _, err := procucptrie_internalSmallU8Index.Call(
	uintptr(trie),
	uintptr(lt1),
	uintptr(t2),
	uintptr(t3),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ucptrie_internalSmallU8Index(
  trie: Pointer;   // UCPTrie*
  lt1: Integer;   // INT
  t2: Byte;   // BYTE
  t3: Byte   // BYTE
): Integer; cdecl;
  external 'icu.dll' name 'ucptrie_internalSmallU8Index';
result := DllCall("icu\ucptrie_internalSmallU8Index"
    , "Ptr", trie   ; UCPTrie*
    , "Int", lt1   ; INT
    , "UChar", t2   ; BYTE
    , "UChar", t3   ; BYTE
    , "Cdecl Int")   ; return: INT
●ucptrie_internalSmallU8Index(trie, lt1, t2, t3) = DLL("icu.dll", "int ucptrie_internalSmallU8Index(void*, int, byte, byte)")
# 呼び出し: ucptrie_internalSmallU8Index(trie, lt1, t2, t3)
# trie : UCPTrie* -> "void*"
# lt1 : INT -> "int"
# t2 : BYTE -> "byte"
# t3 : BYTE -> "byte"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。