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

utext_clone

関数
UTextオブジェクトを複製する。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

UText* utext_clone(
    UText* dest,
    const UText* src,
    CHAR deep,
    CHAR readOnly,
    UErrorCode* status
);

パラメーター

名前方向
destUText*inout
srcUText*in
deepCHARin
readOnlyCHARin
statusUErrorCode*inout

戻り値の型: UText*

各言語での呼び出し定義

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

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

utext_clone = ctypes.cdll.icuuc.utext_clone
utext_clone.restype = ctypes.c_void_p
utext_clone.argtypes = [
    ctypes.c_void_p,  # dest : UText* in/out
    ctypes.c_void_p,  # src : UText*
    ctypes.c_byte,  # deep : CHAR
    ctypes.c_byte,  # readOnly : CHAR
    ctypes.c_void_p,  # status : UErrorCode* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procutext_clone = icuuc.NewProc("utext_clone")
)

// dest (UText* in/out), src (UText*), deep (CHAR), readOnly (CHAR), status (UErrorCode* in/out)
r1, _, err := procutext_clone.Call(
	uintptr(dest),
	uintptr(src),
	uintptr(deep),
	uintptr(readOnly),
	uintptr(status),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // UText*
function utext_clone(
  dest: Pointer;   // UText* in/out
  src: Pointer;   // UText*
  deep: Shortint;   // CHAR
  readOnly: Shortint;   // CHAR
  status: Pointer   // UErrorCode* in/out
): Pointer; cdecl;
  external 'icuuc.dll' name 'utext_clone';
result := DllCall("icuuc\utext_clone"
    , "Ptr", dest   ; UText* in/out
    , "Ptr", src   ; UText*
    , "Char", deep   ; CHAR
    , "Char", readOnly   ; CHAR
    , "Ptr", status   ; UErrorCode* in/out
    , "Cdecl Ptr")   ; return: UText*
●utext_clone(dest, src, deep, readOnly, status) = DLL("icuuc.dll", "void* utext_clone(void*, void*, char, char, void*)")
# 呼び出し: utext_clone(dest, src, deep, readOnly, status)
# dest : UText* in/out -> "void*"
# src : UText* -> "void*"
# deep : CHAR -> "char"
# readOnly : CHAR -> "char"
# status : UErrorCode* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。