(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               /* Paths to search when attempting to locate included files */
 76               PtrArray paths;
 77           
 78               /* User callback to invoke to report an error */
 79               void (*errorCallback)(const char* msg, const wchar_t* wmsg, void* data);
 80               void* errorCallbackData;
 81           
 82               /* User callback to invoke to report a warning */
 83               void (*warningCallback)(const char* msg, const wchar_t* wmsg, void* data);
 84               void* warningCallbackData;
 85           
 86               /* User callback to invoke when a pragma is recognized */
 87               void (*pragmaCallback)(const char* pragma, const char* value, void* data);
 88 mike  1.2     void* pragmaCallbackData;
 89           
 90               /* User callback to invoke when a class is recognized */
 91               void (*classDeclCallback)(const MI_ClassDecl* decl, void* data);
 92               void* classDeclCallbackData;
 93           
 94               /* User callback to invoke when a qualifier is recognized */
 95               void (*qualifierDeclCallback)(const MI_QualifierDecl* decl, void* data);
 96               void* qualifierDeclCallbackData;
 97           
 98               /* User callback to invoke when an instance is recognized */
 99               void (*instanceDeclCallback)(const MI_InstanceDecl* decl, void* data);
100               void* instanceDeclCallbackData;
101           }
102           MOF_State;
103           
104           /* Global parser state object */
105           
106           extern MOF_State mofstate;
107           #define state mofstate
108           
109 mike  1.2 #endif /* _mof_state_h */

ViewCVS 0.9.2