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

jclglob_harmony.c File Reference


Detailed Description

Harmony natives initialization API.

#include <string.h>
#include "jcl.h"
#include "jclglob.h"
#include "zipsup.h"
#include "hypool.h"

Typedefs

typedef props_file_entry props_file_entry
 A structure that captures a single key-value setting from the properties file.

Functions

jint decodeProperty (HyPortLibrary *portLibrary, char **scanCursor, HyPool *properties)
 Scans the buffer specified by scanCursor and attempts to locate the next key-value pair separated by the '=' sign, and terminated by the platform line delimiter.
jint readPropertiesFile (HyPortLibrary *portLibrary, char *filename, HyPool *properties)
 Read the properties file specified by filename into the pool of properties.
jint readClassPathFromPropertiesFile (JavaVM *vm)
 Initializes the bootstrap classpath used by the VM.
char * concat (HyPortLibrary *portLibrary,...)
 Concatenates a variable number of null-terminated strings into a single string using the specified port library to allocate memory.
jint JNICALL JNI_OnLoad (JavaVM *vm, void *reserved)
 This DLL is being loaded, do any initialization required.
void JNICALL JNI_OnUnload (JavaVM *vm, void *reserved)
 This DLL is being unloaded, do any clean up required.


Typedef Documentation

typedef struct props_file_entry props_file_entry
 

A structure that captures a single key-value setting from the properties file.


Function Documentation

static char * concat HyPortLibrary portLibrary,
  ...
 

Concatenates a variable number of null-terminated strings into a single string using the specified port library to allocate memory.

The variable number of strings arguments must be terminated by a single NULL value.

Parameters:
portLibrary - The port library used to allocate memory.
Returns:
The concatenated string.

static jint decodeProperty HyPortLibrary portLibrary,
char **  scanCursor,
HyPool *  properties
 

Scans the buffer specified by scanCursor and attempts to locate the next key-value pair separated by the '=' sign, and terminated by the platform line delimiter.

If a key-value pair is located a new props_file_entry structure will be allocated in the properties pool, and the key and value will be copied. The scanCursor will be advanced past the entire property entry on success.

Parameters:
portLibrary - The port library used to interact with the platform.
scanCursor - A null-terminated string containing one or more (or partial) properties.
properties - A pool from which props_file_entry structures are allocated.
Returns:
The number of properties read, -1 on error.
Note:
This function modifies the buffer as properties are consumed.

jint JNICALL JNI_OnLoad JavaVM *  vm,
void *  reserved
 

This DLL is being loaded, do any initialization required.

This may be called more than once.

void JNICALL JNI_OnUnload JavaVM *  vm,
void *  reserved
 

This DLL is being unloaded, do any clean up required.

This may be called more than once!!

static jint readClassPathFromPropertiesFile JavaVM *  vm  ) 
 

Initializes the bootstrap classpath used by the VM.

Stores the result into a system property named 'com.ibm.oti.system.class.path'.

Reads the bootclasspath.properties file a line at a time

Parameters:
vm - The JavaVM from which port library and VMI interfaces can be obtained.
Returns:
- JNI_OK on success.

static jint readPropertiesFile HyPortLibrary portLibrary,
char *  filename,
HyPool *  properties
 

Read the properties file specified by filename into the pool of properties.

Parameters:
portLibrary - The port library used to interact with the platform.
filename - The file from which to read data using hyfile* functions.
properties - A pool that will contain property file entries.
Returns:
JNI_OK on success, or a JNI error code on failure.


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