ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/cfperl.h
(Generate patch)

Comparing deliantra/server/include/cfperl.h (file contents):
Revision 1.18 by root, Thu Aug 31 09:19:34 2006 UTC vs.
Revision 1.19 by root, Thu Aug 31 17:54:14 2006 UTC

8 8
9using namespace std; 9using namespace std;
10 10
11#include <EXTERN.h> 11#include <EXTERN.h>
12#include <perl.h> 12#include <perl.h>
13
14#include "keyword.h"
15 13
16// optimisations/workaround for functions requiring my_perl in scope (anti-bloat) 14// optimisations/workaround for functions requiring my_perl in scope (anti-bloat)
17#undef localtime 15#undef localtime
18#undef srand48 16#undef srand48
19#undef drand48 17#undef drand48
110 if (attach) 108 if (attach)
111 attachable_base::instantiate ((data_type) cftype<subclass>::dt, static_cast<subclass *>(this)); 109 attachable_base::instantiate ((data_type) cftype<subclass>::dt, static_cast<subclass *>(this));
112 } 110 }
113}; 111};
114 112
115struct object_freezer 113struct object_freezer : dynbuf
116{ 114{
117 AV *av; 115 AV *av;
118 SV *text;
119 116
120 object_freezer (); 117 object_freezer ();
121 ~object_freezer (); 118 ~object_freezer ();
122 119
123 void put (attachable_base *ext); 120 void put (attachable_base *ext);
126 void put (attachable<subclass> *obj) 123 void put (attachable<subclass> *obj)
127 { 124 {
128 put ((attachable_base *)obj); 125 put ((attachable_base *)obj);
129 } 126 }
130 127
131 void put (keyword k); 128 void put (const char *k, const char *v); //TODO//temporary
132 void put (const char *v); 129 void put (const char *k, int v); //TODO//temporary
133 void put (int v);
134 130
135 template<typename value> 131 void put (keyword k, const char *v);
136 void put (keyword k, value v) 132 void put (keyword k, double v);
133 void put (keyword k, float v) { put (k, (double)v); }
134
135 void put_ (keyword k, sint32 v);
136 void put_ (keyword k, sint64 v);
137
138 void put (keyword k, signed char v) { put_(k, (sint32)v); }
139 void put (keyword k, unsigned char v) { put_(k, (sint32)v); }
140 void put (keyword k, signed short v) { put_(k, (sint32)v); }
141 void put (keyword k, unsigned short v) { put_(k, (sint32)v); }
142 void put (keyword k, signed int v) { put_(k, (sint32)v); }
143 void put (keyword k, unsigned int v) { put_(k, (sint64)v); }
144 void put (keyword k, signed long v) { put_(k, (sint64)v); }
145 void put (keyword k, unsigned long v) { put_(k, (sint64)v); }
146 void put (keyword k, signed long long v) { put_(k, (sint64)v); }
147 void put (keyword k, unsigned long long v) { put_(k, (sint64)v); }
148
149 void put (keyword kbeg, keyword kend, const char *v); // multiline
150
151 template<typename T>
152 void put (keyword k, T *v)
137 { 153 {
138 put (k); 154 put (k, v ? (const char *)v->name : 0);
139 put (v);
140 } 155 }
141 156
142 bool save (const char *filename); 157 bool save (const char *filename);
143 158
144 operator bool () { return !!av; } 159 operator bool () { return !!av; }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines