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

ucol_previous

関数
照合要素イテレータの前の照合要素を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

INT ucol_previous(
    UCollationElements* elems,
    UErrorCode* status
);

パラメーター

名前方向
elemsUCollationElements*inout
statusUErrorCode*inout

戻り値の型: INT

各言語での呼び出し定義

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

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

ucol_previous = ctypes.cdll.icuin.ucol_previous
ucol_previous.restype = ctypes.c_int
ucol_previous.argtypes = [
    ctypes.c_void_p,  # elems : UCollationElements* in/out
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ucol_previous = Fiddle::Function.new(
  lib['ucol_previous'],
  [
    Fiddle::TYPE_VOIDP,  # elems : UCollationElements* in/out
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucol_previous(
        elems: *mut isize,  // UCollationElements* in/out
        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 ucol_previous(ref IntPtr elems, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucol_previous' -Namespace Win32 -PassThru
# $api::ucol_previous(elems, status)
#uselib "icuin.dll"
#func global ucol_previous "ucol_previous" sptr, sptr
; ucol_previous elems, status   ; 戻り値は stat
; elems : UCollationElements* in/out -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuin.dll"
#cfunc global ucol_previous "ucol_previous" int, int
; res = ucol_previous(elems, status)
; elems : UCollationElements* in/out -> "int"
; status : UErrorCode* in/out -> "int"
; INT ucol_previous(UCollationElements* elems, UErrorCode* status)
#uselib "icuin.dll"
#cfunc global ucol_previous "ucol_previous" int, int
; res = ucol_previous(elems, status)
; elems : UCollationElements* in/out -> "int"
; status : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_previous = icuin.NewProc("ucol_previous")
)

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