v_compiler.c-Dateireferenz

#include <thing/properties.h>
#include <defines.h>
#include <v_compiler.h>
#include <exploration.h>
#include <sys_debug.h>
#include <living/description.h>
Include-Abhängigkeitsdiagramm für v_compiler.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define BLUE_NAME(ob)   (explode(object_name(ob),"#")[0])

Funktionen

void create ()
int NoParaObjects ()
string Validate (string file)
public int QueryValidObject (string oname)
mixed CustomizeObject ()
static private mixed AddObject (string file)
mixed compile_object (string file)
mixed QueryObjects ()
int remove ()

Variablen

inherit std thing properties
private nosave string last_loaded_file
private nosave mapping objects

Makro-Dokumentation

#define BLUE_NAME ( ob   )     (explode(object_name(ob),"#")[0])

Dokumentation der Funktionen

static private mixed AddObject ( string  file  )  [static]

Definiert in Zeile 122 der Datei v_compiler.c.

Benutzt err, last_loaded_file, ob(), objects, P_STD_OBJECT und QueryProp().

00123 {
00124   object ob;
00125   string err;
00126 
00127   // clean up the object list
00128   objects = filter_indices(objects, function int (string f) {
00129       return (objectp(objects[f])); } );
00130 
00131   last_loaded_file = file;
00132   // register new object
00133   if(ob = clone_object(QueryProp(P_STD_OBJECT)))
00134     objects[file] = ob;
00135   return ob;
00136 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

mixed compile_object ( string  file  ) 

Definiert in Zeile 139 der Datei v_compiler.c.

Benutzt AddObject() und Validate().

00140 {
00141   // validate if the file name is a correct one
00142   if(file = Validate(file)) return AddObject(file);
00143 }  

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

void create (  ) 

Definiert in Zeile 47 der Datei v_compiler.c.

Benutzt create(), objects, old_explode(), P_COMPILER_PATH, P_PARA, P_STD_OBJECT und SetProp().

00048 {
00049   ::create();
00050   seteuid(getuid());
00051   SetProp(P_STD_OBJECT, "/std/room");
00052   SetProp(P_COMPILER_PATH, sprintf("/%s/",
00053                 implode(old_explode(object_name(this_object()), "/")[0..<2], "/")));
00054   SetProp(P_PARA, ({}) ); // keine Para-VC-Objekte
00055   objects = ([]);
00056 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

mixed CustomizeObject (  ) 

Definiert in Zeile 108 der Datei v_compiler.c.

Benutzt BLUE_NAME, file(), last_loaded_file und Validate().

00109 {
00110   string file;
00111 
00112   if(!clonep(previous_object()))
00113     return Validate(explode(BLUE_NAME(previous_object()), "/")[<1]);
00114   if(stringp(last_loaded_file)) file = last_loaded_file;
00115   else file = Validate(explode(BLUE_NAME(previous_object()), "/")[<1]);
00116   if(!file) return 0;
00117   last_loaded_file = 0;
00118   return file;
00119 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

int NoParaObjects (  ) 

Definiert in Zeile 61 der Datei v_compiler.c.

00061 { return 0; }

mixed QueryObjects (  ) 

Definiert in Zeile 146 der Datei v_compiler.c.

Benutzt objects.

00147 {
00148   return m_values(objects)-({0});
00149 }

public int QueryValidObject ( string  oname  ) 

Definiert in Zeile 76 der Datei v_compiler.c.

Benutzt NoParaObjects(), P_COMPILER_PATH, P_PARA, path, QueryProp() und Validate().

00076                                           {
00077     string fname, path, *pelem;
00078     int para;
00079     mixed ppara;
00080 
00081     //erstmal Validate fragen
00082     pelem=explode(oname,"/");
00083     fname=pelem[<1];
00084     if (!fname=Validate(fname))
00085                 return(0); //nicht zustaendig
00086     // nicht im richtigen Pfad?
00087     path=sprintf("%s/",implode(pelem[0..<2],"/"));
00088     if (path!=QueryProp(P_COMPILER_PATH))
00089                 return(0);
00090     // Para-Objekt?
00091     if (sscanf(fname,"%s^%d",fname,para) > 1) {
00092                 if (NoParaObjects())
00093                     return(0); //direkt zurueck, keine Para-Objekte
00094                 // bestimmte Para-Dimensionen explizit erlaubt? (Wenn P_PARA nicht
00095                 // gesetzt ist, sind alle erlaubt!)
00096                 if (ppara=QueryProp(P_PARA)) {
00097                     if (pointerp(ppara) && member(ppara,para)!=-1)
00098                                 return(1);
00099                     else if (intp(para) && ppara==para)
00100                                 return(1);
00101                     // P_PARA gesetzt, aber gewuenschtes Para nicht enthalten...
00102                     else return(0);
00103                 }
00104     }
00105     return(1); //fall-through, offenbar zustaendig.
00106 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

int remove (  ) 

Definiert in Zeile 152 der Datei v_compiler.c.

Benutzt destruct(), ob(), objects und QueryObjects().

00152              {
00153 
00154   if(!mappingp(objects)) return 0;
00155 
00156   //for(ob = QueryObjects(); sizeof(ob); ob = ob[1..])
00157   foreach(object ob: QueryObjects()) {
00158       ob->remove();
00159       if(objectp(ob)) destruct(ob);
00160   }
00161   return 1;
00162 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

string Validate ( string  file  ) 

Definiert in Zeile 63 der Datei v_compiler.c.

Benutzt EPMASTER.

00064 {
00065   if(!file) return 0;
00066   if(file[<2..] == ".c") file = file[0..<3];
00067   EPMASTER->PrepareVCQuery(file);
00068   return file;
00069 }


Variablen-Dokumentation

private nosave string last_loaded_file

Definiert in Zeile 44 der Datei v_compiler.c.

Wird benutzt von AddObject() und CustomizeObject().

private nosave mapping objects

Definiert in Zeile 45 der Datei v_compiler.c.

inherit std thing properties

Definiert in Zeile 24 der Datei v_compiler.c.

Erzeugt am Thu Jun 3 14:43:27 2010 für MorgenGrauen Mudlib von  doxygen 1.6.3