hotspot/src/share/vm/prims/jvmtiH.xsl
author stefank
Mon, 01 Oct 2012 13:29:11 +0200
changeset 13922 ab7d352debe6
parent 7413 59b978f8fbdf
child 36508 5f9eee6b383b
permissions -rw-r--r--
8000227: [obj|type]ArrayKlass::oop_print_on prints one line to tty instead of the provided output stream Reviewed-by: brutisso, sla, jmasa, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
<!--
7413
59b978f8fbdf 7003782: Update JVMTI version to 1.2 for jdk7
kamg
parents: 5547
diff changeset
     3
 Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    22
 questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
-->
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
                version="1.0">
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
  <xsl:import href="jvmtiLib.xsl"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
  <xsl:output method="text" omit-xml-declaration="yes"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  <xsl:template match="/">
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
    <xsl:apply-templates select="specification"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  </xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  <xsl:template match="specification">
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
    <xsl:call-template name="intro"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    <xsl:text>/* Derived Base Types */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    <xsl:apply-templates select="//basetype"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    /* Constants */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    <xsl:apply-templates select="//constants"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    /* Errors */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
typedef enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
     <xsl:for-each select="//errorid">
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
       <xsl:sort select="@num" data-type="number"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
         <xsl:apply-templates select="." mode="enum"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
         <xsl:text>,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
         <xsl:if test="position() = last()">
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
           <xsl:text>    JVMTI_ERROR_MAX = </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
           <xsl:value-of select="@num"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
         </xsl:if>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
     </xsl:for-each>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
} jvmtiError;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    <xsl:apply-templates select="eventsection" mode="enum"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    /* Pre-Declarations */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
<xsl:apply-templates select="//typedef|//uniontypedef" mode="early"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    /* Function Types */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    <xsl:apply-templates select="//callback"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    /* Structure Types */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    <xsl:apply-templates select="//typedef|//uniontypedef" mode="body"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    <xsl:apply-templates select="//capabilitiestypedef"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    <xsl:apply-templates select="eventsection" mode="body"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    <xsl:apply-templates select="functionsection"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    <xsl:call-template name="outro"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
      
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  </xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  <xsl:template name="intro">
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  <xsl:call-template name="includeHeader"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    /* Include file for the Java(tm) Virtual Machine Tool Interface */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
#ifndef _JAVA_JVMTI_H_
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
#define _JAVA_JVMTI_H_
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
#include "jni.h"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
#ifdef __cplusplus
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
extern "C" {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
    JVMTI_VERSION_1   = 0x30010000,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    JVMTI_VERSION_1_0 = 0x30010000,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    JVMTI_VERSION_1_1 = 0x30010100,
7413
59b978f8fbdf 7003782: Update JVMTI version to 1.2 for jdk7
kamg
parents: 5547
diff changeset
   115
    JVMTI_VERSION_1_2 = 0x30010200,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    JVMTI_VERSION = 0x30000000 + (</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  <xsl:value-of select="//specification/@majorversion"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  <xsl:text> * 0x10000) + (</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  <xsl:value-of select="//specification/@minorversion"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  <xsl:text> * 0x100)</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  <xsl:variable name="micro">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    <xsl:call-template name="microversion"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  </xsl:variable>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  <xsl:choose>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    <xsl:when test="string($micro)='dev'">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
      <xsl:text>  /* checked out - </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    </xsl:when>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    <xsl:otherwise>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
      <xsl:text> + </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
      <xsl:value-of select="$micro"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
      <xsl:text>  /* </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    </xsl:otherwise>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  </xsl:choose>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  <xsl:text>version: </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  <xsl:call-template name="showversion"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  <xsl:text> */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
JNIEXPORT jint JNICALL 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
Agent_OnLoad(JavaVM *vm, char *options, void *reserved);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
JNIEXPORT jint JNICALL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
Agent_OnAttach(JavaVM* vm, char* options, void* reserved);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
JNIEXPORT void JNICALL 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
Agent_OnUnload(JavaVM *vm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
    /* Forward declaration of the environment */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
        
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
struct _jvmtiEnv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
struct jvmtiInterface_1_;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
#ifdef __cplusplus
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
typedef _jvmtiEnv jvmtiEnv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
typedef const struct jvmtiInterface_1_ *jvmtiEnv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
#endif /* __cplusplus */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  </xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  <xsl:template name="outro">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
#ifdef __cplusplus
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
} /* extern "C" */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
#endif /* __cplusplus */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
#endif /* !_JAVA_JVMTI_H_ */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
<xsl:template match="eventsection" mode="enum">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    /* Event IDs */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
typedef enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
     <xsl:for-each select="event">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
       <xsl:sort select="@num" data-type="number"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
       <xsl:if test="position()=1">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
         <xsl:text>    JVMTI_MIN_EVENT_TYPE_VAL = </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
         <xsl:value-of select="@num"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
         <xsl:text>,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
       </xsl:if>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
       <xsl:apply-templates select="." mode="enum"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
       <xsl:text>,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
       <xsl:if test="position()=last()">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
         <xsl:text>    JVMTI_MAX_EVENT_TYPE_VAL = </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
         <xsl:value-of select="@num"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
       </xsl:if>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
     </xsl:for-each>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
} jvmtiEvent;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
<xsl:template match="eventsection" mode="body">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
    /* Event Definitions */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
typedef void (JNICALL *jvmtiEventReserved)(void);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  <xsl:apply-templates select="event" mode="definition">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
    <xsl:sort select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  </xsl:apply-templates>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    /* Event Callback Structure */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
typedef struct {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  <xsl:call-template name="eventStruct">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    <xsl:with-param name="events" select="event"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
    <xsl:with-param name="index" select="0"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    <xsl:with-param name="started" select="false"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
    <xsl:with-param name="comment" select="'Yes'"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  </xsl:call-template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  <xsl:text>} jvmtiEventCallbacks;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
