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

ucal_clone

関数
カレンダーオブジェクトを複製する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void** ucal_clone(
    const void** cal,
    UErrorCode* status
);

パラメーター

名前方向
calvoid**in
statusUErrorCode*inout

戻り値の型: void**

各言語での呼び出し定義

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

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

ucal_clone = ctypes.cdll.icuin.ucal_clone
ucal_clone.restype = ctypes.c_void_p
ucal_clone.argtypes = [
    ctypes.c_void_p,  # cal : void**
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
ucal_clone = Fiddle::Function.new(
  lib['ucal_clone'],
  [
    Fiddle::TYPE_VOIDP,  # cal : void**
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn ucal_clone(
        cal: *const *const (),  // void**
        status: *mut i32  // UErrorCode* in/out
    ) -> *mut *mut ();
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ucal_clone(IntPtr cal, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_ucal_clone' -Namespace Win32 -PassThru
# $api::ucal_clone(cal, status)
#uselib "icuin.dll"
#func global ucal_clone "ucal_clone" sptr, sptr
; ucal_clone cal, status   ; 戻り値は stat
; cal : void** -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "icuin.dll"
#cfunc global ucal_clone "ucal_clone" sptr, int
; res = ucal_clone(cal, status)
; cal : void** -> "sptr"
; status : UErrorCode* in/out -> "int"
; void** ucal_clone(void** cal, UErrorCode* status)
#uselib "icuin.dll"
#cfunc global ucal_clone "ucal_clone" intptr, int
; res = ucal_clone(cal, status)
; cal : void** -> "intptr"
; status : UErrorCode* in/out -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucal_clone = icuin.NewProc("ucal_clone")
)

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