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

ucpmap_get

関数
コードポイントマップから指定コードポイントの値を取得する。
DLLicu.dll呼出規約cdecl

シグネチャ

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

DWORD ucpmap_get(
    const UCPMap* map,
    INT c
);

パラメーター

名前方向
mapUCPMap*in
cINTin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ucpmap_get(
    const UCPMap* map,
    INT c
);
[DllImport("icu.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ucpmap_get(
    ref IntPtr map,   // UCPMap*
    int c   // INT
);
<DllImport("icu.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ucpmap_get(
    ByRef map As IntPtr,   ' UCPMap*
    c As Integer   ' INT
) As UInteger
End Function
' map : UCPMap*
' c : INT
Declare PtrSafe Function ucpmap_get Lib "icu" ( _
    ByRef map As LongPtr, _
    ByVal c As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucpmap_get = ctypes.cdll.icu.ucpmap_get
ucpmap_get.restype = wintypes.DWORD
ucpmap_get.argtypes = [
    ctypes.c_void_p,  # map : UCPMap*
    ctypes.c_int,  # c : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icu = windows.NewLazySystemDLL("icu.dll")
	procucpmap_get = icu.NewProc("ucpmap_get")
)

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