aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/lscript/lscript_execute/lscript_readlso.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/lscript/lscript_execute/lscript_readlso.h
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/lscript/lscript_execute/lscript_readlso.h')
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_readlso.h166
1 files changed, 166 insertions, 0 deletions
diff --git a/linden/indra/lscript/lscript_execute/lscript_readlso.h b/linden/indra/lscript/lscript_execute/lscript_readlso.h
new file mode 100644
index 0000000..7f72dfd
--- /dev/null
+++ b/linden/indra/lscript/lscript_execute/lscript_readlso.h
@@ -0,0 +1,166 @@
1/**
2 * @file lscript_readlso.h
3 * @brief classes to read lso file
4 *
5 * Copyright (c) 2002-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LSCRIPT_READLSO_H
29#define LL_LSCRIPT_READLSO_H
30
31#include "lscript_byteconvert.h"
32#include "linked_lists.h"
33
34// list of op code print functions
35void print_noop(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
36void print_pop(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
37void print_pops(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
38void print_popl(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
39void print_popv(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
40void print_popq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
41void print_poparg(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
42void print_popip(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
43void print_popbp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
44void print_popsp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
45void print_popslr(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
46
47void print_dup(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
48void print_dups(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
49void print_dupl(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
50void print_dupv(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
51void print_dupq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
52
53void print_store(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
54void print_stores(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
55void print_storel(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
56void print_storev(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
57void print_storeq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
58void print_storeg(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
59void print_storegs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
60void print_storegl(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
61void print_storegv(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
62void print_storegq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
63void print_loadp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
64void print_loadsp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
65void print_loadlp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
66void print_loadvp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
67void print_loadqp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
68void print_loadgp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
69void print_loadgsp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
70void print_loadglp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
71void print_loadgvp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
72void print_loadgqp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
73
74void print_push(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
75void print_pushl(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
76void print_pushs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
77void print_pushv(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
78void print_pushq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
79void print_pushg(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
80void print_pushgl(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
81void print_pushgs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
82void print_pushgv(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
83void print_pushgq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
84void print_puship(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
85void print_pushbp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
86void print_pushsp(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
87void print_pushargb(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
88void print_pushargi(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
89void print_pushargf(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
90void print_pushargs(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
91void print_pushargv(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
92void print_pushargq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
93void print_pushe(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
94void print_pushev(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
95void print_pusheq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
96void print_pusharge(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
97
98void print_add(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
99void print_sub(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
100void print_mul(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
101void print_div(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
102void print_mod(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
103
104void print_eq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
105void print_neq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
106void print_leq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
107void print_geq(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
108void print_less(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
109void print_greater(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
110
111void print_bitand(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
112void print_bitor(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
113void print_bitxor(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
114void print_booland(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
115void print_boolor(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
116
117void print_shl(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
118void print_shr(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
119
120void print_neg(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
121void print_bitnot(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
122void print_boolnot(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
123
124void print_jump(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
125void print_jumpif(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
126void print_jumpnif(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
127
128void print_state(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
129void print_call(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
130void print_return(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
131void print_cast(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
132void print_stacktos(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
133void print_stacktol(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
134
135void print_print(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
136
137void print_calllib(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
138void print_calllib_two_byte(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
139
140class LLScriptLSOParse
141{
142public:
143 LLScriptLSOParse(FILE *fp);
144 LLScriptLSOParse(U8 *buffer);
145 ~LLScriptLSOParse();
146
147 void initOpCodePrinting();
148
149 void printData(FILE *fp);
150 void printNameDesc(FILE *fp);
151 void printRegisters(FILE *fp);
152 void printGlobals(FILE *fp);
153 void printGlobalFunctions(FILE *fp);
154 void printStates(FILE *fp);
155 void printHeap(FILE *fp);
156 void printOpCodes(FILE *fp, S32 &offset, S32 tabs);
157 void printOpCodeRange(FILE *fp, S32 start, S32 end, S32 tabs);
158
159 U8 *mRawData;
160 void (*mPrintOpCodes[0x100])(FILE *fp, U8 *buffer, S32 &offset, S32 tabs);
161};
162
163
164void lso_print_tabs(FILE *fp, S32 tabs);
165
166#endif