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

uset_charAt

関数
USet内の指定順位にあるコードポイントを返す。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

INT uset_charAt(
    const USet* set,
    INT charIndex
);

パラメーター

名前方向
setUSet*in
charIndexINTin

戻り値の型: INT

各言語での呼び出し定義

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

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

uset_charAt = ctypes.cdll.icuuc.uset_charAt
uset_charAt.restype = ctypes.c_int
uset_charAt.argtypes = [
    ctypes.c_void_p,  # set : USet*
    ctypes.c_int,  # charIndex : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procuset_charAt = icuuc.NewProc("uset_charAt")
)

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