ivaria/script.h
00001 /* 00002 Copyright (C) 1999 by Brandon Ehle <azverkan@yahoo.com> 00003 (C) 2003 by Mat Sutcliffe <oktal@gmx.co.uk> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_IVARIA_SCRIPT_H__ 00021 #define __CS_IVARIA_SCRIPT_H__ 00022 00023 #include "csutil/scf.h" 00024 #include "csutil/ref.h" 00025 00026 SCF_VERSION (iScriptObject, 0, 0, 1); 00027 00038 struct iScriptObject : public iBase 00039 { 00044 virtual bool IsType (const char *) const = 0; 00045 00050 virtual iBase* GetPointer () const = 0; 00051 00056 virtual bool SetPointer (iBase *) = 0; 00057 00063 virtual bool Call (const char *name, const char *format, ...) 00064 CS_GNUC_PRINTF(3, 4) = 0; 00065 00071 virtual bool Call (const char *name, int &ret, const char *fmt, ...) 00072 CS_GNUC_PRINTF(4, 5) = 0; 00073 00079 virtual bool Call (const char *name, float &ret, const char *fmt, ...) 00080 CS_GNUC_PRINTF(4, 5) = 0; 00081 00087 virtual bool Call (const char *name, double &ret, const char *fmt, ...) 00088 CS_GNUC_PRINTF(4, 5) = 0; 00089 00095 virtual bool Call (const char *name, char **ret, const char *fmt, ...) 00096 CS_GNUC_PRINTF(4, 5) = 0; 00097 00103 virtual bool Call (const char *name, csRef<iScriptObject> &ret, 00104 const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0; 00105 00110 virtual bool Set (const char *name, int data) = 0; 00111 00116 virtual bool Set (const char *name, float data) = 0; 00117 00122 virtual bool Set (const char *name, double data) = 0; 00123 00128 virtual bool Set (const char *name, char *data) = 0; 00129 00134 virtual bool Set (const char *name, iScriptObject *data) = 0; 00135 00140 virtual bool SetTruth (const char *name, bool isTrue) = 0; 00141 00146 virtual bool Get (const char *name, int &data) const = 0; 00147 00152 virtual bool Get (const char *name, float &data) const = 0; 00153 00158 virtual bool Get (const char *name, double &data) const = 0; 00159 00164 virtual bool Get (const char *name, char **data) const = 0; 00165 00170 virtual bool Get (const char *name, csRef<iScriptObject> &data) const = 0; 00171 00176 virtual bool GetTruth (const char *name, bool &isTrue) const = 0; 00177 }; 00178 00179 struct iObjectRegistry; 00180 00181 SCF_VERSION (iScript, 0, 0, 2); 00182 00192 struct iScript : public iBase 00193 { 00195 virtual bool Initialize (iObjectRegistry *object_reg) = 0; 00196 00198 virtual bool Store (const char* name, void* data, void* tag) = 0; 00199 00201 virtual bool RunText (const char *text) = 0; 00202 00204 virtual bool LoadModule (const char *name) = 0; 00205 00211 virtual bool Call (const char *name, const char *format, ...) 00212 CS_GNUC_PRINTF(3, 4) = 0; 00213 00219 virtual bool Call (const char *name, int &ret, const char *fmt, ...) 00220 CS_GNUC_PRINTF(4, 5) = 0; 00221 00227 virtual bool Call (const char *name, float &ret, const char *fmt, ...) 00228 CS_GNUC_PRINTF(4, 5) = 0; 00229 00235 virtual bool Call (const char *name, double &ret, const char *fmt, ...) 00236 CS_GNUC_PRINTF(4, 5) = 0; 00237 00243 virtual bool Call (const char *name, char **ret, const char *fmt, ...) 00244 CS_GNUC_PRINTF(4, 5) = 0; 00245 00251 virtual bool Call (const char *name, csRef<iScriptObject> &ret, 00252 const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0; 00253 00259 virtual csPtr<iScriptObject> NewObject (const char *type, 00260 const char *ctorFormat, ...) const CS_GNUC_PRINTF(3, 4) = 0; 00261 00263 virtual bool Store (const char *name, int data) = 0; 00264 00266 virtual bool Store (const char *name, float data) = 0; 00267 00269 virtual bool Store (const char *name, double data) = 0; 00270 00272 virtual bool Store (const char *name, char *data) = 0; 00273 00275 virtual bool Store (const char *name, iScriptObject *data) = 0; 00276 00278 virtual bool SetTruth (const char *name, bool isTrue) = 0; 00279 00284 virtual bool Retrieve (const char *name, int &data) const = 0; 00285 00290 virtual bool Retrieve (const char *name, float &data) const = 0; 00291 00296 virtual bool Retrieve (const char *name, double &data) const = 0; 00297 00302 virtual bool Retrieve (const char *name, char **data) const = 0; 00303 00308 virtual bool Retrieve (const char *name, csRef<iScriptObject>&data) const = 0; 00309 00314 virtual bool GetTruth (const char *name, bool &isTrue) const = 0; 00315 00320 virtual bool Remove (const char *name) = 0; 00321 }; 00322 00323 #endif // __CS_IVARIA_SCRIPT_H__
Generated for Crystal Space by doxygen 1.2.18