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

ucol_setOffset

関数
照合要素イテレータのオフセット位置を設定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void ucol_setOffset(
    UCollationElements* elems,
    INT offset,
    UErrorCode* status
);

パラメーター

名前方向
elemsUCollationElements*inout
offsetINTin
statusUErrorCode*inout

戻り値の型: void

各言語での呼び出し定義

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

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

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

lib = Fiddle.dlopen('icuin.dll')
ucol_setOffset = Fiddle::Function.new(
  lib['ucol_setOffset'],
  [
    Fiddle::TYPE_VOIDP,  # elems : UCollationElements* in/out
    Fiddle::TYPE_INT,  # offset : INT
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucol_setOffset(
        elems: *mut isize,  // UCollationElements* in/out
        offset: i32,  // INT
        status: *mut i32  // UErrorCode* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucol_setOffset(ref IntPtr elems, int offset, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucol_setOffset' -Namespace Win32 -PassThru
# $api::ucol_setOffset(elems, offset, status)
#uselib "icuin.dll"
#func global ucol_setOffset "ucol_setOffset" sptr, sptr, sptr
; ucol_setOffset elems, offset, status
; elems : UCollationElements* in/out -> "sptr"
; offset : INT -> "sptr"
; status : UErrorCode* in/out -> "sptr"
#uselib "icuin.dll"
#func global ucol_setOffset "ucol_setOffset" int, int, int
; ucol_setOffset elems, offset, status
; elems : UCollationElements* in/out -> "int"
; offset : INT -> "int"
; status : UErrorCode* in/out -> "int"
; void ucol_setOffset(UCollationElements* elems, INT offset, UErrorCode* status)
#uselib "icuin.dll"
#func global ucol_setOffset "ucol_setOffset" int, int, int
; ucol_setOffset elems, offset, status
; elems : UCollationElements* in/out -> "int"
; offset : INT -> "int"
; status : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucol_setOffset = icuin.NewProc("ucol_setOffset")
)

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