ホーム › Globalization › ucpmap_get
ucpmap_get
関数コードポイントマップから指定コードポイントの値を取得する。
シグネチャ
// icu.dll
#include <windows.h>
DWORD ucpmap_get(
const UCPMap* map,
INT c
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| map | UCPMap* | in | 値を取得する対象のコードポイントマップ(UCPMap)。 |
| c | INT | in | 値を取得するUnicodeコードポイント(U+0000~U+10FFFF)。 |
戻り値の型: 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 varptr(map), c ; 戻り値は stat
; map : UCPMap* -> "sptr"
; c : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icu.dll" #cfunc global ucpmap_get "ucpmap_get" var, int ; res = ucpmap_get(map, c) ; map : UCPMap* -> "var" ; c : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "icu.dll" #cfunc global ucpmap_get "ucpmap_get" sptr, int ; res = ucpmap_get(varptr(map), c) ; map : UCPMap* -> "sptr" ; c : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ucpmap_get(UCPMap* map, INT c) #uselib "icu.dll" #cfunc global ucpmap_get "ucpmap_get" var, int ; res = ucpmap_get(map, c) ; map : UCPMap* -> "var" ; c : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ucpmap_get(UCPMap* map, INT c) #uselib "icu.dll" #cfunc global ucpmap_get "ucpmap_get" intptr, int ; res = ucpmap_get(varptr(map), c) ; map : UCPMap* -> "intptr" ; c : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
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 // DWORDfunction 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`,…) を使用。const std = @import("std");
extern "icu" fn ucpmap_get(
map: [*c]isize, // UCPMap*
c: i32 // INT
) callconv(.c) u32;proc ucpmap_get(
map: ptr int, # UCPMap*
c: int32 # INT
): uint32 {.importc: "ucpmap_get", cdecl, dynlib: "icu.dll".}pragma(lib, "icu");
extern(C)
uint ucpmap_get(
ptrdiff_t* map, // UCPMap*
int c // INT
);ccall((:ucpmap_get, "icu.dll"), UInt32,
(Ptr{Int}, Int32),
map, c)
# map : UCPMap* -> Ptr{Int}
# c : INT -> Int32local ffi = require("ffi")
ffi.cdef[[
uint32_t ucpmap_get(
intptr_t* map,
int32_t c);
]]
local icu = ffi.load("icu")
-- icu.ucpmap_get(map, c)
-- map : UCPMap*
-- c : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icu.dll');
const ucpmap_get = lib.func('__cdecl', 'ucpmap_get', 'uint32_t', ['intptr_t *', 'int32_t']);
// ucpmap_get(map, c)
// map : UCPMap* -> 'intptr_t *'
// c : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icu.dll", {
ucpmap_get: { parameters: ["pointer", "i32"], result: "u32" },
});
// lib.symbols.ucpmap_get(map, c)
// map : UCPMap* -> "pointer"
// c : INT -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t ucpmap_get(
intptr_t* map,
int32_t c);
C, "icu.dll");
// $ffi->ucpmap_get(map, c);
// map : UCPMap*
// c : INT
// 構造体/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 Icu extends Library {
Icu INSTANCE = Native.load("icu", Icu.class);
int ucpmap_get(
LongByReference map, // UCPMap*
int c // INT
);
}@[Link("icu")]
lib Libicu
fun ucpmap_get = ucpmap_get(
map : LibC::SSizeT*, # UCPMap*
c : Int32 # INT
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ucpmap_getNative = Uint32 Function(Pointer<IntPtr>, Int32);
typedef ucpmap_getDart = int Function(Pointer<IntPtr>, int);
final ucpmap_get = DynamicLibrary.open('icu.dll')
.lookupFunction<ucpmap_getNative, ucpmap_getDart>('ucpmap_get');
// map : UCPMap* -> Pointer<IntPtr>
// c : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ucpmap_get(
map: Pointer; // UCPMap*
c: Integer // INT
): DWORD; cdecl;
external 'icu.dll' name 'ucpmap_get';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "ucpmap_get"
c_ucpmap_get :: Ptr CIntPtr -> Int32 -> IO Word32
-- map : UCPMap* -> Ptr CIntPtr
-- c : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ucpmap_get =
foreign "ucpmap_get"
((ptr intptr_t) @-> int32_t @-> returning uint32_t)
(* map : UCPMap* -> (ptr intptr_t) *)
(* c : INT -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icu (t "icu.dll"))
(cffi:use-foreign-library icu)
(cffi:defcfun ("ucpmap_get" ucpmap-get :convention :cdecl) :uint32
(map :pointer) ; UCPMap*
(c :int32)) ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ucpmap_get = Win32::API::More->new('icu',
'DWORD ucpmap_get(LPVOID map, int c)');
# my $ret = $ucpmap_get->Call($map, $c);
# map : UCPMap* -> LPVOID
# c : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。