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