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

uset_spanBack

関数
文字列末尾からUSet条件に合う範囲長を返す。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

INT uset_spanBack(
    const USet* set,
    const WORD* s,
    INT length,
    USetSpanCondition spanCondition
);

パラメーター

名前方向
setUSet*in
sWORD*in
lengthINTin
spanConditionUSetSpanConditionin

戻り値の型: INT

各言語での呼び出し定義

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

INT uset_spanBack(
    const USet* set,
    const WORD* s,
    INT length,
    USetSpanCondition spanCondition
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int uset_spanBack(
    ref IntPtr set,   // USet*
    ref ushort s,   // WORD*
    int length,   // INT
    int spanCondition   // USetSpanCondition
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function uset_spanBack(
    ByRef [set] As IntPtr,   ' USet*
    ByRef s As UShort,   ' WORD*
    length As Integer,   ' INT
    spanCondition As Integer   ' USetSpanCondition
) As Integer
End Function
' set : USet*
' s : WORD*
' length : INT
' spanCondition : USetSpanCondition
Declare PtrSafe Function uset_spanBack Lib "icuuc" ( _
    ByRef set As LongPtr, _
    ByRef s As Integer, _
    ByVal length As Long, _
    ByVal spanCondition As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

uset_spanBack = ctypes.cdll.icuuc.uset_spanBack
uset_spanBack.restype = ctypes.c_int
uset_spanBack.argtypes = [
    ctypes.c_void_p,  # set : USet*
    ctypes.POINTER(ctypes.c_ushort),  # s : WORD*
    ctypes.c_int,  # length : INT
    ctypes.c_int,  # spanCondition : USetSpanCondition
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
uset_spanBack = Fiddle::Function.new(
  lib['uset_spanBack'],
  [
    Fiddle::TYPE_VOIDP,  # set : USet*
    Fiddle::TYPE_VOIDP,  # s : WORD*
    Fiddle::TYPE_INT,  # length : INT
    Fiddle::TYPE_INT,  # spanCondition : USetSpanCondition
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn uset_spanBack(
        set: *const isize,  // USet*
        s: *const u16,  // WORD*
        length: i32,  // INT
        spanCondition: i32  // USetSpanCondition
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int uset_spanBack(ref IntPtr set, ref ushort s, int length, int spanCondition);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_uset_spanBack' -Namespace Win32 -PassThru
# $api::uset_spanBack(set, s, length, spanCondition)
#uselib "icuuc.dll"
#func global uset_spanBack "uset_spanBack" sptr, sptr, sptr, sptr
; uset_spanBack set, varptr(s), length, spanCondition   ; 戻り値は stat
; set : USet* -> "sptr"
; s : WORD* -> "sptr"
; length : INT -> "sptr"
; spanCondition : USetSpanCondition -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuuc.dll"
#cfunc global uset_spanBack "uset_spanBack" int, var, int, int
; res = uset_spanBack(set, s, length, spanCondition)
; set : USet* -> "int"
; s : WORD* -> "var"
; length : INT -> "int"
; spanCondition : USetSpanCondition -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT uset_spanBack(USet* set, WORD* s, INT length, USetSpanCondition spanCondition)
#uselib "icuuc.dll"
#cfunc global uset_spanBack "uset_spanBack" int, var, int, int
; res = uset_spanBack(set, s, length, spanCondition)
; set : USet* -> "int"
; s : WORD* -> "var"
; length : INT -> "int"
; spanCondition : USetSpanCondition -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_spanBack = icuuc.NewProc("uset_spanBack")
)

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