ホーム › Globalization › utext_next32From
utext_next32From
関数指定位置から次のコードポイントを取得する。
シグネチャ
// icuuc.dll
#include <windows.h>
INT utext_next32From(
UText* ut,
LONGLONG nativeIndex
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ut | UText* | inout | 対象のUTextオブジェクトへのポインタ。 |
| nativeIndex | LONGLONG | in | 走査を開始するネイティブ単位の位置。この位置の文字を返し次へ進める。 |
戻り値の型: INT
各言語での呼び出し定義
// icuuc.dll
#include <windows.h>
INT utext_next32From(
UText* ut,
LONGLONG nativeIndex
);[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int utext_next32From(
IntPtr ut, // UText* in/out
long nativeIndex // LONGLONG
);<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function utext_next32From(
ut As IntPtr, ' UText* in/out
nativeIndex As Long ' LONGLONG
) As Integer
End Function' ut : UText* in/out
' nativeIndex : LONGLONG
Declare PtrSafe Function utext_next32From Lib "icuuc" ( _
ByVal ut As LongPtr, _
ByVal nativeIndex As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
utext_next32From = ctypes.cdll.icuuc.utext_next32From
utext_next32From.restype = ctypes.c_int
utext_next32From.argtypes = [
ctypes.c_void_p, # ut : UText* in/out
ctypes.c_longlong, # nativeIndex : LONGLONG
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('icuuc.dll')
utext_next32From = Fiddle::Function.new(
lib['utext_next32From'],
[
Fiddle::TYPE_VOIDP, # ut : UText* in/out
Fiddle::TYPE_LONG_LONG, # nativeIndex : LONGLONG
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "icuuc")]
extern "C" {
fn utext_next32From(
ut: *mut UText, // UText* in/out
nativeIndex: i64 // LONGLONG
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int utext_next32From(IntPtr ut, long nativeIndex);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_utext_next32From' -Namespace Win32 -PassThru
# $api::utext_next32From(ut, nativeIndex)#uselib "icuuc.dll"
#func global utext_next32From "utext_next32From" sptr, sptr
; utext_next32From varptr(ut), nativeIndex ; 戻り値は stat
; ut : UText* in/out -> "sptr"
; nativeIndex : LONGLONG -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "icuuc.dll" #cfunc global utext_next32From "utext_next32From" var, int64 ; res = utext_next32From(ut, nativeIndex) ; ut : UText* in/out -> "var" ; nativeIndex : LONGLONG -> "int64" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。#uselib "icuuc.dll" #cfunc global utext_next32From "utext_next32From" sptr, int64 ; res = utext_next32From(varptr(ut), nativeIndex) ; ut : UText* in/out -> "sptr" ; nativeIndex : LONGLONG -> "int64" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; INT utext_next32From(UText* ut, LONGLONG nativeIndex) #uselib "icuuc.dll" #cfunc global utext_next32From "utext_next32From" var, int64 ; res = utext_next32From(ut, nativeIndex) ; ut : UText* in/out -> "var" ; nativeIndex : LONGLONG -> "int64" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT utext_next32From(UText* ut, LONGLONG nativeIndex) #uselib "icuuc.dll" #cfunc global utext_next32From "utext_next32From" intptr, int64 ; res = utext_next32From(varptr(ut), nativeIndex) ; ut : UText* in/out -> "intptr" ; nativeIndex : LONGLONG -> "int64" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
icuuc = windows.NewLazySystemDLL("icuuc.dll")
procutext_next32From = icuuc.NewProc("utext_next32From")
)
// ut (UText* in/out), nativeIndex (LONGLONG)
r1, _, err := procutext_next32From.Call(
uintptr(ut),
uintptr(nativeIndex),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction utext_next32From(
ut: Pointer; // UText* in/out
nativeIndex: Int64 // LONGLONG
): Integer; cdecl;
external 'icuuc.dll' name 'utext_next32From';result := DllCall("icuuc\utext_next32From"
, "Ptr", ut ; UText* in/out
, "Int64", nativeIndex ; LONGLONG
, "Cdecl Int") ; return: INT●utext_next32From(ut, nativeIndex) = DLL("icuuc.dll", "int utext_next32From(void*, int64)")
# 呼び出し: utext_next32From(ut, nativeIndex)
# ut : UText* in/out -> "void*"
# nativeIndex : LONGLONG -> "int64"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。const std = @import("std");
extern "icuuc" fn utext_next32From(
ut: [*c]UText, // UText* in/out
nativeIndex: i64 // LONGLONG
) callconv(.c) i32;proc utext_next32From(
ut: ptr UText, # UText* in/out
nativeIndex: int64 # LONGLONG
): int32 {.importc: "utext_next32From", cdecl, dynlib: "icuuc.dll".}pragma(lib, "icuuc");
extern(C)
int utext_next32From(
UText* ut, // UText* in/out
long nativeIndex // LONGLONG
);ccall((:utext_next32From, "icuuc.dll"), Int32,
(Ptr{UText}, Int64),
ut, nativeIndex)
# ut : UText* in/out -> Ptr{UText}
# nativeIndex : LONGLONG -> Int64local ffi = require("ffi")
ffi.cdef[[
int32_t utext_next32From(
void* ut,
int64_t nativeIndex);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.utext_next32From(ut, nativeIndex)
-- ut : UText* in/out
-- nativeIndex : LONGLONG
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const utext_next32From = lib.func('__cdecl', 'utext_next32From', 'int32_t', ['void *', 'int64_t']);
// utext_next32From(ut, nativeIndex)
// ut : UText* in/out -> 'void *'
// nativeIndex : LONGLONG -> 'int64_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("icuuc.dll", {
utext_next32From: { parameters: ["pointer", "i64"], result: "i32" },
});
// lib.symbols.utext_next32From(ut, nativeIndex)
// ut : UText* in/out -> "pointer"
// nativeIndex : LONGLONG -> "i64"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t utext_next32From(
void* ut,
int64_t nativeIndex);
C, "icuuc.dll");
// $ffi->utext_next32From(ut, nativeIndex);
// ut : UText* in/out
// nativeIndex : LONGLONG
// 構造体/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 Icuuc extends Library {
Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
int utext_next32From(
Pointer ut, // UText* in/out
long nativeIndex // LONGLONG
);
}@[Link("icuuc")]
lib Libicuuc
fun utext_next32From = utext_next32From(
ut : UText*, # UText* in/out
nativeIndex : Int64 # LONGLONG
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef utext_next32FromNative = Int32 Function(Pointer<Void>, Int64);
typedef utext_next32FromDart = int Function(Pointer<Void>, int);
final utext_next32From = DynamicLibrary.open('icuuc.dll')
.lookupFunction<utext_next32FromNative, utext_next32FromDart>('utext_next32From');
// ut : UText* in/out -> Pointer<Void>
// nativeIndex : LONGLONG -> Int64
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function utext_next32From(
ut: Pointer; // UText* in/out
nativeIndex: Int64 // LONGLONG
): Integer; cdecl;
external 'icuuc.dll' name 'utext_next32From';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import ccall safe "utext_next32From"
c_utext_next32From :: Ptr () -> Int64 -> IO Int32
-- ut : UText* in/out -> Ptr ()
-- nativeIndex : LONGLONG -> Int64
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let utext_next32from =
foreign "utext_next32From"
((ptr void) @-> int64_t @-> returning int32_t)
(* ut : UText* in/out -> (ptr void) *)
(* nativeIndex : LONGLONG -> int64_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)
(cffi:defcfun ("utext_next32From" utext-next32-from :convention :cdecl) :int32
(ut :pointer) ; UText* in/out
(native-index :int64)) ; LONGLONG
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $utext_next32From = Win32::API::More->new('icuuc',
'int utext_next32From(LPVOID ut, INT64 nativeIndex)');
# my $ret = $utext_next32From->Call($ut, $nativeIndex);
# ut : UText* in/out -> LPVOID
# nativeIndex : LONGLONG -> INT64
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型