Added: harmony/standard/site/docs/externals/vm_doc/html/hyfile_8c.html URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/externals/vm_doc/html/hyfile_8c.html?rev=724734&view=auto ============================================================================== --- harmony/standard/site/docs/externals/vm_doc/html/hyfile_8c.html (added) +++ harmony/standard/site/docs/externals/vm_doc/html/hyfile_8c.html Tue Dec 9 07:03:45 2008 @@ -0,0 +1,1118 @@ + + +Harmony Class Library Porting: modules/portlib/src/main/native/port/windows/hyfile.c File Reference + + + + +
+ +
+

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


Detailed Description

+file +

+ +

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


Function Documentation

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

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] path UTF-8 encoded null-terminated path
[out] pathW Pointer to wide characters array that contains converted path
+
+
Note:
Sets *pathW to null and returns if path cannot be converted
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_attr (struct HyPortLibrary portLibrary,
const char *  path 
)
+
+
+ +

+Determine whether path is a file or directory. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] path file/path name being queried.
+
+
Returns:
EslsFile if a file, EslsDir if a directory, negative portable error code on failure.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_close (struct HyPortLibrary portLibrary,
IDATA  fd 
)
+
+
+ +

+Closes a file descriptor. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] fd The file descriptor.
+
+
Returns:
0 on success, -1 on failure.
+ +
+

+ +

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

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
error message describing the last OS error, may return NULL.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void VMCALL hyfile_findclose (struct HyPortLibrary portLibrary,
UDATA  findhandle 
)
+
+
+ +

+Close the handle returned from hyfile_findfirst. +

+

Parameters:
+ + + +
[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.

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] path file/path name being queried.
[out] resultbuf filename and path matching path.
+
+
Returns:
valid handle on success, -1 on failure.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_findnext (struct HyPortLibrary portLibrary,
UDATA  findhandle,
char *  resultbuf 
)
+
+
+ +

+Find the next filename and path matching a given handle. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] findhandle handle returned from hyfile_findfirst.
[out] resultbuf next filename and path matching findhandle.
+
+
Returns:
0 on success, -1 on failure or if no matching entries.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_64 VMCALL hyfile_lastmod (struct HyPortLibrary portLibrary,
const char *  path 
)
+
+
+ +

+Return the last modification time of the file path in milliseconds. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] path file/path name being queried.
+
+
Returns:
last modification time on success, -1 on failure.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_64 VMCALL hyfile_length (struct HyPortLibrary portLibrary,
const char *  path 
)
+
+
+ +

+Answer the length in bytes of the file. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] path file/path name being queried.
+
+
Returns:
Length in bytes of the file on success, negative portable error code on failure
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_mkdir (struct HyPortLibrary portLibrary,
const char *  path 
)
+
+
+ +

+Create a directory. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] path Directory to be created.
+
+
Returns:
0 on success, -1 on failure.
+
Note:
Assumes all components of path up to the last directory already exist.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_move (struct HyPortLibrary portLibrary,
const char *  pathExist,
const char *  pathNew 
)
+
+
+ +

+Move the file pathExist to a new name pathNew. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] pathExist The existing file name.
[in] pathNew The new file name.
+
+
Returns:
0 on success, -1 on failure.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDATA VMCALL hyfile_open (struct HyPortLibrary portLibrary,
const char *  path,
I_32  flags,
I_32  mode 
)
+
+
+ +

+Convert a pathname into a file descriptor. +

+

