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

ubidi_openSized

関数
事前にサイズを確保したUBiDiオブジェクトを生成する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

UBiDi* ubidi_openSized(
    INT maxLength,
    INT maxRunCount,
    UErrorCode* pErrorCode
);

パラメーター

名前方向
maxLengthINTin
maxRunCountINTin
pErrorCodeUErrorCode*inout

戻り値の型: UBiDi*

各言語での呼び出し定義

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

UBiDi* ubidi_openSized(
    INT maxLength,
    INT maxRunCount,
    UErrorCode* pErrorCode
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ubidi_openSized(
    int maxLength,   // INT
    int maxRunCount,   // INT
    ref int pErrorCode   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ubidi_openSized(
    maxLength As Integer,   ' INT
    maxRunCount As Integer,   ' INT
    ByRef pErrorCode As Integer   ' UErrorCode* in/out
) As IntPtr
End Function
' maxLength : INT
' maxRunCount : INT
' pErrorCode : UErrorCode* in/out
Declare PtrSafe Function ubidi_openSized Lib "icuuc" ( _
    ByVal maxLength As Long, _
    ByVal maxRunCount As Long, _
    ByRef pErrorCode As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ubidi_openSized = ctypes.cdll.icuuc.ubidi_openSized
ubidi_openSized.restype = ctypes.c_void_p
ubidi_openSized.argtypes = [
    ctypes.c_int,  # maxLength : INT
    ctypes.c_int,  # maxRunCount : INT
    ctypes.c_void_p,  # pErrorCode : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ubidi_openSized = Fiddle::Function.new(
  lib['ubidi_openSized'],
  [
    Fiddle::TYPE_INT,  # maxLength : INT
    Fiddle::TYPE_INT,  # maxRunCount : INT
    Fiddle::TYPE_VOIDP,  # pErrorCode : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ubidi_openSized(
        maxLength: i32,  // INT
        maxRunCount: i32,  // INT
        pErrorCode: *mut i32  // UErrorCode* in/out
    ) -> *mut isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ubidi_openSized(int maxLength, int maxRunCount, ref int pErrorCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubidi_openSized' -Namespace Win32 -PassThru
# $api::ubidi_openSized(maxLength, maxRunCount, pErrorCode)
#uselib "icuuc.dll"
#func global ubidi_openSized "ubidi_openSized" sptr, sptr, sptr
; ubidi_openSized maxLength, maxRunCount, pErrorCode   ; 戻り値は stat
; maxLength : INT -> "sptr"
; maxRunCount : INT -> "sptr"
; pErrorCode : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuuc.dll"
#cfunc global ubidi_openSized "ubidi_openSized" int, int, int
; res = ubidi_openSized(maxLength, maxRunCount, pErrorCode)
; maxLength : INT -> "int"
; maxRunCount : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
; UBiDi* ubidi_openSized(INT maxLength, INT maxRunCount, UErrorCode* pErrorCode)
#uselib "icuuc.dll"
#cfunc global ubidi_openSized "ubidi_openSized" int, int, int
; res = ubidi_openSized(maxLength, maxRunCount, pErrorCode)
; maxLength : INT -> "int"
; maxRunCount : INT -> "int"
; pErrorCode : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procubidi_openSized = icuuc.NewProc("ubidi_openSized")
)

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