Annotation of Amaya/amaya/templateDeclarations.h, revision 1.8

1.1       francesc    1: #ifndef TEMPLATE_DECLARATIONS
                      2: #define TEMPLATE_DECLARATIONS
                      3: 
1.4       francesc    4: //The predefined library id
1.1       francesc    5: #define PREDEFINED_LIB "-Predefined-"
1.4       francesc    6: 
                      7: //Type natures
1.2       vatton      8: #define COMPONENT   0
                      9: #define SIMPLE_TYPE 1
1.3       francesc   10: #define XMLELEMENT  2
1.2       vatton     11: #define UNION       3
                     12: 
1.4       francesc   13: //Simple type ids
                     14: #define XTIGER_NUMBER  0
                     15: #define XTIGER_STRING  1
                     16: #define XTIGER_BOOLEAN 2
                     17: //And for future issues
                     18: #define XTIGER_CUSTOM  3
1.1       francesc   19: 
                     20: #define THOT_EXPORT extern
                     21: #include "amaya.h"
                     22: #include "document.h"
                     23: #include "mydictionary.h"
                     24: 
1.2       vatton     25: /* Structure of a template */
1.1       francesc   26: struct _XTigerTemplate;
                     27: typedef struct _XTigerTemplate *XTigerTemplate;
                     28: 
1.5       francesc   29: /* Structure of a declaration */
                     30: struct _Declaration;
                     31: typedef struct _Declaration *Declaration;
1.4       francesc   32: 
1.2       vatton     33: typedef int SimpleTypeType;
1.1       francesc   34: 
1.5       francesc   35: #ifdef TEMPLATES
                     36:        //List of loaded templates and libraries
                     37:        THOT_EXPORT DicDictionary templates;
                     38: #endif
1.1       francesc   39: 
1.5       francesc   40: /*----------------------------------------------------------------------
                     41:   Initializing the template environment
                     42:   ----------------------------------------------------------------------*/
                     43: extern void InitializeTemplateEnvironment ( void );
1.2       vatton     44: 
                     45: /*----------------------------------------------------------------------
1.8     ! francesc   46:   Freeing the template environment
        !            47:   ----------------------------------------------------------------------*/
        !            48: extern void FreeTemplateEnvironment ( void );
        !            49: 
        !            50: /*----------------------------------------------------------------------
1.5       francesc   51:    Creates a new template with its dictionaries and stores it.
                     52:  ----------------------------------------------------------------------*/
                     53: extern XTigerTemplate NewXTigerTemplate (const char *templatePath, 
                     54:                                                                                 const ThotBool addPredefined );
1.2       vatton     55: 
1.1       francesc   56: /*----------------------------------------------------------------------
1.5       francesc   57:   Creates a new library with its dictionaries and stores it.
1.1       francesc   58:   ----------------------------------------------------------------------*/
1.5       francesc   59: extern XTigerTemplate NewXTigerLibrary (const char *templatePath, 
                     60:                                                                                const ThotBool addPredefined );
1.1       francesc   61: 
1.2       vatton     62: /*----------------------------------------------------------------------
                     63:   ----------------------------------------------------------------------*/
1.5       francesc   64: extern void NewSimpleType ( const XTigerTemplate t,
1.2       vatton     65:                                    const char *name,
1.5       francesc   66:                                    SimpleTypeType xtype );
1.1       francesc   67: 
                     68: /*----------------------------------------------------------------------
                     69:   ----------------------------------------------------------------------*/
1.5       francesc   70: extern void NewComponent ( const XTigerTemplate t,
1.2       vatton     71:                                   const char *name,
                     72:                                   const Element el );
1.1       francesc   73: 
1.2       vatton     74: /*----------------------------------------------------------------------
                     75:   ----------------------------------------------------------------------*/
1.5       francesc   76: extern void NewUnion ( const XTigerTemplate t,
1.2       vatton     77:                               const char *name,
1.5       francesc   78:                               DicDictionary include = NULL,
                     79:                               DicDictionary exclude = NULL );
1.1       francesc   80: 
1.2       vatton     81: /*----------------------------------------------------------------------
                     82:   ----------------------------------------------------------------------*/
1.5       francesc   83: extern void NewElement ( const XTigerTemplate t,
1.3       francesc   84:                               const char *name );
                     85: 
                     86: /*----------------------------------------------------------------------
                     87:   ----------------------------------------------------------------------*/
                     88: extern Declaration GetDeclaration(const XTigerTemplate t, const char *name);
                     89: 
1.1       francesc   90: 
1.2       vatton     91: /*----------------------------------------------------------------------
                     92:   Free all the space used by a template (also its dictionaries)
                     93:   ----------------------------------------------------------------------*/
                     94: extern void FreeXTigerTemplate ( XTigerTemplate t );
1.1       francesc   95: 
                     96: /*----------------------------------------------------------------------
1.2       vatton     97:   Imports all declarations in a library lib to a template t
1.1       francesc   98:   ----------------------------------------------------------------------*/
1.2       vatton     99: extern void AddLibraryDeclarations (XTigerTemplate t, XTigerTemplate lib);
1.1       francesc  100: 
1.5       francesc  101: extern void RedefineSpecialUnions(XTigerTemplate t);
                    102: extern void DumpDeclarations(XTigerTemplate t);
1.4       francesc  103: 
1.6       francesc  104: //Acess to template members
                    105: 
                    106: extern DicDictionary GetComponents(XTigerTemplate t);
                    107: extern Document GetTemplateDocument(XTigerTemplate t);
1.7       francesc  108: extern void SetTemplateDocument(XTigerTemplate t, Document doc);
1.6       francesc  109: 
                    110: //Access to component members
                    111: extern Element GetComponentContent(Declaration d);
                    112: 
                    113: 
1.2       vatton    114: #endif //TEMPLATE_DECLARATIONS

Webmaster