Parameters:
+ + + + + +
[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.
+
+
Returns:
The file descriptor of the newly opened file, -1 on failure.
+ +
+

+ +

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

+

Parameters:
+ + + + + +
[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. +

+

Parameters:
+ + + + + +
[in] portLibrary The port library
[in] fd The file descriptor.
[in,out] buf Buffer to read into.
[in] nbytes Size of buffer.
+
+
Returns:
The number of bytes read, or -1 on failure.
+ +
+

+ +

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

+

Parameters:
+ + + + + +
[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.
+
+
Returns:
The resulting offset on success, -1 on failure.
+
Note:
whence is one of HySeekSet (seek from beginning of file), HySeekCur (seek from current file pointer) or HySeekEnd (seek backwards from end of 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. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] fd The file descriptor.
[in] newLength Length to be set
+
+
Returns:
0 on success, negative portable error code on failure
+ +
+

+ +

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

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Note:
Most implementations will be empty.
+ +
+

+ +

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

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
0 on success, negative error code on failure. Error code values returned are
    +
  • HYPORT_ERROR_STARTUP_FILE
  • +
+
+
Note:
Most implementations will simply return success.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_sync (struct HyPortLibrary portLibrary,
IDATA  fd 
)
+
+
+ +

+Synchronize a file's state with the state on disk. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] fd The file descriptor.
+
+
Returns:
0 on success, -1 on failure.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyfile_unlink (struct HyPortLibrary portLibrary,
const char *  path 
)
+
+
+ +

+Remove a file from the file system. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] path file/path name to remove.
+
+
Returns:
0 on success, -1 on failure.
+ +
+

+ +

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

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] path directory name being removed.
+
+
Returns:
0 on success, -1 on failure.
+ +
+

+ +

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

+

Parameters:
+ + + + + +
[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.

+

Parameters:
+ + + + + +
[in] portLibrary The port library
[in] fd File descriptor to write.
[in] buf Buffer to be written.
[in] nbytes Size of buffer.
+
+
Returns:
Number of bytes written on success, -1 on failure.
+ +
+

+ +

+
+ + + + + + + + + +
int is_device_name (const char *  path  ) 
+
+
+ +

+Determines if the given file name is a reserved device name. +

+

Parameters:
+ + +
[in] path the path
+
+
Returns:
length of device name if given file name is a device name or 0 otherwise
+ +
+

+


+
+ +

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

+

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

+
+
+ + Propchange: harmony/standard/site/docs/externals/vm_doc/html/hyfile_8c.html ------------------------------------------------------------------------------ svn:eol-style = native Added: harmony/standard/site/docs/externals/vm_doc/html/hyfiletext_8c.html URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/externals/vm_doc/html/hyfiletext_8c.html?rev=724734&view=auto ============================================================================== --- harmony/standard/site/docs/externals/vm_doc/html/hyfiletext_8c.html (added) +++ harmony/standard/site/docs/externals/vm_doc/html/hyfiletext_8c.html Tue Dec 9 07:03:45 2008 @@ -0,0 +1,199 @@ + + +Harmony Class Library Porting: modules/portlib/src/main/native/port/windows/hyfiletext.c File Reference + + + + +
+ +
+

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.

+
+
+ + Propchange: harmony/standard/site/docs/externals/vm_doc/html/hyfiletext_8c.html ------------------------------------------------------------------------------ svn:eol-style = native Added: harmony/standard/site/docs/externals/vm_doc/html/hygp_8c.html URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/externals/vm_doc/html/hygp_8c.html?rev=724734&view=auto ============================================================================== --- harmony/standard/site/docs/externals/vm_doc/html/hygp_8c.html (added) +++ harmony/standard/site/docs/externals/vm_doc/html/hygp_8c.html Tue Dec 9 07:03:45 2008 @@ -0,0 +1,329 @@ + + +Harmony Class Library Porting: modules/portlib/src/main/native/port/shared/hygp.c File Reference + + + + +
+ +
+

modules/portlib/src/main/native/port/shared/hygp.c File Reference


Detailed Description

+Provides platform-neutral signal handling functions. +

+The hygp_register_handler function is partially dependent on internal VM structures, and must be called with NULL as a third (userData) parameter.
+
+ +

+#include "hyport.h"
+#include "hycomp.h"
+#include "gp.h"
+ + + + + + + + + + + + + + + + + + + + + +

Functions

UDATA VMCALL hygp_protect (struct HyPortLibrary *portLibrary, protected_fn fn, void *arg)
 Kicks off the new thread by calling the function provided in protected_fn fn.
void VMCALL hygp_register_handler (struct HyPortLibrary *portLibrary, handler_fn fn, void *aUserData)
 Sets the function that is responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp.
U_32 VMCALL hygp_info (struct HyPortLibrary *portLibrary, void *info, U_32 category, I_32 index, const char **name, void **value)
 Provides the name and value, specified by category/index of the gp information in info.
U_32 VMCALL hygp_info_count (struct HyPortLibrary *portLibrary, void *info, U_32 category)
 Returns the number of items that exist in the category specified, or zero if the category is undefined.
void VMCALL hygp_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hygp_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.
+


Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
U_32 VMCALL hygp_info (struct HyPortLibrary portLibrary,
void *  info,
U_32  category,
I_32  index,
const char **  name,
void **  value 
)
+
+
+ +

+Provides the name and value, specified by category/index of the gp information in info. +

+Returns the kind of information found at category/index specified, or undefined if the category/index are invalid. The number of items in the category specified must equal the count hygp_info_count returns for that category.

+

Parameters:
+ + + + + + + +
[in] portLibrary The port library
[in] info struct containing all available signal information. Normally includes register values, name of module where crash occured and its base address.
[in] category the category of signal information that you are querying.
[in] index the index of the item in the specified category. The number of items for each category are defined in the sourceTemplate.
[out] name the name of the item at the specified index.
[out] value the value of the item at the specified index
+
+
Returns:
the kind of info at the specified index. For example, this allows the caller to determine whether the item placed in **value corresponds to a 32/64-bit integer or a pointer to a string.
+
Note:
The program counter and module name also have negative indexes as defined by HYGP_CONTROL_PC and HYGP_MODULE_NAME respectively.

+Above allows the handler function registered in hygp_register_handler to distinguish (and use) them from the other gp items.

+The caller is responsible for allocating and freeing any buffers used by **name, **value.

+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
U_32 VMCALL hygp_info_count (struct HyPortLibrary portLibrary,
void *  info,
U_32  category 
)
+
+
+ +

+Returns the number of items that exist in the category specified, or zero if the category is undefined. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] info struct containing all available signal information. Normally includes register values, name of module where crash occured and its base address.
[in] category the category in which we want to find the number of items that exist.
+
+
Note:
Return value must agree with the number of items that hygp_info makes available for the category specified.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
UDATA VMCALL hygp_protect (struct HyPortLibrary portLibrary,
protected_fn  fn,
void *  arg 
)
+
+
+ +

+Kicks off the new thread by calling the function provided in protected_fn fn. +

+All threads spawned by the vm start here and all OS signals that will be handled by fn must be registered to the OS here. Upon receiving a signal from the OS, fn is responsible for calling the function specified in hygp_register_handler if it is determined that a shutdown is required.

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] fn the function that will be used to kick off the thread
[in] arg arguments to protected_fn fn
+
+
Returns:
the return value of the function provided in fn
+
Note:
it is a good idea to save the portLibrary in case a registered exception handler cannot be found
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void VMCALL hygp_register_handler (struct HyPortLibrary portLibrary,
handler_fn  fn,
void *  aUserData 
)
+
+
+ +

