ホーム › Globalization › ubidi_getBaseDirection
ubidi_getBaseDirection
関数テキストの基底方向を判定して取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
UBiDiDirection ubidi_getBaseDirection(
const WORD* text,
INT length
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| text | WORD* | in |
| length | INT | in |
戻り値の型: UBiDiDirection
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
UBiDiDirection ubidi_getBaseDirection(
const WORD* text,
INT length
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int ubidi_getBaseDirection(
ref ushort text, // WORD*
int length // INT
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ubidi_getBaseDirection(
ByRef text As UShort, ' WORD*
length As Integer ' INT
) As Integer
End Function' text : WORD*
' length : INT
Declare PtrSafe Function ubidi_getBaseDirection Lib "icuuc" ( _
ByRef text As Integer, _
ByVal length As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ubidi_getBaseDirection = ctypes.cdll.icuuc.ubidi_getBaseDirection
ubidi_getBaseDirection.restype = ctypes.c_int
ubidi_getBaseDirection.argtypes = [
ctypes.POINTER(ctypes.c_ushort), # text : WORD*
ctypes.c_int, # length : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
ubidi_getBaseDirection = Fiddle::Function.new(
lib['ubidi_getBaseDirection'],
[
Fiddle::TYPE_VOIDP, # text : WORD*
Fiddle::TYPE_INT, # length : INT
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn ubidi_getBaseDirection(
text: *const u16, // WORD*
length: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ubidi_getBaseDirection(ref ushort text, int length);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ubidi_getBaseDirection' -Namespace Win32 -PassThru
# $api::ubidi_getBaseDirection(text, length)#uselib "icuuc.dll"
#func global ubidi_getBaseDirection "ubidi_getBaseDirection" sptr, sptr
; ubidi_getBaseDirection varptr(text), length ; 戻り値は stat
; text : WORD* -> "sptr"
; length : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuuc.dll" #cfunc global ubidi_getBaseDirection "ubidi_getBaseDirection" var, int ; res = ubidi_getBaseDirection(text, length) ; text : WORD* -> "var" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icuuc.dll" #cfunc global ubidi_getBaseDirection "ubidi_getBaseDirection" sptr, int ; res = ubidi_getBaseDirection(varptr(text), length) ; text : WORD* -> "sptr" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; UBiDiDirection ubidi_getBaseDirection(WORD* text, INT length) #uselib "icuuc.dll" #cfunc global ubidi_getBaseDirection "ubidi_getBaseDirection" var, int ; res = ubidi_getBaseDirection(text, length) ; text : WORD* -> "var" ; length : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; UBiDiDirection ubidi_getBaseDirection(WORD* text, INT length) #uselib "icuuc.dll" #cfunc global ubidi_getBaseDirection "ubidi_getBaseDirection" intptr, int ; res = ubidi_getBaseDirection(varptr(text), length) ; text : WORD* -> "intptr" ; length : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procubidi_getBaseDirection = icuuc.NewProc("ubidi_getBaseDirection")
)
// text (WORD*), length (INT)
r1, _, err := procubidi_getBaseDirection.Call(
uintptr(text),
uintptr(length),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UBiDiDirectionfunction ubidi_getBaseDirection(
text: Pointer; // WORD*
length: Integer // INT
): Integer; cdecl;
external 'icuuc.dll' name 'ubidi_getBaseDirection';result := DllCall("icuuc\ubidi_getBaseDirection"
, "Ptr", text ; WORD*
, "Int", length ; INT
, "Cdecl Int") ; return: UBiDiDirection●ubidi_getBaseDirection(text, length) = DLL("icuuc.dll", "int ubidi_getBaseDirection(void*, int)")
# 呼び出し: ubidi_getBaseDirection(text, length)
# text : WORD* -> "void*"
# length : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。