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

unorm2_hasBoundaryBefore

関数
指定文字の前に正規化境界があるかを判定する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

CHAR unorm2_hasBoundaryBefore(
    const UNormalizer2* norm2,
    INT c
);

パラメーター

名前方向説明
norm2UNormalizer2*in使用する正規化器インスタンス。
cINTin正規化境界が直前に存在するか検査する単一コードポイント。

戻り値の型: CHAR

各言語での呼び出し定義

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

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

unorm2_hasBoundaryBefore = ctypes.cdll.icuuc.unorm2_hasBoundaryBefore
unorm2_hasBoundaryBefore.restype = ctypes.c_byte
unorm2_hasBoundaryBefore.argtypes = [
    ctypes.c_void_p,  # norm2 : UNormalizer2*
    ctypes.c_int,  # c : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
unorm2_hasBoundaryBefore = Fiddle::Function.new(
  lib['unorm2_hasBoundaryBefore'],
  [
    Fiddle::TYPE_VOIDP,  # norm2 : UNormalizer2*
    Fiddle::TYPE_INT,  # c : INT
  ],
  Fiddle::TYPE_CHAR, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn unorm2_hasBoundaryBefore(
        norm2: *const isize,  // UNormalizer2*
        c: i32  // INT
    ) -> i8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte unorm2_hasBoundaryBefore(ref IntPtr norm2, int c);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_unorm2_hasBoundaryBefore' -Namespace Win32 -PassThru
# $api::unorm2_hasBoundaryBefore(norm2, c)
#uselib "icuuc.dll"
#func global unorm2_hasBoundaryBefore "unorm2_hasBoundaryBefore" sptr, sptr
; unorm2_hasBoundaryBefore varptr(norm2), c   ; 戻り値は stat
; norm2 : UNormalizer2* -> "sptr"
; c : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "icuuc.dll"
#cfunc global unorm2_hasBoundaryBefore "unorm2_hasBoundaryBefore" var, int
; res = unorm2_hasBoundaryBefore(norm2, c)
; norm2 : UNormalizer2* -> "var"
; c : INT -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; CHAR unorm2_hasBoundaryBefore(UNormalizer2* norm2, INT c)
#uselib "icuuc.dll"
#cfunc global unorm2_hasBoundaryBefore "unorm2_hasBoundaryBefore" var, int
; res = unorm2_hasBoundaryBefore(norm2, c)
; norm2 : UNormalizer2* -> "var"
; c : INT -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procunorm2_hasBoundaryBefore = icuuc.NewProc("unorm2_hasBoundaryBefore")
)

// norm2 (UNormalizer2*), c (INT)
r1, _, err := procunorm2_hasBoundaryBefore.Call(
	uintptr(norm2),
	uintptr(c),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // CHAR
function unorm2_hasBoundaryBefore(
  norm2: Pointer;   // UNormalizer2*
  c: Integer   // INT
): Shortint; cdecl;
  external 'icuuc.dll' name 'unorm2_hasBoundaryBefore';
result := DllCall("icuuc\unorm2_hasBoundaryBefore"
    , "Ptr", norm2   ; UNormalizer2*
    , "Int", c   ; INT
    , "Cdecl Char")   ; return: CHAR
●unorm2_hasBoundaryBefore(norm2, c) = DLL("icuuc.dll", "char unorm2_hasBoundaryBefore(void*, int)")
# 呼び出し: unorm2_hasBoundaryBefore(norm2, c)
# norm2 : UNormalizer2* -> "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 "icuuc" fn unorm2_hasBoundaryBefore(
    norm2: [*c]isize, // UNormalizer2*
    c: i32 // INT
) callconv(.c) i8;
proc unorm2_hasBoundaryBefore(
    norm2: ptr int,  # UNormalizer2*
    c: int32  # INT
): int8 {.importc: "unorm2_hasBoundaryBefore", cdecl, dynlib: "icuuc.dll".}
pragma(lib, "icuuc");
extern(C)
byte unorm2_hasBoundaryBefore(
    ptrdiff_t* norm2,   // UNormalizer2*
    int c   // INT
);
ccall((:unorm2_hasBoundaryBefore, "icuuc.dll"), Int8,
      (Ptr{Int}, Int32),
      norm2, c)
# norm2 : UNormalizer2* -> Ptr{Int}
# c : INT -> Int32
local ffi = require("ffi")
ffi.cdef[[
int8_t unorm2_hasBoundaryBefore(
    intptr_t* norm2,
    int32_t c);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.unorm2_hasBoundaryBefore(norm2, c)
-- norm2 : UNormalizer2*
-- c : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const unorm2_hasBoundaryBefore = lib.func('__cdecl', 'unorm2_hasBoundaryBefore', 'int8_t', ['intptr_t *', 'int32_t']);
// unorm2_hasBoundaryBefore(norm2, c)
// norm2 : UNormalizer2* -> 'intptr_t *'
// c : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuuc.dll", {
  unorm2_hasBoundaryBefore: { parameters: ["pointer", "i32"], result: "i8" },
});
// lib.symbols.unorm2_hasBoundaryBefore(norm2, c)
// norm2 : UNormalizer2* -> "pointer"
// c : INT -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int8_t unorm2_hasBoundaryBefore(
    intptr_t* norm2,
    int32_t c);
C, "icuuc.dll");
// $ffi->unorm2_hasBoundaryBefore(norm2, c);
// norm2 : UNormalizer2*
// 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 Icuuc extends Library {
    Icuuc INSTANCE = Native.load("icuuc", Icuuc.class);
    byte unorm2_hasBoundaryBefore(
        LongByReference norm2,   // UNormalizer2*
        int c   // INT
    );
}
@[Link("icuuc")]
lib Libicuuc
  fun unorm2_hasBoundaryBefore = unorm2_hasBoundaryBefore(
    norm2 : LibC::SSizeT*,   # UNormalizer2*
    c : Int32   # INT
  ) : Int8
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef unorm2_hasBoundaryBeforeNative = Int8 Function(Pointer<IntPtr>, Int32);
typedef unorm2_hasBoundaryBeforeDart = int Function(Pointer<IntPtr>, int);
final unorm2_hasBoundaryBefore = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<unorm2_hasBoundaryBeforeNative, unorm2_hasBoundaryBeforeDart>('unorm2_hasBoundaryBefore');
// norm2 : UNormalizer2* -> Pointer<IntPtr>
// c : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function unorm2_hasBoundaryBefore(
  norm2: Pointer;   // UNormalizer2*
  c: Integer   // INT
): Shortint; cdecl;
  external 'icuuc.dll' name 'unorm2_hasBoundaryBefore';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "unorm2_hasBoundaryBefore"
  c_unorm2_hasBoundaryBefore :: Ptr CIntPtr -> Int32 -> IO Int8
-- norm2 : UNormalizer2* -> Ptr CIntPtr
-- c : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let unorm2_hasboundarybefore =
  foreign "unorm2_hasBoundaryBefore"
    ((ptr intptr_t) @-> int32_t @-> returning int8_t)
(* norm2 : UNormalizer2* -> (ptr intptr_t) *)
(* c : 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 ("unorm2_hasBoundaryBefore" unorm2-has-boundary-before :convention :cdecl) :int8
  (norm2 :pointer)   ; UNormalizer2*
  (c :int32))   ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $unorm2_hasBoundaryBefore = Win32::API::More->new('icuuc',
    'char unorm2_hasBoundaryBefore(LPVOID norm2, int c)');
# my $ret = $unorm2_hasBoundaryBefore->Call($norm2, $c);
# norm2 : UNormalizer2* -> LPVOID
# c : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。