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