(file) Return to state.h CVS log (file) (dir) Up to [OMI] / omi / mof

  1 mike  1.1 /*
  2           **==============================================================================
  3           **
  4           ** Open Management Infrastructure (OMI)
  5           **
  6           ** Copyright (c) Microsoft Corporation
  7           ** 
  8           ** Licensed under the Apache License, Version 2.0 (the "License"); you may not 
  9           ** use this file except in compliance with the License. You may obtain a copy 
 10           ** of the License at 
 11           **
 12           **     http://www.apache.org/licenses/LICENSE-2.0 
 13           **
 14           ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15           ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
 16           ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
 17           ** MERCHANTABLITY OR NON-INFRINGEMENT. 
 18           **
 19           ** See the Apache 2 License for the specific language governing permissions 
 20           ** and limitations under the License.
 21           **
 22 mike  1.1 **==============================================================================
 23           */
 24           
 25 mike  1.2 #ifndef _mof_state_h
 26           #define _mof_state_h
 27           
 28           #include "heap.h"
 29           #include "ptrarray.h"
 30           #include "types.h"
 31           
 32           #define MOF_MAX_PATHS 16
 33           
 34           /*
 35           **==============================================================================
 36           **
 37           ** MOF_State
 38           **
 39           **     This structure maintains the static parser state for the current parser
 40           **     invocation. It maintains the heap, errors, warnings, class declarations,
 41           **     and qulifier declarations.
 42           **
 43           **==============================================================================
 44           */
 45           
 46 mike  1.2 typedef struct _MOF_State
 47           {
 48               /* Maintains a list of all allocated heap blocks */
 49               MOF_Heap heap;
 50               
 51               /* Name of file being parsed */
 52               char* path;
 53           
 54               /* Line number of file being parsed */
 55               unsigned int line;
 56           
 57               /* Maintains a list of errors encountered during parsing */
 58               PtrArray errors;
 59           
 60               /* Maintains a list of warnings encountered during parsing */
 61               PtrArray warnings;
 62           
 63               /* Maintains a list of class declarations processed during parsing */
 64               MOF_ClassDeclList classDecls;
 65           
 66               /* Maintains a list of instance declarations processed during parsing */
 67 mike  1.2     MOF_InstanceDeclList instanceDecls;
 68           
 69               /* Maintains a list of qualifier declarations processed during parsing */
 70               MOF_QualifierDeclList qualifierDecls;
 71           
 72               /* Track of EmbeddedInstances qualifiers for post processing */
 73               MOF_EmbeddedInstanceList embeddedInstanceList;
 74           
 75 krisbash 1.4     /* MI_TRUE if extensions or deprecated constructs are allowed */
 76                  MI_Boolean extensionsEnabled;
 77              
 78 mike     1.2     /* Paths to search when attempting to locate included files */
 79                  PtrArray paths;
 80              
 81                  /* User callback to invoke to report an error */
 82                  void (*errorCallback)(const char* msg, const wchar_t* wmsg, void* data);
 83                  void* errorCallbackData;
 84              
 85                  /* User callback to invoke to report a warning */
 86                  void (*warningCallback)(const char* msg, const wchar_t* wmsg, void* data);
 87                  void* warningCallbackData;
 88              
 89                  /* User callback to invoke when a pragma is recognized */
 90                  void (*pragmaCallback)(const char* pragma, const char* value, void* data);
 91                  void* pragmaCallbackData;
 92              
 93                  /* User callback to invoke when a class is recognized */
 94                  void (*classDeclCallback)(const MI_ClassDecl* decl, void* data);
 95                  void* classDeclCallbackData;
 96              
 97                  /* User callback to invoke when a qualifier is recognized */
 98                  void (*qualifierDeclCallback)(const MI_QualifierDecl* decl, void* data);
 99 mike     1.2     void* qualifierDeclCallbackData;
100              
101                  /* User callback to invoke when an instance is recognized */
102                  void (*instanceDeclCallback)(const MI_InstanceDecl* decl, void* data);
103                  void* instanceDeclCallbackData;
104              }
105              MOF_State;
106              
107              /* Global parser state object */
108              
109              extern MOF_State mofstate;
110              #define state mofstate
111              
112              #endif /* _mof_state_h */

ViewCVS 0.9.2