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

udatpg_getDecimal

関数
小数記号を取得する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

WORD* udatpg_getDecimal(
    const void** dtpg,
    INT* pLength
);

パラメーター

名前方向説明
dtpgvoid**in対象のUDateTimePatternGeneratorハンドル。
pLengthINT*inout返される小数点記号文字列の長さを受け取る出力先。

戻り値の型: WORD*

各言語での呼び出し定義

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

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

udatpg_getDecimal = ctypes.cdll.icuin.udatpg_getDecimal
udatpg_getDecimal.restype = ctypes.c_void_p
udatpg_getDecimal.argtypes = [
    ctypes.c_void_p,  # dtpg : void**
    ctypes.POINTER(ctypes.c_int),  # pLength : INT* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
udatpg_getDecimal = Fiddle::Function.new(
  lib['udatpg_getDecimal'],
  [
    Fiddle::TYPE_VOIDP,  # dtpg : void**
    Fiddle::TYPE_VOIDP,  # pLength : INT* in/out
  ],
  Fiddle::TYPE_VOIDP, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn udatpg_getDecimal(
        dtpg: *const *const (),  // void**
        pLength: *mut i32  // INT* in/out
    ) -> *mut u16;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr udatpg_getDecimal(IntPtr dtpg, ref int pLength);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_udatpg_getDecimal' -Namespace Win32 -PassThru
# $api::udatpg_getDecimal(dtpg, pLength)
#uselib "icuin.dll"
#func global udatpg_getDecimal "udatpg_getDecimal" sptr, sptr
; udatpg_getDecimal dtpg, varptr(pLength)   ; 戻り値は stat
; dtpg : void** -> "sptr"
; pLength : INT* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuin.dll"
#cfunc global udatpg_getDecimal "udatpg_getDecimal" sptr, var
; res = udatpg_getDecimal(dtpg, pLength)
; dtpg : void** -> "sptr"
; pLength : INT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; WORD* udatpg_getDecimal(void** dtpg, INT* pLength)
#uselib "icuin.dll"
#cfunc global udatpg_getDecimal "udatpg_getDecimal" intptr, var
; res = udatpg_getDecimal(dtpg, pLength)
; dtpg : void** -> "intptr"
; pLength : INT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procudatpg_getDecimal = icuin.NewProc("udatpg_getDecimal")
)

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

extern "icuin" fn udatpg_getDecimal(
    dtpg: ?*anyopaque, // void**
    pLength: [*c]i32 // INT* in/out
) callconv(.c) [*c]u16;
proc udatpg_getDecimal(
    dtpg: pointer,  # void**
    pLength: ptr int32  # INT* in/out
): ptr uint16 {.importc: "udatpg_getDecimal", cdecl, dynlib: "icuin.dll".}
pragma(lib, "icuin");
extern(C)
ushort* udatpg_getDecimal(
    void** dtpg,   // void**
    int* pLength   // INT* in/out
);
ccall((:udatpg_getDecimal, "icuin.dll"), Ptr{UInt16},
      (Ptr{Cvoid}, Ptr{Int32}),
      dtpg, pLength)
# dtpg : void** -> Ptr{Cvoid}
# pLength : INT* in/out -> Ptr{Int32}
local ffi = require("ffi")
ffi.cdef[[
uint16_t* udatpg_getDecimal(
    void** dtpg,
    int32_t* pLength);
]]
local icuin = ffi.load("icuin")
-- icuin.udatpg_getDecimal(dtpg, pLength)
-- dtpg : void**
-- pLength : INT* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuin.dll');
const udatpg_getDecimal = lib.func('__cdecl', 'udatpg_getDecimal', 'uint16_t *', ['void *', 'int32_t *']);
// udatpg_getDecimal(dtpg, pLength)
// dtpg : void** -> 'void *'
// pLength : INT* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuin.dll", {
  udatpg_getDecimal: { parameters: ["pointer", "pointer"], result: "pointer" },
});
// lib.symbols.udatpg_getDecimal(dtpg, pLength)
// dtpg : void** -> "pointer"
// pLength : INT* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint16_t* udatpg_getDecimal(
    void** dtpg,
    int32_t* pLength);
C, "icuin.dll");
// $ffi->udatpg_getDecimal(dtpg, pLength);
// dtpg : void**
// pLength : INT* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Icuin extends Library {
    Icuin INSTANCE = Native.load("icuin", Icuin.class);
    Pointer udatpg_getDecimal(
        Pointer dtpg,   // void**
        IntByReference pLength   // INT* in/out
    );
}
@[Link("icuin")]
lib Libicuin
  fun udatpg_getDecimal = udatpg_getDecimal(
    dtpg : Void**,   # void**
    pLength : Int32*   # INT* in/out
  ) : UInt16*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef udatpg_getDecimalNative = Pointer<Uint16> Function(Pointer<Void>, Pointer<Int32>);
typedef udatpg_getDecimalDart = Pointer<Uint16> Function(Pointer<Void>, Pointer<Int32>);
final udatpg_getDecimal = DynamicLibrary.open('icuin.dll')
    .lookupFunction<udatpg_getDecimalNative, udatpg_getDecimalDart>('udatpg_getDecimal');
// dtpg : void** -> Pointer<Void>
// pLength : INT* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function udatpg_getDecimal(
  dtpg: Pointer;   // void**
  pLength: Pointer   // INT* in/out
): Pointer; cdecl;
  external 'icuin.dll' name 'udatpg_getDecimal';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "udatpg_getDecimal"
  c_udatpg_getDecimal :: Ptr () -> Ptr Int32 -> IO (Ptr Word16)
-- dtpg : void** -> Ptr ()
-- pLength : INT* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let udatpg_getdecimal =
  foreign "udatpg_getDecimal"
    ((ptr void) @-> (ptr int32_t) @-> returning (ptr uint16_t))
(* dtpg : void** -> (ptr void) *)
(* pLength : INT* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuin (t "icuin.dll"))
(cffi:use-foreign-library icuin)

(cffi:defcfun ("udatpg_getDecimal" udatpg-get-decimal :convention :cdecl) :pointer
  (dtpg :pointer)   ; void**
  (p-length :pointer))   ; INT* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $udatpg_getDecimal = Win32::API::More->new('icuin',
    'LPVOID udatpg_getDecimal(LPVOID dtpg, LPVOID pLength)');
# my $ret = $udatpg_getDecimal->Call($dtpg, $pLength);
# dtpg : void** -> LPVOID
# pLength : INT* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。