author | never |
Wed, 31 Mar 2010 16:29:10 -0700 | |
changeset 5232 | a04d5732b356 |
parent 1090 | c5805b1672a6 |
child 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
2 | 1 |
/* |
1090
c5805b1672a6
6732421: Removed old javavm and Classic VM files from the jdk7 sources
ohair
parents:
2
diff
changeset
|
2 |
* Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Sun designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
* have any questions. |
|
24 |
*/ |
|
25 |
||
26 |
#ifndef JDWP_OUTSTREAM_H |
|
27 |
#define JDWP_OUTSTREAM_H |
|
28 |
||
29 |
#include "transport.h" |
|
30 |
#include "FrameID.h" |
|
31 |
||
32 |
struct bag; |
|
33 |
||
34 |
#define INITIAL_SEGMENT_SIZE 300 |
|
35 |
#define MAX_SEGMENT_SIZE 10000 |
|
36 |
||
37 |
typedef struct PacketData { |
|
38 |
int length; |
|
39 |
jbyte *data; |
|
40 |
struct PacketData *next; |
|
41 |
} PacketData; |
|
42 |
||
43 |
typedef struct PacketOutputStream { |
|
44 |
jbyte *current; |
|
45 |
jint left; |
|
46 |
struct PacketData *segment; |
|
47 |
struct PacketData firstSegment; |
|
48 |
jvmtiError error; |
|
49 |
jboolean sent; |
|
50 |
jdwpPacket packet; |
|
51 |
jbyte initialSegment[INITIAL_SEGMENT_SIZE]; |
|
52 |
struct bag *ids; |
|
53 |
} PacketOutputStream; |
|
54 |
||
55 |
void outStream_initCommand(PacketOutputStream *stream, jint id, |
|
56 |
jbyte flags, jbyte commandSet, jbyte command); |
|
57 |
void outStream_initReply(PacketOutputStream *stream, jint id); |
|
58 |
||
59 |
jint outStream_id(PacketOutputStream *stream); |
|
60 |
jbyte outStream_command(PacketOutputStream *stream); |
|
61 |
||
62 |
jdwpError outStream_writeBoolean(PacketOutputStream *stream, jboolean val); |
|
63 |
jdwpError outStream_writeByte(PacketOutputStream *stream, jbyte val); |
|
64 |
jdwpError outStream_writeChar(PacketOutputStream *stream, jchar val); |
|
65 |
jdwpError outStream_writeShort(PacketOutputStream *stream, jshort val); |
|
66 |
jdwpError outStream_writeInt(PacketOutputStream *stream, jint val); |
|
67 |
jdwpError outStream_writeLong(PacketOutputStream *stream, jlong val); |
|
68 |
jdwpError outStream_writeFloat(PacketOutputStream *stream, jfloat val); |
|
69 |
jdwpError outStream_writeDouble(PacketOutputStream *stream, jdouble val); |
|
70 |
jdwpError outStream_writeObjectRef(JNIEnv *env, PacketOutputStream *stream, jobject val); |
|
71 |
jdwpError outStream_writeObjectTag(JNIEnv *env, PacketOutputStream *stream, jobject val); |
|
72 |
jdwpError outStream_writeFrameID(PacketOutputStream *stream, FrameID val); |
|
73 |
jdwpError outStream_writeMethodID(PacketOutputStream *stream, jmethodID val); |
|
74 |
jdwpError outStream_writeFieldID(PacketOutputStream *stream, jfieldID val); |
|
75 |
jdwpError outStream_writeLocation(PacketOutputStream *stream, jlocation val); |
|
76 |
jdwpError outStream_writeByteArray(PacketOutputStream*stream, jint length, jbyte *bytes); |
|
77 |
jdwpError outStream_writeString(PacketOutputStream *stream, char *string); |
|
78 |
jdwpError outStream_writeValue(JNIEnv *env, struct PacketOutputStream *out, |
|
79 |
jbyte typeKey, jvalue value); |
|
80 |
jdwpError outStream_skipBytes(PacketOutputStream *stream, jint count); |
|
81 |
||
82 |
jdwpError outStream_error(PacketOutputStream *stream); |
|
83 |
void outStream_setError(PacketOutputStream *stream, jdwpError error); |
|
84 |
||
85 |
void outStream_sendReply(PacketOutputStream *stream); |
|
86 |
void outStream_sendCommand(PacketOutputStream *stream); |
|
87 |
||
88 |
void outStream_destroy(PacketOutputStream *stream); |
|
89 |
||
90 |
#endif |