+Sets the function that is responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] fn function responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp.
[in] aUserData The HyJavaVM or NULL for non-HY consumers.
+
+
Note:
vmGPHandler in gphandle.c is currently the only function used for handling gps.

+fn is not called by the OS but by the gp handler function specified in the call to hygp_protect gp module

+above occurs after the OS has passed a signal along to us and it is determined that a shutdown is required.

+ +
+

+ +

+
+ + + + + + + + + +
void VMCALL hygp_shutdown (struct HyPortLibrary portLibrary  ) 
+
+
+ +

+PortLibrary shutdown. +

+This function is called during shutdown of the portLibrary. Any resources that were created by hygp_startup should be destroyed here.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Note:
Most implementations will be empty.
+ +
+

+ +

+
+ + + + + + + + + +
I_32 VMCALL hygp_startup (struct HyPortLibrary portLibrary  ) 
+
+
+ +

+PortLibrary startup. +

+This function is called during startup of the portLibrary. Any resources that are required for the shared library operation may be created here. All resources created here should be destroyed in hygp_shutdown.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
0 on success, negative error code on failure. Error code values returned are
    +
  • HYPORT_ERROR_STARTUP_GP
  • +
+
+
Note:
Most implementations will simply return success.
+ +
+

+


+
+ +

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

+

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

+
+
+ + Propchange: harmony/standard/site/docs/externals/vm_doc/html/hygp_8c.html ------------------------------------------------------------------------------ svn:eol-style = native