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

ubidi_getParagraph

関数
指定文字位置が属する段落の範囲とレベルを取得する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

INT ubidi_getParagraph(
    const UBiDi* pBiDi,
    INT charIndex,
    INT* pParaStart,
    INT* pParaLimit,
    BYTE* pParaLevel,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
pBiDiUBiDi*in
charIndexINTin
pParaStartINT*inout
pParaLimitINT*inout
pParaLevelBYTE*inout
pErrorCodeUErrorCode*inout

戻り値の型: INT

各言語での呼び出し定義

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

INT ubidi_getParagraph(
    const UBiDi* pBiDi,
    INT charIndex,
    INT* pParaStart,
    INT* pParaLimit,
    BYTE* pParaLevel,
    UErrorCode* pErrorCode
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ubidi_getParagraph(
    ref IntPtr pBiDi,   // UBiDi*
    int charIndex,   // 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 Function ubidi_getParagraph(
    ByRef pBiDi As IntPtr,   ' UBiDi*
    charIndex 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
) As Integer
End Function
' pBiDi : UBiDi*
' charIndex : INT
' pParaStart : INT* in/out
' pParaLimit : INT* in/out
' pParaLevel : BYTE* in/out
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function ubidi_getParagraph Lib "icuuc" ( _
    ByRef pBiDi As LongPtr, _
    ByVal charIndex As Long, _
    ByRef pParaStart As Long, _
    ByRef pParaLimit As Long, _
    ByVal pParaLevel As LongPtr, _
    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_getParagraph = ctypes.cdll.icuuc.ubidi_getParagraph
ubidi_getParagraph.restype = ctypes.c_int
ubidi_getParagraph.argtypes = [
    ctypes.c_void_p,  # pBiDi : UBiDi*
    ctypes.c_int,  # charIndex : 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_getParagraph = Fiddle::Function.new(
  lib['ubidi_getParagraph'],
  [
    Fiddle::TYPE_VOIDP,  # pBiDi : UBiDi*
    Fiddle::TYPE_INT,  # charIndex : 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_INT, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ubidi_getParagraph(
        pBiDi: *const isize,  // UBiDi*
        charIndex: 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
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ubidi_getParagraph(ref IntPtr pBiDi, int charIndex, ref int pParaStart, ref int pParaLimit, IntPtr pParaLevel, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubidi_getParagraph' -Namespace Win32 -PassThru
# $api::ubidi_getParagraph(pBiDi, charIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode)
#uselib "icuuc.dll"
#func global ubidi_getParagraph "ubidi_getParagraph" sptr, sptr, sptr, sptr, sptr, sptr
; ubidi_getParagraph pBiDi, charIndex, varptr(pParaStart), varptr(pParaLimit), varptr(pParaLevel), pErrorCode   ; 戻り値は stat
; pBiDi : UBiDi* -> "sptr"
; charIndex : INT -> "sptr"
; pParaStart : INT* in/out -> "sptr"
; pParaLimit : INT* in/out -> "sptr"
; pParaLevel : BYTE* in/out -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuuc.dll"
#cfunc global ubidi_getParagraph "ubidi_getParagraph" int, int, var, var, var, int
; res = ubidi_getParagraph(pBiDi, charIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode)
; pBiDi : UBiDi* -> "int"
; charIndex : INT -> "int"
; pParaStart : INT* in/out -> "var"
; pParaLimit : INT* in/out -> "var"
; pParaLevel : BYTE* in/out -> "var"
; pErrorCode : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT ubidi_getParagraph(UBiDi* pBiDi, INT charIndex, INT* pParaStart, INT* pParaLimit, BYTE* pParaLevel, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#cfunc global ubidi_getParagraph "ubidi_getParagraph" int, int, var, var, var, int
; res = ubidi_getParagraph(pBiDi, charIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode)
; pBiDi : UBiDi* -> "int"
; charIndex : INT -> "int"
; pParaStart : INT* in/out -> "var"
; pParaLimit : INT* in/out -> "var"
; pParaLevel : BYTE* in/out -> "var"
; pErrorCode : UErrorCode* in/out -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procubidi_getParagraph = icuuc.NewProc("ubidi_getParagraph")
)

// pBiDi (UBiDi*), charIndex (INT), pParaStart (INT* in/out), pParaLimit (INT* in/out), pParaLevel (BYTE* in/out), pErrorCode (UErrorCode* in/out)
r1, _, err := procubidi_getParagraph.Call(
	uintptr(pBiDi),
	uintptr(charIndex),
	uintptr(pParaStart),
	uintptr(pParaLimit),
	uintptr(pParaLevel),
	uintptr(pErrorCode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ubidi_getParagraph(
  pBiDi: Pointer;   // UBiDi*
  charIndex: Integer;   // INT
  pParaStart: Pointer;   // INT* in/out
  pParaLimit: Pointer;   // INT* in/out
  pParaLevel: Pointer;   // BYTE* in/out
  pErrorCode: Pointer   // UErrorCode* in/out
): Integer; cdecl;
  external 'icuuc.dll' name 'ubidi_getParagraph';
result := DllCall("icuuc\ubidi_getParagraph"
    , "Ptr", pBiDi   ; UBiDi*
    , "Int", charIndex   ; INT
    , "Ptr", pParaStart   ; INT* in/out
    , "Ptr", pParaLimit   ; INT* in/out
    , "Ptr", pParaLevel   ; BYTE* in/out
    , "Ptr", pErrorCode   ; UErrorCode* in/out
    , "Cdecl Int")   ; return: INT
●ubidi_getParagraph(pBiDi, charIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode) = DLL("icuuc.dll", "int ubidi_getParagraph(void*, int, void*, void*, void*, void*)")
# 呼び出し: ubidi_getParagraph(pBiDi, charIndex, pParaStart, pParaLimit, pParaLevel, pErrorCode)
# pBiDi : UBiDi* -> "void*"
# charIndex : 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`,…) を使用。