#include <windows.h>
#include <sys/stat.h>
#include <time.h>
#include "hyport.h"
#include "portpriv.h"
#include "hystdarg.h"
#include "portnls.h"
#include "ut_hyprt.h"
Functions | |
void | convert_path_to_unicode (struct HyPortLibrary *portLibrary, const char *path, wchar_t **pathW) |
Convert UTF-8 encoded path to UTF-16 so it can be used as an argument to unicode versions of WinAPI fucntions. | |
I_32 VMCALL | hyfile_attr (struct HyPortLibrary *portLibrary, const char *path) |
Determine whether path is a file or directory. | |
I_32 VMCALL | hyfile_close (struct HyPortLibrary *portLibrary, IDATA fd) |
Closes a file descriptor. | |
const char *VMCALL | hyfile_error_message (struct HyPortLibrary *portLibrary) |
Return an error message describing the last OS error that occurred. | |
void VMCALL | hyfile_findclose (struct HyPortLibrary *portLibrary, UDATA findhandle) |
Close the handle returned from hyfile_findfirst. | |
UDATA VMCALL | hyfile_findfirst (struct HyPortLibrary *portLibrary, const char *path, char *resultbuf) |
Find the first occurrence of a file identified by path. | |
I_32 VMCALL | hyfile_findnext (struct HyPortLibrary *portLibrary, UDATA findhandle, char *resultbuf) |
Find the next filename and path matching a given handle. | |
I_64 VMCALL | hyfile_lastmod (struct HyPortLibrary *portLibrary, const char *path) |
Return the last modification time of the file path in milliseconds. | |
I_64 VMCALL | hyfile_length (struct HyPortLibrary *portLibrary, const char *path) |
Answer the length in bytes of the file. | |
int | is_device_name (const char *path) |
Determines if the given file name is a reserved device name. | |
I_32 VMCALL | hyfile_mkdir (struct HyPortLibrary *portLibrary, const char *path) |
Create a directory. | |
I_32 VMCALL | hyfile_move (struct HyPortLibrary *portLibrary, const char *pathExist, const char *pathNew) |
Move the file pathExist to a new name pathNew. | |
IDATA VMCALL | hyfile_open (struct HyPortLibrary *portLibrary, const char *path, I_32 flags, I_32 mode) |
Convert a pathname into a file descriptor. | |
IDATA VMCALL | hyfile_read (struct HyPortLibrary *portLibrary, IDATA fd, void *buf, IDATA nbytes) |
Read bytes from a file descriptor into a user provided buffer. | |
I_64 VMCALL | hyfile_seek (struct HyPortLibrary *portLibrary, IDATA fd, I_64 offset, I_32 whence) |
Repositions the offset of the file descriptor to a given offset as per directive whence. | |
void VMCALL | hyfile_shutdown (struct HyPortLibrary *portLibrary) |
PortLibrary shutdown. | |
I_32 VMCALL | hyfile_startup (struct HyPortLibrary *portLibrary) |
PortLibrary startup. | |
I_32 VMCALL | hyfile_sync (struct HyPortLibrary *portLibrary, IDATA fd) |
Synchronize a file's state with the state on disk. | |
I_32 VMCALL | hyfile_unlink (struct HyPortLibrary *portLibrary, const char *path) |
Remove a file from the file system. | |
I_32 VMCALL | hyfile_unlinkdir (struct HyPortLibrary *portLibrary, const char *path) |
Remove the trailing directory of the path. | |
void VMCALL | hyfile_vprintf (struct HyPortLibrary *portLibrary, IDATA fd, const char *format, va_list args) |
Write to a file. | |
IDATA VMCALL | hyfile_write (struct HyPortLibrary *portLibrary, IDATA fd, void *buf, IDATA nbytes) |
Write to a file. | |
void VMCALL | hyfile_printf (struct HyPortLibrary *portLibrary, IDATA fd, const char *format,...) |
Write to a file. | |
I_32 VMCALL | hyfile_set_length (struct HyPortLibrary *portLibrary, IDATA fd, I_64 newLength) |
Set the length of a file to a specified value. |
void convert_path_to_unicode | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path, | |||
wchar_t ** | pathW | |||
) |
Convert UTF-8 encoded path to UTF-16 so it can be used as an argument to unicode versions of WinAPI fucntions.
This function also converts all relative paths to absolute ones.
[in] | portLibrary | The port library |
[in] | path | UTF-8 encoded null-terminated path |
[out] | pathW | Pointer to wide characters array that contains converted path |
I_32 VMCALL hyfile_attr | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path | |||
) |
Determine whether path is a file or directory.
[in] | portLibrary | The port library |
[in] | path | file/path name being queried. |
I_32 VMCALL hyfile_close | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd | |||
) |
Closes a file descriptor.
[in] | portLibrary | The port library |
[in] | fd | The file descriptor. |
const char* VMCALL hyfile_error_message | ( | struct HyPortLibrary * | portLibrary | ) |
Return an error message describing the last OS error that occurred.
The last error returned is not thread safe, it may not be related to the operation that failed for this thread.
[in] | portLibrary | The port library |
void VMCALL hyfile_findclose | ( | struct HyPortLibrary * | portLibrary, | |
UDATA | findhandle | |||
) |
Close the handle returned from hyfile_findfirst.
[in] | portLibrary | The port library |
[in] | findhandle | Handle returned from hyfile_findfirst. |
UDATA VMCALL hyfile_findfirst | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path, | |||
char * | resultbuf | |||
) |
Find the first occurrence of a file identified by path.
Answers a handle to be used in subsequent calls to hyfile_findnext and hyfile_findclose.
[in] | portLibrary | The port library |
[in] | path | file/path name being queried. |
[out] | resultbuf | filename and path matching path. |
I_32 VMCALL hyfile_findnext | ( | struct HyPortLibrary * | portLibrary, | |
UDATA | findhandle, | |||
char * | resultbuf | |||
) |
Find the next filename and path matching a given handle.
[in] | portLibrary | The port library |
[in] | findhandle | handle returned from hyfile_findfirst. |
[out] | resultbuf | next filename and path matching findhandle. |
I_64 VMCALL hyfile_lastmod | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path | |||
) |
Return the last modification time of the file path in milliseconds.
[in] | portLibrary | The port library |
[in] | path | file/path name being queried. |
I_64 VMCALL hyfile_length | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path | |||
) |
Answer the length in bytes of the file.
[in] | portLibrary | The port library |
[in] | path | file/path name being queried. |
I_32 VMCALL hyfile_mkdir | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path | |||
) |
Create a directory.
[in] | portLibrary | The port library |
[in] | path | Directory to be created. |
I_32 VMCALL hyfile_move | ( | struct HyPortLibrary * | portLibrary, | |
const char * | pathExist, | |||
const char * | pathNew | |||
) |
Move the file pathExist to a new name pathNew.
[in] | portLibrary | The port library |
[in] | pathExist | The existing file name. |
[in] | pathNew | The new file name. |
IDATA VMCALL hyfile_open | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path, | |||
I_32 | flags, | |||
I_32 | mode | |||
) |
Convert a pathname into a file descriptor.
[in] | portLibrary | The port library |
[in] | path | Name of the file to be opened. |
[in] | flags | Portable file read/write attributes. |
[in] | mode | Platform file permissions. |
void VMCALL hyfile_printf | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd, | |||
const char * | format, | |||
... | ||||
) |
Write to a file.
Writes formatted output to the file referenced by the file descriptor.
[in] | portLibrary | The port library |
[in] | fd | File descriptor to write to |
[in] | format | The format string to be output. |
[in] | ... | arguments for format. |
IDATA VMCALL hyfile_read | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd, | |||
void * | buf, | |||
IDATA | nbytes | |||
) |
Read bytes from a file descriptor into a user provided buffer.
[in] | portLibrary | The port library |
[in] | fd | The file descriptor. |
[in,out] | buf | Buffer to read into. |
[in] | nbytes | Size of buffer. |
I_64 VMCALL hyfile_seek | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd, | |||
I_64 | offset, | |||
I_32 | whence | |||
) |
Repositions the offset of the file descriptor to a given offset as per directive whence.
[in] | portLibrary | The port library |
[in] | fd | The file descriptor. |
[in] | offset | The offset in the file to position to. |
[in] | whence | Portable constant describing how to apply the offset. |
I_32 VMCALL hyfile_set_length | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd, | |||
I_64 | newLength | |||
) |
Set the length of a file to a specified value.
[in] | portLibrary | The port library |
[in] | fd | The file descriptor. |
[in] | newLength | Length to be set |
void VMCALL hyfile_shutdown | ( | struct HyPortLibrary * | portLibrary | ) |
PortLibrary shutdown.
This function is called during shutdown of the portLibrary. Any resources that were created by hyfile_startup should be destroyed here.
[in] | portLibrary | The port library |
I_32 VMCALL hyfile_startup | ( | struct HyPortLibrary * | portLibrary | ) |
PortLibrary startup.
This function is called during startup of the portLibrary. Any resources that are required for the file operations may be created here. All resources created here should be destroyed in hyfile_shutdown.
[in] | portLibrary | The port library |
I_32 VMCALL hyfile_sync | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd | |||
) |
Synchronize a file's state with the state on disk.
[in] | portLibrary | The port library |
[in] | fd | The file descriptor. |
I_32 VMCALL hyfile_unlink | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path | |||
) |
Remove a file from the file system.
[in] | portLibrary | The port library |
[in] | path | file/path name to remove. |
I_32 VMCALL hyfile_unlinkdir | ( | struct HyPortLibrary * | portLibrary, | |
const char * | path | |||
) |
Remove the trailing directory of the path.
If the path is a symbolic link to a directory, remove the symbolic link.
[in] | portLibrary | The port library |
[in] | path | directory name being removed. |
void VMCALL hyfile_vprintf | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd, | |||
const char * | format, | |||
va_list | args | |||
) |
Write to a file.
Writes formatted output to the file referenced by the file descriptor.
[in] | portLibrary | The port library |
[in] | fd | File descriptor to write. |
[in] | format | The format String. |
[in] | args | Variable argument list. |
IDATA VMCALL hyfile_write | ( | struct HyPortLibrary * | portLibrary, | |
IDATA | fd, | |||
void * | buf, | |||
IDATA | nbytes | |||
) |
Write to a file.
Writes up to nbytes from the provided buffer to the file referenced by the file descriptor.
[in] | portLibrary | The port library |
[in] | fd | File descriptor to write. |
[in] | buf | Buffer to be written. |
[in] | nbytes | Size of buffer. |
int is_device_name | ( | const char * | path | ) |
Determines if the given file name is a reserved device name.
[in] | path | the path |
Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.