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