version 1.4, 2006/06/22 16:23:17
|
version 1.5, 2006/06/23 14:40:28
|
Line 26
|
Line 26
|
struct _XTigerTemplate; |
struct _XTigerTemplate; |
typedef struct _XTigerTemplate *XTigerTemplate; |
typedef struct _XTigerTemplate *XTigerTemplate; |
|
|
struct _XTigerTemplate |
/* Structure of a declaration */ |
{ |
struct _Declaration; |
ThotBool isLibrary; //Is this a library? (otherway it's a template) |
typedef struct _Declaration *Declaration; |
#ifdef TODO_XTIGER |
|
DicDictionary libraries; //Imported libraries |
|
#endif |
|
DicDictionary simpleTypes; //All simple types declared in the document |
|
DicDictionary elements; //All element types declared in the document |
|
DicDictionary components; //All component types declared in the document |
|
DicDictionary unions; //All union types declared in the document |
|
}; |
|
|
|
/* Structure of a Declaration */ |
|
|
|
//Just for clarity |
|
typedef int TypeNature; |
|
typedef int SimpleTypeType; |
typedef int SimpleTypeType; |
|
|
typedef struct _XmlElement |
#ifdef TEMPLATES |
{ |
//List of loaded templates and libraries |
char *name; |
THOT_EXPORT DicDictionary templates; |
} XmlElement; |
#endif |
|
|
typedef struct _SimpleType |
|
{ |
|
SimpleTypeType type; |
|
} SimpleType; |
|
|
|
typedef struct _Component |
|
{ |
|
Element content; |
|
} Component; |
|
|
|
typedef struct _Union |
|
{ |
|
DicDictionary include; //Dictionary<Declaration> |
|
DicDictionary exclude; //Dictionary<Declaration> |
|
} Union; |
|
|
|
typedef struct _Declaration |
|
{ |
|
char *name; |
|
TypeNature nature; |
|
XTigerTemplate declaredIn; |
|
union |
|
{ |
|
SimpleType simpleType; |
|
Component componentType; |
|
Union unionType; |
|
XmlElement elementType; |
|
}; |
|
} *Declaration; |
|
|
|
//List of loaded templates and libraries |
|
THOT_EXPORT DicDictionary templates; |
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Returns a library with the predefined types |
Initializing the template environment |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern XTigerTemplate CreatePredefinedTypesLibrary ( void ); |
extern void InitializeTemplateEnvironment ( void ); |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Initializing the template environment |
Creates a new template with its dictionaries and stores it. |
|
----------------------------------------------------------------------*/ |
|
extern XTigerTemplate NewXTigerTemplate (const char *templatePath, |
|
const ThotBool addPredefined ); |
|
|
|
/*---------------------------------------------------------------------- |
|
Creates a new library with its dictionaries and stores it. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern DicDictionary InitializeTemplateEnvironment ( void ); |
extern XTigerTemplate NewXTigerLibrary (const char *templatePath, |
|
const ThotBool addPredefined ); |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern Declaration NewSimpleType ( const XTigerTemplate t, |
extern void NewSimpleType ( const XTigerTemplate t, |
const char *name, |
const char *name, |
TypeNature xtype ); |
SimpleTypeType xtype ); |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern Declaration NewComponent ( const XTigerTemplate t, |
extern void NewComponent ( const XTigerTemplate t, |
const char *name, |
const char *name, |
const Element el ); |
const Element el ); |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern Declaration NewUnion ( const XTigerTemplate t, |
extern void NewUnion ( const XTigerTemplate t, |
const char *name, |
const char *name, |
DicDictionary include, |
DicDictionary include = NULL, |
DicDictionary exclude ); |
DicDictionary exclude = NULL ); |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern Declaration NewElement ( const XTigerTemplate t, |
extern void NewElement ( const XTigerTemplate t, |
const char *name ); |
const char *name ); |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern void FreeDeclaration ( Declaration dec ); |
|
|
|
/*---------------------------------------------------------------------- |
|
----------------------------------------------------------------------*/ |
|
extern Declaration GetDeclaration(const XTigerTemplate t, const char *name); |
extern Declaration GetDeclaration(const XTigerTemplate t, const char *name); |
|
|
/*---------------------------------------------------------------------- |
|
Creates a new template with its dictionaries |
|
----------------------------------------------------------------------*/ |
|
extern XTigerTemplate NewXTigerTemplate ( ThotBool addPredefined ); |
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Free all the space used by a template (also its dictionaries) |
Free all the space used by a template (also its dictionaries) |
Line 139 extern void FreeXTigerTemplate ( XTigerT
|
Line 93 extern void FreeXTigerTemplate ( XTigerT
|
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
extern void AddLibraryDeclarations (XTigerTemplate t, XTigerTemplate lib); |
extern void AddLibraryDeclarations (XTigerTemplate t, XTigerTemplate lib); |
|
|
/*---------------------------------------------------------------------- |
extern void PreInstanciateComponents(XTigerTemplate t); |
Imports all declarations in a library lib to a template t |
extern void RedefineSpecialUnions(XTigerTemplate t); |
----------------------------------------------------------------------*/ |
extern void DumpDeclarations(XTigerTemplate t); |
extern void AddLibraryDeclarations (XTigerTemplate t, XTigerTemplate lib); |
|
|
|
/*---------------------------------------------------------------------- |
|
Removes the declaration identified by name |
|
----------------------------------------------------------------------*/ |
|
extern void RemoveOldDeclarations (XTigerTemplate t, char *name); |
|
#endif //TEMPLATE_DECLARATIONS |
#endif //TEMPLATE_DECLARATIONS |