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