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