Main Page | Modules | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

hyfiletext.c File Reference


Detailed Description

file

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

Functions

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 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.


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