ホーム › Globalization › ubidi_getParagraphByIndex
ubidi_getParagraphByIndex
関数段落インデックスから段落の範囲とレベルを取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
void ubidi_getParagraphByIndex(
const UBiDi* pBiDi,
INT paraIndex,
INT* pParaStart,
INT* pParaLimit,
BYTE* pParaLevel,
UErrorCode* pErrorCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pBiDi | UBiDi* | in |
| paraIndex | INT | in |
| pParaStart | INT* | inout |
| pParaLimit | INT* | inout |
| pParaLevel | BYTE* | inout |
| pErrorCode | UErrorCode* | inout |
戻り値の型: void
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
void ubidi_getParagraphByIndex(
const UBiDi* pBiDi,
INT paraIndex,
INT* pParaStart,
INT* pParaLimit,
BYTE* pParaLevel,
UErrorCode* pErrorCode
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ubidi_getParagraphByIndex(
ref IntPtr pBiDi, // UBiDi*
int paraIndex, // INT
ref int pParaStart, // INT* in/out
ref int pParaLimit, // INT* in/out
IntPtr pParaLevel, // BYTE* in/out
ref int pErrorCode // UErrorCode* in/out
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ubidi_getParagraphByIndex(
ByRef pBiDi As IntPtr, ' UBiDi*
paraIndex As Integer, ' INT
ByRef pParaStart As Integer, ' INT* in/out
ByRef pParaLimit As Integer, ' INT* in/out
pParaLevel As IntPtr, ' BYTE* in/out
ByRef pErrorCode As Integer ' UErrorCode* in/out
)
End Sub' pBiDi : UBiDi*
' paraIndex : INT
' pParaStart : INT* in/out
' pParaLimit : INT* in/out
' pParaLevel : BYTE* in/out
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Sub ubidi_getParagraphByIndex Lib "icuuc" ( _
ByRef pBiDi As LongPtr, _
ByVal paraIndex As Long, _
ByRef pParaStart As Long, _
ByRef pParaLimit As Long, _
ByVal pParaLevel As LongPtr, _
ByRef pErrorCode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ubidi_getParagraphByIndex = ctypes.cdll.icuuc.ubidi_getParagraphByIndex
ubidi_getParagraphByIndex.restype = None
ubidi_getParagraphByIndex.argtypes = [
ctypes.c_void_p, # pBiDi : UBiDi*
ctypes.c_int, # paraIndex : INT
ctypes.POINTER(ctypes.c_int), # pParaStart : INT* in/out
ctypes.POINTER(ctypes.c_int), # pParaLimit : INT* in/out
ctypes.POINTER(ctypes.c_ubyte), # pParaLevel : BYTE* in/out
ctypes.c_void_p, # pErrorCode : UErrorCode* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
ubidi_getParagraphByIndex = Fiddle::Function.new(
lib['ubidi_getParagraphByIndex'],
[
Fiddle::TYPE_VOIDP, # pBiDi : UBiDi*
Fiddle::TYPE_INT, # paraIndex : INT
Fiddle::TYPE_VOIDP, # pParaStart : INT* in/out
Fiddle::TYPE_VOIDP, # pParaLimit : INT* in/out
Fiddle::TYPE_VOIDP, # pParaLevel : BYTE* in/out
Fiddle::TYPE_VOIDP, # pErrorCode : UErrorCode* in/out
],
Fiddle::TYPE_VOID, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn ubidi_getParagraphByIndex(
pBiDi: *const isize, // UBiDi*
paraIndex: i32, // INT
pParaStart: *mut i32, // INT* in/out
pParaLimit: *mut i32, // INT* in/out
pParaLevel: *mut u8, // BYTE* in/out
pErrorCode: *mut i32 // UErrorCode* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ubidi_getParagraphByIndex(ref IntPtr pBiDi, int paraIndex, ref int pParaStart, ref int pParaLimit, IntPtr pParaLevel, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubidi_getParagraphByIndex' -Namespace Win32 -PassThru
# $api::ubidi_getParagraphByIndex(pBiDi, paraIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode)#uselib "icuuc.dll"
#func global ubidi_getParagraphByIndex "ubidi_getParagraphByIndex" sptr, sptr, sptr, sptr, sptr, sptr
; ubidi_getParagraphByIndex pBiDi, paraIndex, varptr(pParaStart), varptr(pParaLimit), varptr(pParaLevel), pErrorCode
; pBiDi : UBiDi* -> "sptr"
; paraIndex : INT -> "sptr"
; pParaStart : INT* in/out -> "sptr"
; pParaLimit : INT* in/out -> "sptr"
; pParaLevel : BYTE* in/out -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"出力引数:
#uselib "icuuc.dll" #func global ubidi_getParagraphByIndex "ubidi_getParagraphByIndex" int, int, var, var, var, int ; ubidi_getParagraphByIndex pBiDi, paraIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode ; pBiDi : UBiDi* -> "int" ; paraIndex : INT -> "int" ; pParaStart : INT* in/out -> "var" ; pParaLimit : INT* in/out -> "var" ; pParaLevel : BYTE* in/out -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #func global ubidi_getParagraphByIndex "ubidi_getParagraphByIndex" int, int, sptr, sptr, sptr, int ; ubidi_getParagraphByIndex pBiDi, paraIndex, varptr(pParaStart), varptr(pParaLimit), varptr(pParaLevel), pErrorCode ; pBiDi : UBiDi* -> "int" ; paraIndex : INT -> "int" ; pParaStart : INT* in/out -> "sptr" ; pParaLimit : INT* in/out -> "sptr" ; pParaLevel : BYTE* in/out -> "sptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void ubidi_getParagraphByIndex(UBiDi* pBiDi, INT paraIndex, INT* pParaStart, INT* pParaLimit, BYTE* pParaLevel, UErrorCode* pErrorCode) #uselib "icuuc.dll" #func global ubidi_getParagraphByIndex "ubidi_getParagraphByIndex" int, int, var, var, var, int ; ubidi_getParagraphByIndex pBiDi, paraIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode ; pBiDi : UBiDi* -> "int" ; paraIndex : INT -> "int" ; pParaStart : INT* in/out -> "var" ; pParaLimit : INT* in/out -> "var" ; pParaLevel : BYTE* in/out -> "var" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void ubidi_getParagraphByIndex(UBiDi* pBiDi, INT paraIndex, INT* pParaStart, INT* pParaLimit, BYTE* pParaLevel, UErrorCode* pErrorCode) #uselib "icuuc.dll" #func global ubidi_getParagraphByIndex "ubidi_getParagraphByIndex" int, int, intptr, intptr, intptr, int ; ubidi_getParagraphByIndex pBiDi, paraIndex, varptr(pParaStart), varptr(pParaLimit), varptr(pParaLevel), pErrorCode ; pBiDi : UBiDi* -> "int" ; paraIndex : INT -> "int" ; pParaStart : INT* in/out -> "intptr" ; pParaLimit : INT* in/out -> "intptr" ; pParaLevel : BYTE* in/out -> "intptr" ; pErrorCode : UErrorCode* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procubidi_getParagraphByIndex = icuuc.NewProc("ubidi_getParagraphByIndex")
)
// pBiDi (UBiDi*), paraIndex (INT), pParaStart (INT* in/out), pParaLimit (INT* in/out), pParaLevel (BYTE* in/out), pErrorCode (UErrorCode* in/out)
r1, _, err := procubidi_getParagraphByIndex.Call(
uintptr(pBiDi),
uintptr(paraIndex),
uintptr(pParaStart),
uintptr(pParaLimit),
uintptr(pParaLevel),
uintptr(pErrorCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure ubidi_getParagraphByIndex(
pBiDi: Pointer; // UBiDi*
paraIndex: Integer; // INT
pParaStart: Pointer; // INT* in/out
pParaLimit: Pointer; // INT* in/out
pParaLevel: Pointer; // BYTE* in/out
pErrorCode: Pointer // UErrorCode* in/out
); cdecl;
external 'icuuc.dll' name 'ubidi_getParagraphByIndex';result := DllCall("icuuc\ubidi_getParagraphByIndex"
, "Ptr", pBiDi ; UBiDi*
, "Int", paraIndex ; INT
, "Ptr", pParaStart ; INT* in/out
, "Ptr", pParaLimit ; INT* in/out
, "Ptr", pParaLevel ; BYTE* in/out
, "Ptr", pErrorCode ; UErrorCode* in/out
, "Cdecl Int") ; return: void●ubidi_getParagraphByIndex(pBiDi, paraIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode) = DLL("icuuc.dll", "int ubidi_getParagraphByIndex(void*, int, void*, void*, void*, void*)")
# 呼び出し: ubidi_getParagraphByIndex(pBiDi, paraIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode)
# pBiDi : UBiDi* -> "void*"
# paraIndex : INT -> "int"
# pParaStart : INT* in/out -> "void*"
# pParaLimit : INT* in/out -> "void*"
# pParaLevel : BYTE* in/out -> "void*"
# pErrorCode : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。