(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           ** 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           //==============================================================================
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           #include <MI.h>\n\
42           \n\
43 mike  1.1 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           }\n\
49           \n\
50           void MI_CALL Unload(MI_Module_Self* self, struct _MI_Context* context)\n\
51           {\n\
52           }\n\
53           \n"
54           
55           #define MODULE_C_TEMPLATE_2 "\
56           MI_EXTERN_C MI_EXPORT MI_Module* MI_MAIN_CALL <ENTRYPOINT>(MI_Server* server)\n\
57           {\n\
58               /* WARNING: THIS FUNCTION AUTOMATICALLY GENERATED. PLEASE DO NOT EDIT. */\n\
59               extern MI_Server* __mi_server;\n\
60               static MI_Module module;\n\
61               __mi_server = server;\n";
62           
63           #define MODULE_C_TEMPLATE_3 "\
64 mike  1.1     module.charSize = sizeof(MI_Char);\n\
65               module.version = MI_VERSION;\n\
66               module.generatorVersion = <VERSION>;\n\
67               module.schemaDecl = &<SCHEMADECL>;\n\
68               module.Load = Load;\n\
69               module.Unload = Unload;\n\
70               return &module;\n\
71           }"
72           
73           #define STUBS_LOAD_UNLOAD_TEMPLATE "\
74           \n\
75           MI_EXTERN_C MI_SchemaDecl <SCHEMADECL>;\n\
76           \n\
77           void MI_CALL Load(MI_Module_Self** self, struct _MI_Context* context)\n\
78           {\n\
79               *self = (MI_Module_Self*)new Module;\n\
80           }\n\
81           \n\
82           void MI_CALL Unload(MI_Module_Self* self, struct _MI_Context* context)\n\
83           {\n\
84               Module* module = (Module*)self;\n\
85 mike  1.1     delete module;\n\
86           }\n\
87           \n"
88           
89           #endif /* _migen_cmodule_t_h */

ViewCVS 0.9.2