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

 1 mike  1.1 /*
 2           **==============================================================================
 3           **
 4           ** Open Management Infrastructure (OMI)
 5           **
 6           ** Copyright (c) Microsoft Corporation
 7           **
 8 krisbash 1.3 ** 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 mike     1.1 **
14              ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 krisbash 1.3 ** 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 mike     1.1 **
19 krisbash 1.3 ** See the Apache 2 License for the specific language governing permissions
20 mike     1.1 ** and limitations under the License.
21              **
22              **==============================================================================
23              */
24              
25              //==============================================================================
26              //
27              // cmodule.h - source code template for generating 'module.c'.
28              //
29              //==============================================================================
30              
31              #ifndef _migen_cmodule_t_h
32              #define _migen_cmodule_t_h
33              
34              //==============================================================================
35              //
36              // MODULE_C_TEMPLATE
37              //
38              //==============================================================================
39              
40              #define MODULE_C_TEMPLATE_1 "\
41 mike     1.1 #include <MI.h>\n\
42              \n\
43              MI_EXTERN_C MI_SchemaDecl <SCHEMADECL>;\n\
44              \n\
45              void MI_CALL Load(MI_Module_Self** self, struct _MI_Context* context)\n\
46              {\n\
47                  *self = NULL;\n\
48 krisbash 1.3     MI_Context_PostResult(context, MI_RESULT_OK);\n\
49 mike     1.1 }\n\
50              \n\
51              void MI_CALL Unload(MI_Module_Self* self, struct _MI_Context* context)\n\
52              {\n\
53 krisbash 1.3     MI_Context_PostResult(context, MI_RESULT_OK);\n\
54 mike     1.1 }\n\
55              \n"
56              
57              #define MODULE_C_TEMPLATE_2 "\
58              MI_EXTERN_C MI_EXPORT MI_Module* MI_MAIN_CALL <ENTRYPOINT>(MI_Server* server)\n\
59              {\n\
60                  /* WARNING: THIS FUNCTION AUTOMATICALLY GENERATED. PLEASE DO NOT EDIT. */\n\
61                  extern MI_Server* __mi_server;\n\
62                  static MI_Module module;\n\
63                  __mi_server = server;\n";
64              
65              #define MODULE_C_TEMPLATE_3 "\
66                  module.charSize = sizeof(MI_Char);\n\
67                  module.version = MI_VERSION;\n\
68                  module.generatorVersion = <VERSION>;\n\
69                  module.schemaDecl = &<SCHEMADECL>;\n\
70                  module.Load = Load;\n\
71                  module.Unload = Unload;\n\
72                  return &module;\n\
73              }"
74              
75 mike     1.1 #define STUBS_LOAD_UNLOAD_TEMPLATE "\
76              \n\
77              MI_EXTERN_C MI_SchemaDecl <SCHEMADECL>;\n\
78              \n\
79              void MI_CALL Load(MI_Module_Self** self, struct _MI_Context* context)\n\
80              {\n\
81                  *self = (MI_Module_Self*)new Module;\n\
82 krisbash 1.3     MI_Context_PostResult(context, MI_RESULT_OK);\n\
83 mike     1.1 }\n\
84              \n\
85              void MI_CALL Unload(MI_Module_Self* self, struct _MI_Context* context)\n\
86              {\n\
87                  Module* module = (Module*)self;\n\
88                  delete module;\n\
89 krisbash 1.3     MI_Context_PostResult(context, MI_RESULT_OK);\n\
90 mike     1.1 }\n\
91              \n"
92              
93              #endif /* _migen_cmodule_t_h */

ViewCVS 0.9.2