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

ucal_isWeekend

関数
指定日時が週末に該当するかどうかを判定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

CHAR ucal_isWeekend(
    const void** cal,
    DOUBLE date,
    UErrorCode* status
);

パラメーター

名前方向
calvoid**in
dateDOUBLEin
statusUErrorCode*inout

戻り値の型: CHAR

各言語での呼び出し定義

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

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

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

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucal_isWeekend = icuin.NewProc("ucal_isWeekend")
)

// cal (void**), date (DOUBLE), status (UErrorCode* in/out)
r1, _, err := procucal_isWeekend.Call(
	uintptr(cal),
	uintptr(math.Float64bits(date)),
	uintptr(status),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // CHAR
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。
function ucal_isWeekend(
  cal: Pointer;   // void**
  date: Double;   // DOUBLE
  status: Pointer   // UErrorCode* in/out
): Shortint; cdecl;
  external 'icuin.dll' name 'ucal_isWeekend';
result := DllCall("icuin\ucal_isWeekend"
    , "Ptr", cal   ; void**
    , "Double", date   ; DOUBLE
    , "Ptr", status   ; UErrorCode* in/out
    , "Cdecl Char")   ; return: CHAR
●ucal_isWeekend(cal, date, status) = DLL("icuin.dll", "char ucal_isWeekend(void*, double, void*)")
# 呼び出し: ucal_isWeekend(cal, date, status)
# cal : void** -> "void*"
# date : DOUBLE -> "double"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。