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

ucptrie_getType

関数
コードポイントトライの構造種別を取得する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

UCPTrieType ucptrie_getType(
    const UCPTrie* trie
);

パラメーター

名前方向
trieUCPTrie*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 方式にも切替可。
出力引数:
; UCPTrieType ucptrie_getType(UCPTrie* trie)
#uselib "icu.dll"
#cfunc global ucptrie_getType "ucptrie_getType" var
; res = ucptrie_getType(trie)
; trie : UCPTrie* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。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   // UCPTrieType
function 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`,…) を使用。