<xsl:template match="event" mode="definition">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
typedef void (JNICALL *jvmtiEvent</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  <xsl:text>)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
    (jvmtiEnv *jvmti_env</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  <xsl:apply-templates select="parameters" mode="signature">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
    <xsl:with-param name="comma">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
      <xsl:text>, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
     </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
    </xsl:with-param>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
   </xsl:apply-templates>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
 <xsl:text>);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
<xsl:template match="functionsection">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
   <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
    /* Function Interface */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
    
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
typedef struct jvmtiInterface_1_ {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  <xsl:call-template name="funcStruct">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    <xsl:with-param name="funcs" select="category/function[count(@hide)=0]"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
    <xsl:with-param name="index" select="1"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  </xsl:call-template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  <xsl:text>} jvmtiInterface_1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
struct _jvmtiEnv {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
    const struct jvmtiInterface_1_ *functions;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
#ifdef __cplusplus
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
  <xsl:apply-templates select="category" mode="cppinline"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
#endif /* __cplusplus */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
<xsl:template name="funcStruct">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  <xsl:param name="funcs"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
  <xsl:param name="index"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  <xsl:variable name="thisFunction" select="$funcs[@num=$index]"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  <xsl:text>  /* </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  <xsl:number value="$index" format="  1"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  <xsl:text> : </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  <xsl:choose>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    <xsl:when test="count($thisFunction)=1">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
      <xsl:value-of select="$thisFunction/synopsis"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
      <xsl:text> */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
  jvmtiError (JNICALL *</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
      <xsl:value-of select="$thisFunction/@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
      <xsl:text>) (jvmtiEnv* env</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
      <xsl:apply-templates select="$thisFunction/parameters" mode="signature">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
        <xsl:with-param name="comma">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
          <xsl:text>, 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
    </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
        </xsl:with-param>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
      </xsl:apply-templates>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
      <xsl:text>)</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
    </xsl:when>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
    <xsl:otherwise>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
      <xsl:text> RESERVED */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  void *reserved</xsl:text>        
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
      <xsl:value-of select="$index"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
    </xsl:otherwise>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  </xsl:choose>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  <xsl:text>;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  <xsl:if test="count($funcs[@num &gt; $index]) &gt; 0">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
    <xsl:call-template name="funcStruct">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
      <xsl:with-param name="funcs" select="$funcs"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
      <xsl:with-param name="index" select="1+$index"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
    </xsl:call-template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  </xsl:if>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
<xsl:template match="function">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  <xsl:text>  jvmtiError (JNICALL *</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  <xsl:text>) (jvmtiEnv* env</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  <xsl:apply-templates select="parameters" mode="signature"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  <xsl:text>);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
<xsl:template match="category" mode="cppinline">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
    <xsl:apply-templates select="function[count(@hide)=0]" mode="cppinline"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
<xsl:template match="function" mode="cppinline">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
  jvmtiError </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
  <xsl:text>(</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
  <xsl:apply-templates select="parameters" mode="signaturenoleadcomma"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  <xsl:text>) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
    return functions-></xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  <xsl:text>(this</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
  <xsl:for-each select="parameters">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
    <xsl:for-each select="param">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
      <xsl:if test="@id != '...' and count(jclass/@method) = 0">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
        <xsl:text>, </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
        <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
      </xsl:if>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
    </xsl:for-each>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  </xsl:for-each>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  <xsl:text>);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
  <xsl:template match="basetype">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
    <xsl:if test="count(definition)!=0">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
      <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
      <xsl:apply-templates select="definition"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
    </xsl:if>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  </xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
  <xsl:template match="constants">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
    <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
    /* </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
    <xsl:value-of select="@label"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
    <xsl:text> */ 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
    <xsl:choose>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
      <xsl:when test="@kind='enum'">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
        <xsl:apply-templates select="." mode="enum"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
      </xsl:when>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
      <xsl:otherwise>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
        <xsl:apply-templates select="." mode="constants"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
      </xsl:otherwise>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
    </xsl:choose>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
  </xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
<xsl:template match="callback">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
      <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
typedef </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
      <xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
      <xsl:text> (JNICALL *</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
      <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
      <xsl:text>)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
    (</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
      <xsl:for-each select="parameters">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
        <xsl:apply-templates select="param[position()=1]" mode="signature"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
        <xsl:for-each select="param[position()>1]">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
          <xsl:text>, </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
          <xsl:apply-templates select="." mode="signature"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
        </xsl:for-each>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
      </xsl:for-each>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
      <xsl:text>);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
<xsl:template match="capabilitiestypedef">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  <xsl:apply-templates select="." mode="genstruct"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  <xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
<xsl:template match="typedef" mode="early">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
  <xsl:text>struct _</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  <xsl:text>;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
  <xsl:text>typedef struct _</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
  <xsl:text> </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
  <xsl:text>;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
<xsl:template match="typedef" mode="body">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  <xsl:text>struct _</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  <xsl:text> {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
<xsl:apply-templates select="field" mode="signature"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
  <xsl:text>};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
<xsl:template match="uniontypedef" mode="early">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
  <xsl:text>union _</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
  <xsl:text>;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
  <xsl:text>typedef union _</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
  <xsl:text> </xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
  <xsl:text>;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
<xsl:template match="uniontypedef" mode="body">
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
  <xsl:text>union _</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
  <xsl:value-of select="@id"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
  <xsl:text> {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
<xsl:apply-templates select="field" mode="signature"/>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  <xsl:text>};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
</xsl:text>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
</xsl:template>
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
</xsl:stylesheet>