ホーム › Globalization › ubidi_getLogicalIndex
ubidi_getLogicalIndex
関数視覚インデックスから論理インデックスを取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
INT ubidi_getLogicalIndex(
UBiDi* pBiDi,
INT visualIndex,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pBiDi | UBiDi* | inout |
| visualIndex | INT | in |
| pErrorCode | UErrorCode* | inout |
戻り値の型: INT
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
INT ubidi_getLogicalIndex(
UBiDi* pBiDi,
INT visualIndex,
UErrorCode* pErrorCode
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ubidi_getLogicalIndex(
ref IntPtr pBiDi, // UBiDi* in/out
int visualIndex, // INT
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ubidi_getLogicalIndex(
ByRef pBiDi As IntPtr, ' UBiDi* in/out
visualIndex As Integer, ' INT
ByRef pErrorCode As Integer ' UErrorCode* in/out
) As Integer
End Function' pBiDi : UBiDi* in/out
' visualIndex : INT
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function ubidi_getLogicalIndex Lib "icuuc" ( _
ByRef pBiDi As LongPtr, _
ByVal visualIndex As Long, _
ByRef pErrorCode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ubidi_getLogicalIndex = ctypes.cdll.icuuc.ubidi_getLogicalIndex
ubidi_getLogicalIndex.restype = ctypes.c_int
ubidi_getLogicalIndex.argtypes = [
ctypes.c_void_p, # pBiDi : UBiDi* in/out
ctypes.c_int, # visualIndex : INT
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
ubidi_getLogicalIndex = Fiddle::Function.new(
lib['ubidi_getLogicalIndex'],
[
Fiddle::TYPE_VOIDP, # pBiDi : UBiDi* in/out
Fiddle::TYPE_INT, # visualIndex : INT
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn ubidi_getLogicalIndex(
pBiDi: *mut isize, // UBiDi* in/out
visualIndex: i32, // INT
pErrorCode: *mut i32 // UErrorCode* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ubidi_getLogicalIndex(ref IntPtr pBiDi, int visualIndex, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubidi_getLogicalIndex' -Namespace Win32 -PassThru
# $api::ubidi_getLogicalIndex(pBiDi, visualIndex, pErrorCode)#uselib "icuuc.dll"
#func global ubidi_getLogicalIndex "ubidi_getLogicalIndex" sptr, sptr, sptr
; ubidi_getLogicalIndex pBiDi, visualIndex, pErrorCode ; 戻り値は stat
; pBiDi : UBiDi* in/out -> "sptr"
; visualIndex : INT -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "icuuc.dll"
#cfunc global ubidi_getLogicalIndex "ubidi_getLogicalIndex" int, int, int
; res = ubidi_getLogicalIndex(pBiDi, visualIndex, pErrorCode)
; pBiDi : UBiDi* in/out -> "int"
; visualIndex : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"; INT ubidi_getLogicalIndex(UBiDi* pBiDi, INT visualIndex, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#cfunc global ubidi_getLogicalIndex "ubidi_getLogicalIndex" int, int, int
; res = ubidi_getLogicalIndex(pBiDi, visualIndex, pErrorCode)
; pBiDi : UBiDi* in/out -> "int"
; visualIndex : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procubidi_getLogicalIndex = icuuc.NewProc("ubidi_getLogicalIndex")
)
// pBiDi (UBiDi* in/out), visualIndex (INT), pErrorCode (UErrorCode* in/out)
r1, _, err := procubidi_getLogicalIndex.Call(
uintptr(pBiDi),
uintptr(visualIndex),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ubidi_getLogicalIndex(
pBiDi: Pointer; // UBiDi* in/out
visualIndex: Integer; // INT
pErrorCode: Pointer // UErrorCode* in/out
): Integer; cdecl;
external 'icuuc.dll' name 'ubidi_getLogicalIndex';result := DllCall("icuuc\ubidi_getLogicalIndex"
, "Ptr", pBiDi ; UBiDi* in/out
, "Int", visualIndex ; INT
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Int") ; return: INT●ubidi_getLogicalIndex(pBiDi, visualIndex, pErrorCode) = DLL("icuuc.dll", "int ubidi_getLogicalIndex(void*, int, void*)")
# 呼び出し: ubidi_getLogicalIndex(pBiDi, visualIndex, pErrorCode)
# pBiDi : UBiDi* in/out -> "void*"
# visualIndex : INT -> "int"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。