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

ubidi_getVisualIndex

関数
論理インデックスから視覚インデックスを取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

INT ubidi_getVisualIndex(
    UBiDi* pBiDi,
    INT logicalIndex,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
pBiDiUBiDi*inout
logicalIndexINTin
pErrorCodeUErrorCode*inout

戻り値の型: INT

各言語での呼び出し定義

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

INT ubidi_getVisualIndex(
    UBiDi* pBiDi,
    INT logicalIndex,
    UErrorCode* pErrorCode
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ubidi_getVisualIndex(
    ref IntPtr pBiDi,   // UBiDi* in/out
    int logicalIndex,   // INT
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ubidi_getVisualIndex(
    ByRef pBiDi As IntPtr,   ' UBiDi* in/out
    logicalIndex As Integer,   ' INT
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
) As Integer
End Function
' pBiDi : UBiDi* in/out
' logicalIndex : INT
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function ubidi_getVisualIndex Lib "icuuc" ( _
    ByRef pBiDi As LongPtr, _
    ByVal logicalIndex 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_getVisualIndex = ctypes.cdll.icuuc.ubidi_getVisualIndex
ubidi_getVisualIndex.restype = ctypes.c_int
ubidi_getVisualIndex.argtypes = [
    ctypes.c_void_p,  # pBiDi : UBiDi* in/out
    ctypes.c_int,  # logicalIndex : INT
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ubidi_getVisualIndex = Fiddle::Function.new(
  lib['ubidi_getVisualIndex'],
  [
    Fiddle::TYPE_VOIDP,  # pBiDi : UBiDi* in/out
    Fiddle::TYPE_INT,  # logicalIndex : INT
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ubidi_getVisualIndex(
        pBiDi: *mut isize,  // UBiDi* in/out
        logicalIndex: 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_getVisualIndex(ref IntPtr pBiDi, int logicalIndex, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubidi_getVisualIndex' -Namespace Win32 -PassThru
# $api::ubidi_getVisualIndex(pBiDi, logicalIndex, pErrorCode)
#uselib "icuuc.dll"
#func global ubidi_getVisualIndex "ubidi_getVisualIndex" sptr, sptr, sptr
; ubidi_getVisualIndex pBiDi, logicalIndex, pErrorCode   ; 戻り値は stat
; pBiDi : UBiDi* in/out -> "sptr"
; logicalIndex : INT -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global ubidi_getVisualIndex "ubidi_getVisualIndex" int, int, int
; res = ubidi_getVisualIndex(pBiDi, logicalIndex, pErrorCode)
; pBiDi : UBiDi* in/out -> "int"
; logicalIndex : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; INT ubidi_getVisualIndex(UBiDi* pBiDi, INT logicalIndex, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#cfunc global ubidi_getVisualIndex "ubidi_getVisualIndex" int, int, int
; res = ubidi_getVisualIndex(pBiDi, logicalIndex, pErrorCode)
; pBiDi : UBiDi* in/out -> "int"
; logicalIndex : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procubidi_getVisualIndex = icuuc.NewProc("ubidi_getVisualIndex")
)

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