~ubuntu-branches/ubuntu/intrepid/enigma/intrepid

« back to all changes in this revision

Viewing changes to src/editor-lua.cc

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2005-08-28 15:30:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050828153009-sky64kb6tcq37xt5
Tags: 0.92.1-1
* New upstream subversion checkout
* Remove menu.s3m, which we are allowed to distributed but not to modify
  also copyright notice is confusing... (Closes: #321669)
* Rebuild with new libzipios (Closes: #325405)
  I hope this works without a versioned build-dependency
* Added "enigma replaces enigma-data" for upgrades (Closes: #308558)
* Added notes about the fonts copyright.
* updated to policy 3.6.2.1 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
** Lua binding: editor
3
 
** Generated automatically by tolua 4.0a on Mon Jul 14 09:51:26 2003.
4
 
*/
5
 
 
6
 
#include "tolua.h"
7
 
 
8
 
/* Exported function */
9
 
int tolua_editor_open (lua_State* tolua_S);
10
 
void tolua_editor_close (lua_State* tolua_S);
11
 
 
12
 
#include "editor.hh"
13
 
using namespace editor;
14
 
 
15
 
/* function to register type */
16
 
static void toluaI_reg_types (lua_State* tolua_S)
17
 
{
18
 
}
19
 
 
20
 
/* function: DefineFloorGroup */
21
 
static int toluaI_editor_editor_DefineFloorGroup00(lua_State* tolua_S)
22
 
{
23
 
 if (
24
 
 !tolua_istype(tolua_S,1,LUA_TSTRING,0) ||
25
 
 !tolua_istype(tolua_S,2,LUA_TSTRING,0) ||
26
 
 !tolua_istype(tolua_S,3,LUA_TNUMBER,0) ||
27
 
 !tolua_istype(tolua_S,4,LUA_TTABLE,0) ||
28
 
 !tolua_isnoobj(tolua_S,5)
29
 
 )
30
 
 goto tolua_lerror;
31
 
 else
32
 
 {
33
 
  const char* name = ((const char*)  tolua_getstring(tolua_S,1,0));
34
 
  const char* descr = ((const char*)  tolua_getstring(tolua_S,2,0));
35
 
  int nentries = ((int)  tolua_getnumber(tolua_S,3,0));
36
 
  const char** entries = (const char**) malloc(nentries*sizeof(char*));
37
 
 {
38
 
 if (!tolua_arrayistype(tolua_S,4,LUA_TSTRING,nentries,0))
39
 
 goto tolua_lerror;
40
 
 else
41
 
 {
42
 
 int i;
43
 
 for(i=0; i<nentries;i++)
44
 
  entries[i] = ((const char*)  tolua_getfieldstring(tolua_S,4,i+1,0));
45
 
 }
46
 
 }
47
 
 {
48
 
  DefineFloorGroup(name,descr,nentries,entries);
49
 
 }
50
 
 {
51
 
 int i;
52
 
 for(i=0; i<nentries;i++)
53
 
 tolua_pushfieldstring(tolua_S,4,i+1,(const char*) entries[i]);
54
 
 }
55
 
 free(entries);
56
 
 }
57
 
 return 0;
58
 
tolua_lerror:
59
 
 tolua_error(tolua_S,"#ferror in function 'DefineFloorGroup'.");
60
 
 return 0;
61
 
}
62
 
 
63
 
/* function: DefineItemGroup */
64
 
static int toluaI_editor_editor_DefineItemGroup00(lua_State* tolua_S)
65
 
{
66
 
 if (
67
 
 !tolua_istype(tolua_S,1,LUA_TSTRING,0) ||
68
 
 !tolua_istype(tolua_S,2,LUA_TSTRING,0) ||
69
 
 !tolua_istype(tolua_S,3,LUA_TNUMBER,0) ||
70
 
 !tolua_istype(tolua_S,4,LUA_TTABLE,0) ||
71
 
 !tolua_isnoobj(tolua_S,5)
72
 
 )
73
 
 goto tolua_lerror;
74
 
 else
75
 
 {
76
 
  const char* name = ((const char*)  tolua_getstring(tolua_S,1,0));
77
 
  const char* descr = ((const char*)  tolua_getstring(tolua_S,2,0));
78
 
  int nentries = ((int)  tolua_getnumber(tolua_S,3,0));
79
 
  const char** entries = (const char**) malloc(nentries*sizeof(char*));
80
 
 {
81
 
 if (!tolua_arrayistype(tolua_S,4,LUA_TSTRING,nentries,0))
82
 
 goto tolua_lerror;
83
 
 else
84
 
 {
85
 
 int i;
86
 
 for(i=0; i<nentries;i++)
87
 
  entries[i] = ((const char*)  tolua_getfieldstring(tolua_S,4,i+1,0));
88
 
 }
89
 
 }
90
 
 {
91
 
  DefineItemGroup(name,descr,nentries,entries);
92
 
 }
93
 
 {
94
 
 int i;
95
 
 for(i=0; i<nentries;i++)
96
 
 tolua_pushfieldstring(tolua_S,4,i+1,(const char*) entries[i]);
97
 
 }
98
 
 free(entries);
99
 
 }
100
 
 return 0;
101
 
tolua_lerror:
102
 
 tolua_error(tolua_S,"#ferror in function 'DefineItemGroup'.");
103
 
 return 0;
104
 
}
105
 
 
106
 
/* function: DefineStoneGroup */
107
 
static int toluaI_editor_editor_DefineStoneGroup00(lua_State* tolua_S)
108
 
{
109
 
 if (
110
 
 !tolua_istype(tolua_S,1,LUA_TSTRING,0) ||
111
 
 !tolua_istype(tolua_S,2,LUA_TSTRING,0) ||
112
 
 !tolua_istype(tolua_S,3,LUA_TNUMBER,0) ||
113
 
 !tolua_istype(tolua_S,4,LUA_TTABLE,0) ||
114
 
 !tolua_isnoobj(tolua_S,5)
115
 
 )
116
 
 goto tolua_lerror;
117
 
 else
118
 
 {
119
 
  const char* name = ((const char*)  tolua_getstring(tolua_S,1,0));
120
 
  const char* descr = ((const char*)  tolua_getstring(tolua_S,2,0));
121
 
  int nentries = ((int)  tolua_getnumber(tolua_S,3,0));
122
 
  const char** entries = (const char**) malloc(nentries*sizeof(char*));
123
 
 {
124
 
 if (!tolua_arrayistype(tolua_S,4,LUA_TSTRING,nentries,0))
125
 
 goto tolua_lerror;
126
 
 else
127
 
 {
128
 
 int i;
129
 
 for(i=0; i<nentries;i++)
130
 
  entries[i] = ((const char*)  tolua_getfieldstring(tolua_S,4,i+1,0));
131
 
 }
132
 
 }
133
 
 {
134
 
  DefineStoneGroup(name,descr,nentries,entries);
135
 
 }
136
 
 {
137
 
 int i;
138
 
 for(i=0; i<nentries;i++)
139
 
 tolua_pushfieldstring(tolua_S,4,i+1,(const char*) entries[i]);
140
 
 }
141
 
 free(entries);
142
 
 }
143
 
 return 0;
144
 
tolua_lerror:
145
 
 tolua_error(tolua_S,"#ferror in function 'DefineStoneGroup'.");
146
 
 return 0;
147
 
}
148
 
 
149
 
/* Open function */
150
 
int tolua_editor_open (lua_State* tolua_S)
151
 
{
152
 
 tolua_open(tolua_S);
153
 
 toluaI_reg_types(tolua_S);
154
 
 tolua_module(tolua_S,"editor");
155
 
 tolua_function(tolua_S,"editor","DefineFloorGroup",toluaI_editor_editor_DefineFloorGroup00);
156
 
 tolua_function(tolua_S,"editor","DefineItemGroup",toluaI_editor_editor_DefineItemGroup00);
157
 
 tolua_function(tolua_S,"editor","DefineStoneGroup",toluaI_editor_editor_DefineStoneGroup00);
158
 
 return 1;
159
 
}
160
 
/* Close function */
161
 
void tolua_editor_close (lua_State* tolua_S)
162
 
{
163
 
 lua_pushnil(tolua_S); lua_setglobal(tolua_S,"editor");
164
 
}