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

ucnv_resetFromUnicode

関数
変換器のUnicode方向からの変換状態をリセットする。
DLLicuuc.dll呼出規約cdecl

シグネチャ

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

void ucnv_resetFromUnicode(
    UConverter* converter
);

パラメーター

名前方向説明
converterUConverter*inoutUnicode→外部符号化方向の状態をリセットする対象のコンバーターへのポインタ。

戻り値の型: void

各言語での呼び出し定義

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

void ucnv_resetFromUnicode(
    UConverter* converter
);
[DllImport("icuuc.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void ucnv_resetFromUnicode(
    ref IntPtr converter   // UConverter* in/out
);
<DllImport("icuuc.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub ucnv_resetFromUnicode(
    ByRef converter As IntPtr   ' UConverter* in/out
)
End Sub
' converter : UConverter* in/out
Declare PtrSafe Sub ucnv_resetFromUnicode Lib "icuuc" ( _
    ByRef converter As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ucnv_resetFromUnicode = ctypes.cdll.icuuc.ucnv_resetFromUnicode
ucnv_resetFromUnicode.restype = None
ucnv_resetFromUnicode.argtypes = [
    ctypes.c_void_p,  # converter : UConverter* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuuc.dll')
ucnv_resetFromUnicode = Fiddle::Function.new(
  lib['ucnv_resetFromUnicode'],
  [
    Fiddle::TYPE_VOIDP,  # converter : UConverter* in/out
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuuc")]
extern "C" {
    fn ucnv_resetFromUnicode(
        converter: *mut isize  // UConverter* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuuc.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void ucnv_resetFromUnicode(ref IntPtr converter);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuuc_ucnv_resetFromUnicode' -Namespace Win32 -PassThru
# $api::ucnv_resetFromUnicode(converter)
#uselib "icuuc.dll"
#func global ucnv_resetFromUnicode "ucnv_resetFromUnicode" sptr
; ucnv_resetFromUnicode varptr(converter)
; converter : UConverter* in/out -> "sptr"
出力引数:
#uselib "icuuc.dll"
#func global ucnv_resetFromUnicode "ucnv_resetFromUnicode" var
; ucnv_resetFromUnicode converter
; converter : UConverter* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void ucnv_resetFromUnicode(UConverter* converter)
#uselib "icuuc.dll"
#func global ucnv_resetFromUnicode "ucnv_resetFromUnicode" var
; ucnv_resetFromUnicode converter
; converter : UConverter* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuuc = windows.NewLazySystemDLL("icuuc.dll")
	procucnv_resetFromUnicode = icuuc.NewProc("ucnv_resetFromUnicode")
)

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

typedef ucnv_resetFromUnicodeNative = Void Function(Pointer<IntPtr>);
typedef ucnv_resetFromUnicodeDart = void Function(Pointer<IntPtr>);
final ucnv_resetFromUnicode = DynamicLibrary.open('icuuc.dll')
    .lookupFunction<ucnv_resetFromUnicodeNative, ucnv_resetFromUnicodeDart>('ucnv_resetFromUnicode');
// converter : UConverter* in/out -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure ucnv_resetFromUnicode(
  converter: Pointer   // UConverter* in/out
); cdecl;
  external 'icuuc.dll' name 'ucnv_resetFromUnicode';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import ccall safe "ucnv_resetFromUnicode"
  c_ucnv_resetFromUnicode :: Ptr CIntPtr -> IO ()
-- converter : UConverter* in/out -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let ucnv_resetfromunicode =
  foreign "ucnv_resetFromUnicode"
    ((ptr intptr_t) @-> returning void)
(* converter : UConverter* in/out -> (ptr intptr_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library icuuc (t "icuuc.dll"))
(cffi:use-foreign-library icuuc)

(cffi:defcfun ("ucnv_resetFromUnicode" ucnv-reset-from-unicode :convention :cdecl) :void
  (converter :pointer))   ; UConverter* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ucnv_resetFromUnicode = Win32::API::More->new('icuuc',
    'void ucnv_resetFromUnicode(LPVOID converter)');
# my $ret = $ucnv_resetFromUnicode->Call($converter);
# converter : UConverter* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。