modules/portlib/src/main/native/port/windows/hyfiletext.c File Reference


Detailed Description

file

#include <windows.h>
#include "hyport.h"
#include "utf8decode.h"

Functions

char *VMCALL hybuf_write_text (struct HyPortLibrary *portLibrary, const char *buf, IDATA nbytes)
 Output the buffer onto the another buffer as text.
char *VMCALL hyfile_read_text (struct HyPortLibrary *portLibrary, IDATA fd, char *buf, IDATA nbytes)
 Read a line of text from the file into buf.
IDATA VMCALL hyfile_write_text (struct HyPortLibrary *portLibrary, IDATA fd, const char *buf, IDATA nbytes)
 Output the buffer onto the stream as text.


Function Documentation

char* VMCALL hybuf_write_text ( struct HyPortLibrary portLibrary,
const char *  buf,
IDATA  nbytes 
)

Output the buffer onto the another buffer as text.

The in buffer is a UTF8-encoded array of chars. It is converted to the appropriate platform encoding.

Parameters:
[in] portLibrary The port library
[in] buf buffer of text to be converted.
[in] nbytes size of buffer of text to be converted.
Returns:
buffer of converted to the appropriate platform encoding text.

char* VMCALL hyfile_read_text ( struct HyPortLibrary portLibrary,
IDATA  fd,
char *  buf,
IDATA  nbytes 
)

Read a line of text from the file into buf.

Text is converted from the platform file encoding to UTF8. This is mostly equivalent to fgets in standard C.

Parameters:
[in] portLibrary The port library
[in] fd File descriptor.
[in,out] buf Buffer for read in text.
[in] nbytes Size of buffer.
Returns:
buf on success, NULL on failure.

IDATA VMCALL hyfile_write_text ( struct HyPortLibrary portLibrary,
IDATA  fd,
const char *  buf,
IDATA  nbytes 
)

Output the buffer onto the stream as text.

The buffer is a UTF8-encoded array of chars. It is converted to the appropriate platform encoding.

Parameters:
[in] portLibrary The port library
[in] fd the file descriptor.
[in] buf buffer of text to be output.
[in] nbytes size of buffer of text to be output.
Returns:
0 on success, negative error code on failure.


Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.