1 #include <Config/Section/Options.oh>
2 #include <Exception.oh>
3 #include <Object.oh>
4 #include <TextRider.oh>
5 #include <LongStrings.oh>
6 #include <XML/Builder.oh>
7 #include <XML/DTD.oh>
8 #define Config_Section_Options__invalidContent 1
9 #define Config_Section_Options__invalidAttribute 2
10 #define Config_Section_Options__requireNameAttribute 3
11 #define Config_Section_Options__requireTypeAttribute 4
12 #define Config_Section_Options__requireCharDataContent 5
13 #define Config_Section_Options__optionAlreadyDefined 6
14 #define Config_Section_Options__optionNotDefined 7
15 #define Config_Section_Options__unknownType 8
16 #define Config_Section_Options__invalidValue 9
17 static Config_Section_Options__ErrorContext Config_Section_Options__optionsContext;
18 static void Config_Section_Options__InitOption(Config_Section_Options__Option opt, Object__String name, Config__Variable value);
19 static Config_Section_Options__Option Config_Section_Options__NewOption(Object__String name, Config__Variable value);
20 static void Config_Section_Options__Insert(Config_Section_Options__Option *list, Config_Section_Options__Option opt);
21 
22 /* run-time meta data */
23 static RT0__ModuleDesc _mid;
24 RT0__StructDesc _td_Config_Section_Options__Section = { (RT0__Struct[]){&_td_Config_Section_Options__SectionDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"Section", 8, -1, 0, RT0__strPointer };
25 RT0__StructDesc _td_Config_Section_Options__Option = { (RT0__Struct[]){&_td_Config_Section_Options__OptionDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"Option", 8, -1, 0, RT0__strPointer };
26 RT0__StructDesc _td_Config_Section_Options__SectionDesc = { (RT0__Struct[]){&_td_Config_Section__SectionDesc,&_td_Config_Section_Options__SectionDesc}, (void*[]){(void*)Config_Section_Options__SectionDesc_ProcessElements,(void*)Config_Section_Options__SectionDesc_DumpContent,(void*)Config_Section_Options__SectionDesc_Get,(void*)Config_Section_Options__SectionDesc_Set,(void*)Config_Section_Options__SectionDesc_GetValue,(void*)Config_Section_Options__SectionDesc_Copy,(void*)Config_Section_Options__SectionDesc_Clone}, NULL, &_mid, (OOC_CHAR8*)"SectionDesc", 24, 1, 0, RT0__strRecord };
27 RT0__StructDesc _td_Config_Section_Options__OptionDesc = { (RT0__Struct[]){&_td_Config_Section_Options__OptionDesc}, (void*[]){(void*)Config_Section_Options__OptionDesc_Set}, NULL, &_mid, (OOC_CHAR8*)"OptionDesc", 24, 0, 0, RT0__strRecord };
28 RT0__StructDesc _td_Config_Section_Options__ErrorContext = { (RT0__Struct[]){&_td_Config_Section_Options__ErrorContextDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"ErrorContext", 8, -1, 0, RT0__strPointer };
29 RT0__StructDesc _td_Config_Section_Options__ErrorContextDesc = { (RT0__Struct[]){&_td_Msg__ContextDesc,&_td_XML_Error__ContextDesc,&_td_Config_Section__ErrorContextDesc,&_td_Config_Section_Options__ErrorContextDesc}, (void*[]){(void*)Config_Section_Options__ErrorContextDesc_GetTemplate,(void*)XML_Error__ContextDesc_WriteTemplate,(void*)XML_Error__ContextDesc_SetString}, NULL, &_mid, (OOC_CHAR8*)"ErrorContextDesc", 16, 3, 0, RT0__strRecord };
30 RT0__StructDesc _td_Config_Section_Options__992 = { (RT0__Struct[]){&RT0__longchar}, NULL, NULL, &_mid, NULL, 256, 128, (1<<RT0__flagAtomic), RT0__strArray };
31 RT0__StructDesc _td_Config_Section_Options__8494 = { (RT0__Struct[]){&RT0__char}, NULL, NULL, &_mid, NULL, 2048, 2048, (1<<RT0__flagAtomic), RT0__strArray };
32 static RT0__ModuleDesc _mid = { (OOC_CHAR8*)"Config:Section:Options", (RT0__Struct[]) { &_td_Config_Section_Options__Section, &_td_Config_Section_Options__Option, &_td_Config_Section_Options__SectionDesc, &_td_Config_Section_Options__OptionDesc, &_td_Config_Section_Options__ErrorContext, &_td_Config_Section_Options__ErrorContextDesc, NULL }, 0 };
33 
OOC_Config_Section_Options_open(RT0__Module client)34 extern void OOC_Config_Section_Options_open(RT0__Module client) {
35   if (_mid.openCount == 0) {
36     OOC_Exception_open(&_mid);
37     OOC_Object_open(&_mid);
38     OOC_Msg_open(&_mid);
39     OOC_Channel_open(&_mid);
40     OOC_TextRider_open(&_mid);
41     OOC_LongStrings_open(&_mid);
42     OOC_XML_Builder_open(&_mid);
43     OOC_XML_DTD_open(&_mid);
44     OOC_XML_Locator_open(&_mid);
45     OOC_Config_open(&_mid);
46     OOC_Config_Parser_open(&_mid);
47     OOC_Config_Section_open(&_mid);
48     OOC_RT0_open(&_mid);
49     OOC_Object_open(&_mid);
50     OOC_Exception_open(&_mid);
51 
52     RT0__RegisterModule(&_mid);
53     OOC_Config_Section_Options_init();
54   }
55   _mid.openCount++;
56 }
OOC_Config_Section_Options_close(RT0__Module client)57 extern void OOC_Config_Section_Options_close(RT0__Module client) {
58   _mid.openCount--;
59   if (_mid.openCount == 0) {
60     OOC_Config_Section_Options_destroy();
61     RT0__UnregisterModule(&_mid);
62 
63     OOC_Exception_close(&_mid);
64     OOC_Object_close(&_mid);
65     OOC_Msg_close(&_mid);
66     OOC_Channel_close(&_mid);
67     OOC_TextRider_close(&_mid);
68     OOC_LongStrings_close(&_mid);
69     OOC_XML_Builder_close(&_mid);
70     OOC_XML_DTD_close(&_mid);
71     OOC_XML_Locator_close(&_mid);
72     OOC_Config_close(&_mid);
73     OOC_Config_Parser_close(&_mid);
74     OOC_Config_Section_close(&_mid);
75     OOC_RT0_close(&_mid);
76     OOC_Object_close(&_mid);
77     OOC_Exception_close(&_mid);
78   }
79 }
80 
81 /* --- */
82