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

utext_copy

関数
UTextの指定範囲を指定位置へコピーまたは移動する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void utext_copy(
    UText* ut,
    LONGLONG nativeStart,
    LONGLONG nativeLimit,
    LONGLONG destIndex,
    CHAR move,
    UErrorCode* status
);

パラメーター

名前方向説明
utUText*inoutコピー操作の対象UTextオブジェクトへのポインタ。書き込み可能である必要がある。
nativeStartLONGLONGinコピー元範囲の開始位置(ネイティブ単位、この位置を含む)。
nativeLimitLONGLONGinコピー元範囲の終了位置(ネイティブ単位、この位置は含まない)。
destIndexLONGLONGinコピー先の挿入位置(ネイティブ単位)。
moveCHARin移動するか複製するかを示す真偽値。非0で移動、0でコピー。
statusUErrorCode*inoutICUのエラーコードを受け渡すポインタ。呼び出し前にU_ZERO_ERRORで初期化する。

戻り値の型: void

各言語での呼び出し定義

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

void utext_copy(
    UText* ut,
    LONGLONG nativeStart,
    LONGLONG nativeLimit,
    LONGLONG destIndex,
    CHAR move,
    UErrorCode* status
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void utext_copy(
    IntPtr ut,   // UText* in/out
    long nativeStart,   // LONGLONG
    long nativeLimit,   // LONGLONG
    long destIndex,   // LONGLONG
    sbyte move,   // CHAR
    ref int status   // UErrorCode* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub utext_copy(
    ut As IntPtr,   ' UText* in/out
    nativeStart As Long,   ' LONGLONG
    nativeLimit As Long,   ' LONGLONG
    destIndex As Long,   ' LONGLONG
    move As SByte,   ' CHAR
    ByRef status As Integer   ' UErrorCode* in/out
)
End Sub
' ut : UText* in/out
' nativeStart : LONGLONG
' nativeLimit : LONGLONG
' destIndex : LONGLONG
' move : CHAR
' status : UErrorCode* in/out
Declare PtrSafe Sub utext_copy Lib "icuuc" ( _
    ByVal ut As LongPtr, _
    ByVal nativeStart As LongLong, _
    ByVal nativeLimit As LongLong, _
    ByVal destIndex As LongLong, _
    ByVal move As Byte, _
    ByRef status As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

utext_copy = ctypes.cdll.icuuc.utext_copy
utext_copy.restype = None
utext_copy.argtypes = [
    ctypes.c_void_p,  # ut : UText* in/out
    ctypes.c_longlong,  # nativeStart : LONGLONG
    ctypes.c_longlong,  # nativeLimit : LONGLONG
    ctypes.c_longlong,  # destIndex : LONGLONG
    ctypes.c_byte,  # move : CHAR
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
utext_copy = Fiddle::Function.new(
  lib['utext_copy'],
  [
    Fiddle::TYPE_VOIDP,  # ut : UText* in/out
    Fiddle::TYPE_LONG_LONG,  # nativeStart : LONGLONG
    Fiddle::TYPE_LONG_LONG,  # nativeLimit : LONGLONG
    Fiddle::TYPE_LONG_LONG,  # destIndex : LONGLONG
    Fiddle::TYPE_CHAR,  # move : CHAR
    Fiddle::TYPE_VOIDP,  # status : UErrorCode* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn utext_copy(
        ut: *mut UText,  // UText* in/out
        nativeStart: i64,  // LONGLONG
        nativeLimit: i64,  // LONGLONG
        destIndex: i64,  // LONGLONG
        move: i8,  // CHAR
        status: *mut i32  // UErrorCode* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void utext_copy(IntPtr ut, long nativeStart, long nativeLimit, long destIndex, sbyte move, ref int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_utext_copy' -Namespace Win32 -PassThru
# $api::utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status)
#uselib "icuuc.dll"
#func global utext_copy "utext_copy" sptr, sptr, sptr, sptr, sptr, sptr
; utext_copy varptr(ut), nativeStart, nativeLimit, destIndex, move, varptr(status)
; ut : UText* in/out -> "sptr"
; nativeStart : LONGLONG -> "sptr"
; nativeLimit : LONGLONG -> "sptr"
; destIndex : LONGLONG -> "sptr"
; move : CHAR -> "sptr"
; status : UErrorCode* in/out -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
出力引数:
#uselib "icuuc.dll"
#func global utext_copy "utext_copy" var, int64, int64, int64, int, var
; utext_copy ut, nativeStart, nativeLimit, destIndex, move, status
; ut : UText* in/out -> "var"
; nativeStart : LONGLONG -> "int64"
; nativeLimit : LONGLONG -> "int64"
; destIndex : LONGLONG -> "int64"
; move : CHAR -> "int"
; status : UErrorCode* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; void utext_copy(UText* ut, LONGLONG nativeStart, LONGLONG nativeLimit, LONGLONG destIndex, CHAR move, UErrorCode* status)
#uselib "icuuc.dll"
#func global utext_copy "utext_copy" var, int64, int64, int64, int, var
; utext_copy ut, nativeStart, nativeLimit, destIndex, move, status
; ut : UText* in/out -> "var"
; nativeStart : LONGLONG -> "int64"
; nativeLimit : LONGLONG -> "int64"
; destIndex : LONGLONG -> "int64"
; move : CHAR -> "int"
; status : UErrorCode* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procutext_copy = icuuc.NewProc("utext_copy")
)

// ut (UText* in/out), nativeStart (LONGLONG), nativeLimit (LONGLONG), destIndex (LONGLONG), move (CHAR), status (UErrorCode* in/out)
r1, _, err := procutext_copy.Call(
	uintptr(ut),
	uintptr(nativeStart),
	uintptr(nativeLimit),
	uintptr(destIndex),
	uintptr(move),
	uintptr(status),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure utext_copy(
  ut: Pointer;   // UText* in/out
  nativeStart: Int64;   // LONGLONG
  nativeLimit: Int64;   // LONGLONG
  destIndex: Int64;   // LONGLONG
  move: Shortint;   // CHAR
  status: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icuuc.dll' name 'utext_copy';
result := DllCall("icuuc\utext_copy"
    , "Ptr", ut   ; UText* in/out
    , "Int64", nativeStart   ; LONGLONG
    , "Int64", nativeLimit   ; LONGLONG
    , "Int64", destIndex   ; LONGLONG
    , "Char", move   ; CHAR
    , "Ptr", status   ; UErrorCode* in/out
    , "Cdecl Int")   ; return: void
●utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status) = DLL("icuuc.dll", "int utext_copy(void*, int64, int64, int64, char, void*)")
# 呼び出し: utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status)
# ut : UText* in/out -> "void*"
# nativeStart : LONGLONG -> "int64"
# nativeLimit : LONGLONG -> "int64"
# destIndex : LONGLONG -> "int64"
# move : CHAR -> "char"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。
const std = @import("std");

extern "icuuc" fn utext_copy(
    ut: [*c]UText, // UText* in/out
    nativeStart: i64, // LONGLONG
    nativeLimit: i64, // LONGLONG
    destIndex: i64, // LONGLONG
    move: i8, // CHAR
    status: [*c]i32 // UErrorCode* in/out
) callconv(.c) void;
proc utext_copy(
    ut: ptr UText,  # UText* in/out
    nativeStart: int64,  # LONGLONG
    nativeLimit: int64,  # LONGLONG
    destIndex: int64,  # LONGLONG
    move: int8,  # CHAR
    status: ptr int32  # UErrorCode* in/out
) {.importc: "utext_copy", cdecl, dynlib: "icuuc.dll".}
pragma(lib, "icuuc");
extern(C)
void utext_copy(
    UText* ut,   // UText* in/out
    long nativeStart,   // LONGLONG
    long nativeLimit,   // LONGLONG
    long destIndex,   // LONGLONG
    byte move,   // CHAR
    int* status   // UErrorCode* in/out
);
ccall((:utext_copy, "icuuc.dll"), Cvoid,
      (Ptr{UText}, Int64, Int64, Int64, Int8, Ptr{Int32}),
      ut, nativeStart, nativeLimit, destIndex, move, status)
# ut : UText* in/out -> Ptr{UText}
# nativeStart : LONGLONG -> Int64
# nativeLimit : LONGLONG -> Int64
# destIndex : LONGLONG -> Int64
# move : CHAR -> Int8
# status : UErrorCode* in/out -> Ptr{Int32}
local ffi = require("ffi")
ffi.cdef[[
void utext_copy(
    void* ut,
    int64_t nativeStart,
    int64_t nativeLimit,
    int64_t destIndex,
    int8_t move,
    int32_t* status);
]]
local icuuc = ffi.load("icuuc")
-- icuuc.utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status)
-- ut : UText* in/out
-- nativeStart : LONGLONG
-- nativeLimit : LONGLONG
-- destIndex : LONGLONG
-- move : CHAR
-- status : UErrorCode* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('icuuc.dll');
const utext_copy = lib.func('__cdecl', 'utext_copy', 'void', ['void *', 'int64_t', 'int64_t', 'int64_t', 'int8_t', 'int32_t *']);
// utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status)
// ut : UText* in/out -> 'void *'
// nativeStart : LONGLONG -> 'int64_t'
// nativeLimit : LONGLONG -> 'int64_t'
// destIndex : LONGLONG -> 'int64_t'
// move : CHAR -> 'int8_t'
// status : UErrorCode* in/out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("icuuc.dll", {
  utext_copy: { parameters: ["pointer", "i64", "i64", "i64", "i8", "pointer"], result: "void" },
});
// lib.symbols.utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status)
// ut : UText* in/out -> "pointer"
// nativeStart : LONGLONG -> "i64"
// nativeLimit : LONGLONG -> "i64"
// destIndex : LONGLONG -> "i64"
// move : CHAR -> "i8"
// status : UErrorCode* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void utext_copy(
    void* ut,
    int64_t nativeStart,
    int64_t nativeLimit,
    int64_t destIndex,
    int8_t move,
    int32_t* status);
C, "icuuc.dll");
// $ffi->utext_copy(ut, nativeStart, nativeLimit, destIndex, move, status);
// ut : UText* in/out
// nativeStart : LONGLONG
// nativeLimit : LONGLONG
// destIndex : LONGLONG
// move : CHAR
// status : UErrorCode* in/out
// 構造体/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);
    void utext_copy(
        Pointer ut,   // UText* in/out
        long nativeStart,   // LONGLONG
        long nativeLimit,   // LONGLONG
        long destIndex,   // LONGLONG
        byte move,   // CHAR
        IntByReference status   // UErrorCode* in/out
    );
}
@[Link("icuuc")]
lib Libicuuc
  fun utext_copy = utext_copy(
    ut : UText*,   # UText* in/out
    nativeStart : Int64,   # LONGLONG
    nativeLimit : Int64,   # LONGLONG
    destIndex : Int64,   # LONGLONG
    move : Int8,   # CHAR
    status : Int32*   # UErrorCode* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef utext_copyNative = Void Function(Pointer<Void>, Int64, Int64, Int64, Int8, Pointer<Int32>);
typedef utext_copyDart = void Function(Pointer<Void>, int, int, int, int, Pointer<Int32>);
final utext_copy = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<utext_copyNative, utext_copyDart>('utext_copy');
// ut : UText* in/out -> Pointer<Void>
// nativeStart : LONGLONG -> Int64
// nativeLimit : LONGLONG -> Int64
// destIndex : LONGLONG -> Int64
// move : CHAR -> Int8
// status : UErrorCode* in/out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure utext_copy(
  ut: Pointer;   // UText* in/out
  nativeStart: Int64;   // LONGLONG
  nativeLimit: Int64;   // LONGLONG
  destIndex: Int64;   // LONGLONG
  move: Shortint;   // CHAR
  status: Pointer   // UErrorCode* in/out
); cdecl;
  external 'icuuc.dll' name 'utext_copy';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "utext_copy"
  c_utext_copy :: Ptr () -> Int64 -> Int64 -> Int64 -> Int8 -> Ptr Int32 -> IO ()
