2000-01-05 19:40:01 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-01-13 23:54:23 +00:00
|
|
|
*
|
2004-04-16 05:47:01 +00:00
|
|
|
* Copyright (C) 1998-2004, International Business Machines
|
2000-01-13 23:54:23 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-01-05 19:40:01 +00:00
|
|
|
*
|
|
|
|
* File ustdio.h
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 10/16/98 stephen Creation.
|
|
|
|
* 11/06/98 stephen Modified per code review.
|
|
|
|
* 03/12/99 stephen Modified for new C API.
|
|
|
|
* 07/19/99 stephen Minor doc update.
|
2001-02-06 20:31:28 +00:00
|
|
|
* 02/01/01 george Added sprintf & sscanf with all of its variants
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef USTDIO_H
|
|
|
|
#define USTDIO_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
2000-08-28 21:36:13 +00:00
|
|
|
#include "unicode/ucnv.h"
|
2002-03-13 16:11:04 +00:00
|
|
|
#include "unicode/utrans.h"
|
2000-01-05 19:40:01 +00:00
|
|
|
|
2001-02-06 20:31:28 +00:00
|
|
|
/*
|
2002-04-11 00:11:47 +00:00
|
|
|
TODO
|
2001-02-06 20:31:28 +00:00
|
|
|
The following is a small list as to what is currently wrong/suggestions for
|
|
|
|
ustdio.
|
|
|
|
|
|
|
|
* %p should be deprecated. Pointers are 2-16 bytes big and scanf should
|
|
|
|
really read them.
|
2001-02-12 18:29:01 +00:00
|
|
|
* The format specification should use int32_t and ICU type variants instead of
|
|
|
|
the compiler dependent int.
|
|
|
|
* Make sure that #, blank and precision in the printf format specification
|
|
|
|
works.
|
|
|
|
* Make sure that * in the scanf format specification works.
|
2004-04-16 05:47:01 +00:00
|
|
|
* Each UFILE takes up at least 2KB.
|
|
|
|
Look into adding setvbuf() for configurable buffers.
|
2001-02-12 18:29:01 +00:00
|
|
|
* This library does buffering. The OS should do this for us already. Check on
|
|
|
|
this, and remove it from this library, if this is the case. Double buffering
|
|
|
|
wastes a lot of time and space.
|
2002-08-26 20:53:53 +00:00
|
|
|
* Make sure that surrogates are supported. It doesn't look like %[], %s or %U
|
|
|
|
properly handle surrogates in both scanf()'s.
|
2001-02-20 17:00:26 +00:00
|
|
|
* Testing should be done for reading and writing multi-byte encodings,
|
|
|
|
and make sure that a character that is contained across buffer boundries
|
|
|
|
works even for incomplete characters.
|
|
|
|
* Make sure that the last character is flushed when the file/string is closed.
|
2002-03-14 23:12:31 +00:00
|
|
|
* snprintf should follow the C99 standard for the return value, which is
|
|
|
|
return the number of characters (excluding the trailing '\0')
|
|
|
|
which would have been written to the destination string regardless
|
|
|
|
of available space. This is like pre-flighting.
|
2002-04-01 22:58:01 +00:00
|
|
|
* Everything that uses %s should do what operator>> does for UnicodeString.
|
|
|
|
It should convert one byte at a time, and once a character is
|
|
|
|
converted then check to see if it's whitespace or in the scanset.
|
|
|
|
If it's whitespace or in the scanset, put all the bytes back (do nothing
|
|
|
|
for sprintf/sscanf).
|
|
|
|
* If bad string data is encountered, make sure that the function fails
|
|
|
|
without memory leaks and the unconvertable characters are valid
|
|
|
|
substitution or are escaped characters.
|
2002-03-27 19:27:50 +00:00
|
|
|
* u_fungetc() can't unget a character when it's at the beginning of the
|
|
|
|
internal conversion buffer, and it shouldn't be writing new
|
|
|
|
characters to this buffer because they might be different characters.
|
|
|
|
This can be tested by writing a file, and reading it backwards by
|
|
|
|
using u_fgetc and two u_fungetc() calls with incorrect data.
|
2002-03-27 20:08:42 +00:00
|
|
|
FYI The behavior is undefined for ungetc() when an incorrect character
|
|
|
|
is put back, when its called multiple times in a row, or when
|
|
|
|
a its called without a read operation.
|
2002-03-15 00:25:57 +00:00
|
|
|
* u_fflush() and u_fclose should return an int32_t like C99 functions.
|
2002-08-26 20:53:53 +00:00
|
|
|
0 is returned if the operation was successful and EOF otherwise.
|
2002-04-11 00:11:47 +00:00
|
|
|
* u_fsettransliterator does not support U_READ side of transliteration.
|
2002-04-22 16:05:38 +00:00
|
|
|
* The format specifier should limit the size of a format or honor it in
|
2003-10-02 17:06:22 +00:00
|
|
|
order to prevent buffer overruns. (e.g. %256.256d).
|
2002-08-26 20:53:53 +00:00
|
|
|
* u_fread and u_fwrite don't exist. They're needed for reading and writing
|
|
|
|
data structures without any conversion.
|
|
|
|
* u_file_read and u_file_write are used for writing strings. u_fgets and
|
|
|
|
u_fputs or u_fread and u_fwrite should be used to do this.
|
2003-10-10 20:55:24 +00:00
|
|
|
* u_fgetcx may not be needed anymore. Maybe u_fgetc should return a UChar32.
|
2003-10-11 02:16:12 +00:00
|
|
|
* u_fgetc() should use UChar32 instead of UChar. Maybe u_fgetcx is good enough
|
|
|
|
for now.
|
2002-08-26 20:53:53 +00:00
|
|
|
* We should consider using a UnicodeSet for scanset.
|
|
|
|
* scanset has a buffer overflow and underflow bug for both string and file
|
|
|
|
APIs.
|
2003-10-02 17:06:22 +00:00
|
|
|
* The width parameter for all scanf formats, including scanset, needs
|
2002-08-26 20:53:53 +00:00
|
|
|
better testing. This prevents buffer overflows.
|
2003-10-02 17:06:22 +00:00
|
|
|
* The skip '*' parameter for all scanf formats, including scanset, needs
|
|
|
|
better testing. This prevents writing to bad memory.
|
2003-10-11 02:16:12 +00:00
|
|
|
* Figure out what is suppose to happen when a codepage is changed midstream.
|
|
|
|
Maybe a flush or a rewind are good enough.
|
2004-05-03 06:41:58 +00:00
|
|
|
* Make sure that a UFile opened with "rw" can be used after using
|
|
|
|
u_fflush with a u_frewind.
|
2004-05-11 20:36:27 +00:00
|
|
|
* Test stdin and stdout with the u_f* functions
|
2002-04-01 22:58:01 +00:00
|
|
|
* More testing is needed.
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
|
2000-01-05 19:40:01 +00:00
|
|
|
|
2002-12-12 00:37:41 +00:00
|
|
|
/**
|
|
|
|
* When an end of file is encountered, this value can be returned.
|
|
|
|
* @see u_fgetc
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2002-12-12 00:37:41 +00:00
|
|
|
*/
|
2000-01-28 22:40:27 +00:00
|
|
|
#define U_EOF 0xFFFF
|
|
|
|
|
2004-05-20 05:34:23 +00:00
|
|
|
/** Forward declaration of a Unicode-aware file @draft 3.0 */
|
2000-01-05 19:40:01 +00:00
|
|
|
typedef struct UFILE UFILE;
|
|
|
|
|
2002-12-12 00:37:41 +00:00
|
|
|
/**
|
|
|
|
* Enum for which direction of stream a transliterator applies to.
|
|
|
|
* @see u_fsettransliterator
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2002-12-12 00:37:41 +00:00
|
|
|
*/
|
2002-03-13 16:11:04 +00:00
|
|
|
typedef enum {
|
2002-12-12 00:37:41 +00:00
|
|
|
U_READ = 1,
|
|
|
|
U_WRITE = 2,
|
2002-03-13 16:11:04 +00:00
|
|
|
U_READWRITE =3 /* == (U_READ | U_WRITE) */
|
|
|
|
} UFileDirection;
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Open a UFILE.
|
|
|
|
* A UFILE is a wrapper around a FILE* that is locale and codepage aware.
|
|
|
|
* That is, data written to a UFILE will be formatted using the conventions
|
|
|
|
* specified by that UFILE's Locale; this data will be in the character set
|
|
|
|
* specified by that UFILE's codepage.
|
|
|
|
* @param filename The name of the file to open.
|
|
|
|
* @param perm The read/write permission for the UFILE; one of "r", "w", "rw"
|
|
|
|
* @param locale The locale whose conventions will be used to format
|
|
|
|
* and parse output. If this parameter is NULL, the default locale will
|
|
|
|
* be used.
|
|
|
|
* @param codepage The codepage in which data will be written to and
|
|
|
|
* read from the file. If this paramter is NULL, data will be written and
|
|
|
|
* read using the default codepage for <TT>locale</TT>, unless <TT>locale</TT>
|
|
|
|
* is NULL, in which case the system default codepage will be used.
|
2002-03-27 20:08:42 +00:00
|
|
|
* @return A new UFILE, or NULL if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI UFILE* U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_fopen(const char *filename,
|
|
|
|
const char *perm,
|
|
|
|
const char *locale,
|
|
|
|
const char *codepage);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Open a UFILE on top of an existing FILE* stream.
|
|
|
|
* @param f The FILE* to which this UFILE will attach.
|
|
|
|
* @param locale The locale whose conventions will be used to format
|
|
|
|
* and parse output. If this parameter is NULL, the default locale will
|
|
|
|
* be used.
|
|
|
|
* @param codepage The codepage in which data will be written to and
|
|
|
|
* read from the file. If this paramter is NULL, data will be written and
|
|
|
|
* read using the default codepage for <TT>locale</TT>, unless <TT>locale</TT>
|
|
|
|
* is NULL, in which case the system default codepage will be used.
|
2002-03-27 20:08:42 +00:00
|
|
|
* @return A new UFILE, or NULL if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI UFILE* U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_finit(FILE *f,
|
|
|
|
const char *locale,
|
|
|
|
const char *codepage);
|
|
|
|
|
2004-05-10 03:59:44 +00:00
|
|
|
/**
|
|
|
|
* Create a UFILE that can be used for localized formatting or parsing.
|
|
|
|
* The u_sprintf and u_sscanf functions do not read or write numbers for a
|
|
|
|
* specific locale. The ustdio.h file functions can be used on this UFILE.
|
|
|
|
* The string is usable once u_fclose or u_fflush has been called on the
|
|
|
|
* returned UFILE.
|
|
|
|
* @param stringBuf The string used for reading or writing.
|
|
|
|
* @param count The number of code units available for use in stringBuf
|
|
|
|
* @param locale The locale whose conventions will be used to format
|
|
|
|
* and parse output. If this parameter is NULL, the default locale will
|
|
|
|
* be used.
|
|
|
|
* @return A new UFILE, or NULL if an error occurred.
|
|
|
|
* @draft 3.0
|
|
|
|
*/
|
|
|
|
U_CAPI UFILE* U_EXPORT2
|
|
|
|
u_fstropen(UChar *stringBuf,
|
|
|
|
int32_t capacity,
|
|
|
|
const char *locale);
|
|
|
|
|
2000-01-05 19:40:01 +00:00
|
|
|
/**
|
|
|
|
* Close a UFILE.
|
|
|
|
* @param file The UFILE to close.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI void U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_fclose(UFILE *file);
|
|
|
|
|
2004-04-16 05:47:01 +00:00
|
|
|
/**
|
|
|
|
* Tests if the UFILE is at the end of the file stream.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @return Returns TRUE after the first read operation that attempts to
|
|
|
|
* read past the end of the file. It returns FALSE if the current position is
|
|
|
|
* not end of file.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2004-04-16 05:47:01 +00:00
|
|
|
*/
|
|
|
|
U_CAPI UBool U_EXPORT2
|
|
|
|
u_feof(UFILE *f);
|
|
|
|
|
2002-03-13 16:11:04 +00:00
|
|
|
/**
|
|
|
|
* Flush output of a UFILE. Implies a flush of
|
|
|
|
* converter/transliterator state. (That is, a logical break is
|
|
|
|
* made in the output stream - for example if a different type of
|
|
|
|
* output is desired.) The underlying OS level file is also flushed.
|
|
|
|
* @param file The UFILE to flush.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2002-03-13 16:11:04 +00:00
|
|
|
*/
|
|
|
|
U_CAPI void U_EXPORT2
|
2002-04-04 23:59:01 +00:00
|
|
|
u_fflush(UFILE *file);
|
2002-03-13 16:11:04 +00:00
|
|
|
|
2003-10-11 02:16:12 +00:00
|
|
|
/**
|
|
|
|
* Rewind the file pointer to the beginning of the file.
|
|
|
|
* @param file The UFILE to rewind.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2003-10-11 02:16:12 +00:00
|
|
|
*/
|
|
|
|
U_CAPI void
|
|
|
|
u_frewind(UFILE *file);
|
|
|
|
|
2000-01-05 19:40:01 +00:00
|
|
|
/**
|
|
|
|
* Get the FILE* associated with a UFILE.
|
|
|
|
* @param f The UFILE
|
|
|
|
* @return A FILE*, owned by the UFILE. The FILE <EM>must not</EM> be closed.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI FILE* U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_fgetfile(UFILE *f);
|
|
|
|
|
2002-10-01 01:26:49 +00:00
|
|
|
#if !UCONFIG_NO_FORMATTING
|
|
|
|
|
2000-01-05 19:40:01 +00:00
|
|
|
/**
|
|
|
|
* Get the locale whose conventions are used to format and parse output.
|
|
|
|
* This is the same locale passed in the preceding call to<TT>u_fsetlocale</TT>
|
|
|
|
* or <TT>u_fopen</TT>.
|
|
|
|
* @param file The UFILE to set.
|
|
|
|
* @return The locale whose conventions are used to format and parse output.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI const char* U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_fgetlocale(UFILE *file);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the locale whose conventions will be used to format and parse output.
|
|
|
|
* @param locale The locale whose conventions will be used to format
|
|
|
|
* and parse output.
|
|
|
|
* @param file The UFILE to query.
|
2002-03-27 20:08:42 +00:00
|
|
|
* @return NULL if successful, otherwise a negative number.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2004-05-20 05:34:23 +00:00
|
|
|
u_fsetlocale(UFILE *file,
|
|
|
|
const char *locale);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
2002-10-01 01:26:49 +00:00
|
|
|
#endif
|
|
|
|
|
2000-01-05 19:40:01 +00:00
|
|
|
/**
|
|
|
|
* Get the codepage in which data is written to and read from the UFILE.
|
|
|
|
* This is the same codepage passed in the preceding call to
|
|
|
|
* <TT>u_fsetcodepage</TT> or <TT>u_fopen</TT>.
|
|
|
|
* @param file The UFILE to query.
|
|
|
|
* @return The codepage in which data is written to and read from the UFILE,
|
2002-03-27 20:08:42 +00:00
|
|
|
* or NULL if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI const char* U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_fgetcodepage(UFILE *file);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the codepage in which data will be written to and read from the UFILE.
|
|
|
|
* All Unicode data written to the UFILE will be converted to this codepage
|
2003-10-11 02:16:12 +00:00
|
|
|
* before it is written to the underlying FILE*. It it generally a bad idea to
|
|
|
|
* mix codepages within a file. This should only be called right
|
|
|
|
* after opening the <TT>UFile</TT>, or after calling <TT>u_frewind</TT>.
|
2000-01-05 19:40:01 +00:00
|
|
|
* @param codepage The codepage in which data will be written to
|
|
|
|
* and read from the file. For example <TT>"latin-1"</TT> or <TT>"ibm-943</TT>.
|
|
|
|
* A value of NULL means the default codepage for the UFILE's current
|
|
|
|
* locale will be used.
|
|
|
|
* @param file The UFILE to set.
|
2003-10-11 02:16:12 +00:00
|
|
|
* @return 0 if successful, otherwise a negative number.
|
|
|
|
* @see u_frewind
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fsetcodepage(const char *codepage,
|
|
|
|
UFILE *file);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an alias to the converter being used for this file.
|
|
|
|
* @param file The UFILE to set.
|
|
|
|
* @return alias to the converter
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2001-11-21 01:22:16 +00:00
|
|
|
U_CAPI UConverter* U_EXPORT2 u_fgetConverter(UFILE *f);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/* Output functions */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a UFILE.
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @return The number of Unicode characters written to <TT>f</TT>.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fprintf(UFILE *f,
|
|
|
|
const char *patternSpecification,
|
|
|
|
... );
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a UFILE.
|
|
|
|
* This is identical to <TT>u_fprintf</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of Unicode characters written to <TT>f</TT>.
|
|
|
|
* @see u_fprintf
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_vfprintf(UFILE *f,
|
|
|
|
const char *patternSpecification,
|
|
|
|
va_list ap);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a UFILE.
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @return The number of Unicode characters written to <TT>f</TT>.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fprintf_u(UFILE *f,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
... );
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a UFILE.
|
|
|
|
* This is identical to <TT>u_fprintf_u</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of Unicode characters written to <TT>f</TT>.
|
|
|
|
* @see u_fprintf_u
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_vfprintf_u(UFILE *f,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
va_list ap);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write a Unicode to a UFILE. The null (U+0000) terminated UChar*
|
|
|
|
* <TT>s</TT> will be written to <TT>f</TT>, excluding the NULL terminator.
|
|
|
|
* A newline will be added to <TT>f</TT>.
|
|
|
|
* @param s The UChar* to write.
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @return A non-negative number if successful, EOF otherwise.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fputs(const UChar *s,
|
|
|
|
UFILE *f);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write a UChar to a UFILE.
|
|
|
|
* @param uc The UChar to write.
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @return The character written if successful, EOF otherwise.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fputc(UChar uc,
|
|
|
|
UFILE *f);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write Unicode to a UFILE.
|
|
|
|
* The ustring passed in will be converted to the UFILE's underlying
|
|
|
|
* codepage before it is written.
|
2003-10-11 02:16:12 +00:00
|
|
|
* @param ustring A pointer to the Unicode data to write.
|
2000-01-05 19:40:01 +00:00
|
|
|
* @param count The number of Unicode characters to write
|
|
|
|
* @param f The UFILE to which to write.
|
|
|
|
* @return The number of Unicode characters written.
|
2003-10-11 02:16:12 +00:00
|
|
|
* @see u_fputs
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-11 02:16:12 +00:00
|
|
|
u_file_write(const UChar *ustring,
|
2003-10-10 20:55:24 +00:00
|
|
|
int32_t count,
|
|
|
|
UFILE *f);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Input functions */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a UFILE.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fscanf(UFILE *f,
|
|
|
|
const char *patternSpecification,
|
|
|
|
... );
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a UFILE.
|
|
|
|
* This is identical to <TT>u_fscanf</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
|
|
|
* @see u_fscanf
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_vfscanf(UFILE *f,
|
|
|
|
const char *patternSpecification,
|
|
|
|
va_list ap);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a UFILE.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fscanf_u(UFILE *f,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
... );
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a UFILE.
|
|
|
|
* This is identical to <TT>u_fscanf_u</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_fscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
|
|
|
* @see u_fscanf_u
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_vfscanf_u(UFILE *f,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
va_list ap);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
2002-03-27 20:08:42 +00:00
|
|
|
* Read one line of text into a UChar* string from a UFILE. The newline
|
|
|
|
* at the end of the line is read into the string. The string is always
|
|
|
|
* null terminated
|
2000-01-05 19:40:01 +00:00
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @param n The maximum number of characters - 1 to read.
|
|
|
|
* @param s The UChar* to receive the read data. Characters will be
|
|
|
|
* stored successively in <TT>s</TT> until a newline or EOF is
|
2002-03-27 20:08:42 +00:00
|
|
|
* reached. A null character (U+0000) will be appended to <TT>s</TT>.
|
|
|
|
* @return A pointer to <TT>s</TT>, or NULL if no characters were available.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI UChar* U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fgets(UChar *s,
|
|
|
|
int32_t n,
|
|
|
|
UFILE *f);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read a UChar from a UFILE.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @return The UChar value read, or U+FFFF if no character was available.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI UChar U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fgetc(UFILE *f);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
2000-07-16 13:43:15 +00:00
|
|
|
/**
|
2003-10-10 20:55:24 +00:00
|
|
|
* Read a UChar32 from a UFILE.
|
|
|
|
*
|
2000-07-16 13:43:15 +00:00
|
|
|
* @param f The UFILE from which to read.
|
2003-10-10 20:55:24 +00:00
|
|
|
* @return The UChar32 value read, or U_EOF if no character was
|
|
|
|
* available, or U+FFFFFFFF if an ill-formed character was
|
2000-07-16 13:43:15 +00:00
|
|
|
* encountered.
|
|
|
|
* @see u_unescape()
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-07-16 13:43:15 +00:00
|
|
|
*/
|
|
|
|
U_CAPI UChar32 U_EXPORT2
|
2003-10-10 20:55:24 +00:00
|
|
|
u_fgetcx(UFILE *f);
|
2000-07-16 13:43:15 +00:00
|
|
|
|
2000-01-05 19:40:01 +00:00
|
|
|
/**
|
|
|
|
* Unget a UChar from a UFILE.
|
|
|
|
* If this function is not the first to operate on <TT>f</TT> after a call
|
|
|
|
* to <TT>u_fgetc</TT>, the results are undefined.
|
|
|
|
* @param c The UChar to put back on the stream.
|
|
|
|
* @param f The UFILE to receive <TT>c</TT>.
|
2003-10-10 20:55:24 +00:00
|
|
|
* @return The UChar32 value put back if successful, U_EOF otherwise.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2003-10-10 20:55:24 +00:00
|
|
|
U_CAPI UChar32 U_EXPORT2
|
|
|
|
u_fungetc(UChar32 c,
|
2000-01-05 19:40:01 +00:00
|
|
|
UFILE *f);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read Unicode from a UFILE.
|
|
|
|
* Bytes will be converted from the UFILE's underlying codepage, with
|
2003-10-11 02:16:12 +00:00
|
|
|
* subsequent conversion to Unicode. The data will not be NULL terminated.
|
2000-01-05 19:40:01 +00:00
|
|
|
* @param chars A pointer to receive the Unicode data.
|
|
|
|
* @param count The number of Unicode characters to read.
|
|
|
|
* @param f The UFILE from which to read.
|
|
|
|
* @return The number of Unicode characters read.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2000-01-05 19:40:01 +00:00
|
|
|
*/
|
2000-01-17 19:07:59 +00:00
|
|
|
U_CAPI int32_t U_EXPORT2
|
2000-01-05 19:40:01 +00:00
|
|
|
u_file_read(UChar *chars,
|
|
|
|
int32_t count,
|
|
|
|
UFILE *f);
|
|
|
|
|
2002-10-01 01:26:49 +00:00
|
|
|
#if !UCONFIG_NO_TRANSLITERATION
|
|
|
|
|
2002-03-14 23:12:31 +00:00
|
|
|
/**
|
|
|
|
* Set a transliterator on the UFILE. The transliterator will be owned by the
|
|
|
|
* UFILE.
|
|
|
|
* @param file The UFILE to set transliteration on
|
|
|
|
* @param adopt The UTransliterator to set. Can be NULL, which will
|
|
|
|
* mean that no transliteration is used.
|
|
|
|
* @param direction either U_READ, U_WRITE, or U_READWRITE - sets
|
|
|
|
* which direction the transliterator is to be applied to. If
|
|
|
|
* U_READWRITE, the "Read" transliteration will be in the inverse
|
|
|
|
* direction.
|
|
|
|
* @param status ICU error code.
|
|
|
|
* @return The previously set transliterator, owned by the
|
|
|
|
* caller. If U_READWRITE is specified, only the WRITE transliterator
|
|
|
|
* is returned. In most cases, the caller should call utrans_close()
|
|
|
|
* on the result of this function.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2002-03-14 23:12:31 +00:00
|
|
|
*/
|
|
|
|
U_CAPI UTransliterator* U_EXPORT2
|
|
|
|
u_fsettransliterator(UFILE *file, UFileDirection direction,
|
2002-04-02 01:17:28 +00:00
|
|
|
UTransliterator *adopt, UErrorCode *status);
|
2000-01-05 19:40:01 +00:00
|
|
|
|
2002-10-01 01:26:49 +00:00
|
|
|
#endif
|
2001-02-06 20:31:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Output string functions */
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode String to which to write.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @return The number of Unicode code units written to <TT>buffer</TT>. This
|
|
|
|
* does not include the terminating null character.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
u_sprintf(UChar *buffer,
|
|
|
|
const char *patternSpecification,
|
|
|
|
... );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string. When the number of code units
|
|
|
|
* required to store the data exceeds <TT>count</TT>, then <TT>count</TT> code
|
|
|
|
* units of data are stored in <TT>buffer</TT> and a negative value is
|
|
|
|
* returned. When the number of code units required to store the data equals
|
|
|
|
* <TT>count</TT>, the string is not null terminated and <TT>count</TT> is
|
|
|
|
* returned.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode String to which to write.
|
|
|
|
* @param count The number of code units to read.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @return The number of Unicode code units written to <TT>buffer</TT>. This
|
|
|
|
* does not include the terminating null character.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
u_snprintf(UChar *buffer,
|
|
|
|
int32_t count,
|
|
|
|
const char *patternSpecification,
|
|
|
|
... );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string.
|
|
|
|
* This is identical to <TT>u_sprintf</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string to which to write.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of Unicode characters written to <TT>buffer</TT>.
|
|
|
|
* @see u_sprintf
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
u_vsprintf(UChar *buffer,
|
|
|
|
const char *patternSpecification,
|
|
|
|
va_list ap);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string.
|
|
|
|
* This is identical to <TT>u_snprintf</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.<br><br>
|
|
|
|
* When the number of code units required to store the data exceeds
|
|
|
|
* <TT>count</TT>, then <TT>count</TT> code units of data are stored in
|
|
|
|
* <TT>buffer</TT> and a negative value is returned. When the number of code
|
|
|
|
* units required to store the data equals <TT>count</TT>, the string is not
|
|
|
|
* null terminated and <TT>count</TT> is returned.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string to which to write.
|
|
|
|
* @param count The number of code units to read.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of Unicode characters written to <TT>buffer</TT>.
|
|
|
|
* @see u_sprintf
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
u_vsnprintf(UChar *buffer,
|
|
|
|
int32_t count,
|
|
|
|
const char *patternSpecification,
|
|
|
|
va_list ap);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string to which to write.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @return The number of Unicode characters written to <TT>buffer</TT>.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
u_sprintf_u(UChar *buffer,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
... );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string. When the number of code units
|
|
|
|
* required to store the data exceeds <TT>count</TT>, then <TT>count</TT> code
|
|
|
|
* units of data are stored in <TT>buffer</TT> and a negative value is
|
|
|
|
* returned. When the number of code units required to store the data equals
|
|
|
|
* <TT>count</TT>, the string is not null terminated and <TT>count</TT> is
|
|
|
|
* returned.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string to which to write.
|
|
|
|
* @param count The number of code units to read.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @return The number of Unicode characters written to <TT>buffer</TT>.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
2001-02-12 18:29:01 +00:00
|
|
|
u_snprintf_u(UChar *buffer,
|
|
|
|
int32_t count,
|
2001-02-06 20:31:28 +00:00
|
|
|
const UChar *patternSpecification,
|
|
|
|
... );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string.
|
|
|
|
* This is identical to <TT>u_sprintf_u</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string to which to write.
|
|
|
|
* @param count The number of code units to read.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of Unicode characters written to <TT>f</TT>.
|
|
|
|
* @see u_sprintf_u
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
|
|
|
u_vsprintf_u(UChar *buffer,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
va_list ap);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write formatted data to a Unicode string.
|
|
|
|
* This is identical to <TT>u_snprintf_u</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
* When the number of code units required to store the data exceeds
|
|
|
|
* <TT>count</TT>, then <TT>count</TT> code units of data are stored in
|
|
|
|
* <TT>buffer</TT> and a negative value is returned. When the number of code
|
|
|
|
* units required to store the data equals <TT>count</TT>, the string is not
|
|
|
|
* null terminated and <TT>count</TT> is returned.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string to which to write.
|
|
|
|
* @param locale The locale to use for formatting the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sprintf</TT> will
|
|
|
|
* interpret the variable arguments received and format the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of Unicode characters written to <TT>f</TT>.
|
|
|
|
* @see u_sprintf_u
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
2002-08-01 01:46:19 +00:00
|
|
|
u_vsnprintf_u(UChar *buffer,
|
2001-02-12 18:29:01 +00:00
|
|
|
int32_t count,
|
|
|
|
const UChar *patternSpecification,
|
|
|
|
va_list ap);
|
2001-02-06 20:31:28 +00:00
|
|
|
|
|
|
|
/* Input string functions */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a Unicode string.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string from which to read.
|
|
|
|
* @param locale The locale to use for parsing the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
2002-08-01 01:46:19 +00:00
|
|
|
u_sscanf(const UChar *buffer,
|
2001-02-06 20:31:28 +00:00
|
|
|
const char *patternSpecification,
|
|
|
|
... );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a Unicode string.
|
|
|
|
* This is identical to <TT>u_sscanf</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string from which to read.
|
|
|
|
* @param locale The locale to use for parsing the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
|
|
|
* @see u_sscanf
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
2002-08-01 01:46:19 +00:00
|
|
|
u_vsscanf(const UChar *buffer,
|
2001-02-06 20:31:28 +00:00
|
|
|
const char *patternSpecification,
|
|
|
|
va_list ap);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a Unicode string.
|
|
|
|
*
|
|
|
|
* @param buffer The Unicode string from which to read.
|
|
|
|
* @param locale The locale to use for parsing the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
2002-08-01 01:46:19 +00:00
|
|
|
u_sscanf_u(const UChar *buffer,
|
2001-02-06 20:31:28 +00:00
|
|
|
const UChar *patternSpecification,
|
|
|
|
... );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read formatted data from a Unicode string.
|
|
|
|
* This is identical to <TT>u_sscanf_u</TT>, except that it will
|
|
|
|
* <EM>not</EM> call <TT>va_start/TT> and <TT>va_end</TT>.
|
|
|
|
*
|
2004-05-11 20:36:27 +00:00
|
|
|
* @param buffer The Unicode string from which to read.
|
2001-02-06 20:31:28 +00:00
|
|
|
* @param locale The locale to use for parsing the numbers, dates and other
|
|
|
|
* locale specific information.
|
|
|
|
* @param patternSpecification A pattern specifying how <TT>u_sscanf</TT> will
|
|
|
|
* interpret the variable arguments received and parse the data.
|
|
|
|
* @param ap The argument list to use.
|
|
|
|
* @return The number of items successfully converted and assigned, or EOF
|
|
|
|
* if an error occurred.
|
|
|
|
* @see u_sscanf_u
|
2004-05-20 05:34:23 +00:00
|
|
|
* @draft 3.0
|
2001-02-06 20:31:28 +00:00
|
|
|
*/
|
|
|
|
U_CAPI int32_t U_EXPORT2
|
2002-08-01 01:46:19 +00:00
|
|
|
u_vsscanf_u(const UChar *buffer,
|
2001-02-06 20:31:28 +00:00
|
|
|
const UChar *patternSpecification,
|
|
|
|
va_list ap);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|