jdk/src/share/npt/README.txt
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
README: For NPT Library.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
To use this Native Platform Toolkit library, you need to add 
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
-Isrc/share/npt and -I/src/${platform}/npt (platform is solaris or windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
to your compilation lines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
To initialize/use the library:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
    #include "npt.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
    NptEnv *npt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
    NPT_INITIALIZE(&npt, NPT_VERSION, NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
    if (npt == NULL) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
        FATAL_ERROR_MESSAGE(("Unable to gain access to Npt library"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
    /* To use the npt utf functions, they require initialization */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
    npt->utf = (npt->utfInitialize)(NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
    if (npt->utf == NULL) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
        FATAL_ERROR_MESSAGE(("Unable to gain access to Npt utf functions"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
    ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
    /* After all uses is done, it can be terminated, however, if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
     *   process will be exiting anyway it isn't necessary, and if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
     *   you have other threads running that might use these handles
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
     *   you will need to wait here until all those threads have terminated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
     *   So in general, termination can be a pain and slow your process
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
     *   termination down.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    (npt->utfTerminate)(npt->utf,NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    NPT_TERMINATE(&npt, NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39