-- ut : UText* in/out -> Ptr ()
-- nativeStart : LONGLONG -> Int64
-- nativeLimit : LONGLONG -> Int64
-- destIndex : LONGLONG -> Int64
-- move : CHAR -> Int8
-- status : UErrorCode* in/out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let utext_copy =
  foreign "utext_copy"
    ((ptr void) @-> int64_t @-> int64_t @-> int64_t @-> int8_t @-> (ptr int32_t) @-> returning void)
(* ut : UText* in/out -> (ptr void) *)
(* nativeStart : LONGLONG -> int64_t *)
(* nativeLimit : LONGLONG -> int64_t *)
(* destIndex : LONGLONG -> int64_t *)
(* move : CHAR -> int8_t *)
(* status : UErrorCode* in/out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)

(cffi:defcfun ("utext_copy" utext-copy :convention :cdecl) :void
  (ut :pointer)   ; UText* in/out
  (native-start :int64)   ; LONGLONG
  (native-limit :int64)   ; LONGLONG
  (dest-index :int64)   ; LONGLONG
  (move :int8)   ; CHAR
  (status :pointer))   ; UErrorCode* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $utext_copy = Win32::API::More->new('icuuc',
    'void utext_copy(LPVOID ut, INT64 nativeStart, INT64 nativeLimit, INT64 destIndex, char move, LPVOID status)');
# my $ret = $utext_copy->Call($ut, $nativeStart, $nativeLimit, $destIndex, $move, $status);
# ut : UText* in/out -> LPVOID
# nativeStart : LONGLONG -> INT64
# nativeLimit : LONGLONG -> INT64
# destIndex : LONGLONG -> INT64
# move : CHAR -> char
# status : UErrorCode* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型