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

ucal_getDayOfWeekType

関数
指定曜日が平日か週末かなどの種別を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

UCalendarWeekdayType ucal_getDayOfWeekType(
    const void** cal,
    UCalendarDaysOfWeek dayOfWeek,
    UErrorCode* status
);

パラメーター

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

戻り値の型: UCalendarWeekdayType

各言語での呼び出し定義

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

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

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

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

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procucal_getDayOfWeekType = icuin.NewProc("ucal_getDayOfWeekType")
)

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