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

unorm2_composePair

関数
二つのコードポイントを合成した文字を返す。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

INT unorm2_composePair(
    const UNormalizer2* norm2,
    INT a,
    INT b
);

パラメーター

名前方向
norm2UNormalizer2*in
aINTin
bINTin

戻り値の型: INT

各言語での呼び出し定義

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

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

unorm2_composePair = ctypes.cdll.icuuc.unorm2_composePair
unorm2_composePair.restype = ctypes.c_int
unorm2_composePair.argtypes = [
    ctypes.c_void_p,  # norm2 : UNormalizer2*
    ctypes.c_int,  # a : INT
    ctypes.c_int,  # b : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procunorm2_composePair = icuuc.NewProc("unorm2_composePair")
)

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