Source

glLoadGen / modules / StructNoloadCpp.lua

Diff from to

File modules/StructNoloadCpp.lua

 
 local struct = require "Structure"
+local common = require "CommonStruct"
 
 
-local ext_variables = 
-{ type="group",
-	{ type="write", name="LargeHeader(hFile, value, options)", value="Extension Variables", },
-	{ type="block", name="ExtVariables(hFile, spec, options)",
-		{ type="ext-iter",
-			{ type="write", name="ExtVariable(hFile, extName, spec, options)", },
-		},
-	},
-}
-
-local func_variables =
-{ type="group",
-{ type="func-seen",
-	{ type="ext-iter",
-		{type="func-iter",
-			{ type="write", name="SmallHeader(hFile, value, options)", value="Extension: %extName", first=true},
-			{ type="write", name="Function(hFile, func, typemap, spec, options, funcSeen)", },
-			{ type="blank", last=true },
-		},
-	},
-	{ type="version-iter",
-		{ type="core-ext-cull-iter",
-			{type="func-iter",
-				{ type="write", name="SmallHeader(hFile, value, options)", value="Extension: %extName", first=true},
-				{ type="write", name="Function(hFile, func, typemap, spec, options, funcSeen)", },
-				{ type="blank", last=true },
-			},
-		},
-		{type="func-iter",
-			{ type="write", name="SmallHeader(hFile, value, options)", value="Extension: %version", first=true},
-			{ type="write", name="Function(hFile, func, typemap, spec, options, funcSeen)", },
-			{ type="blank", last=true },
-		},
-	},
-},
-}
-
 local sys_functions =
 { type="block", name="System(hFile, spec, options)",
 	{type="write", name="SetupFunction(hFile, specData, spec, options)", },
 	{type="write", name="VersionFunctions(hFile, specData, spec, options)", cond="version-iter"},
 }
 
-
 local my_struct =
 {
 	{ type="file", style="hdr", name="GetFilename(basename, spec, options)",
 			{ type="blank"},
 			
 			{ type="block", name="MainNamespace(hFile, spec, options)",
-				ext_variables,
+				{ type="write", name="LargeHeader(hFile, value, options)", value="Extension Variables", },
+				{ type="block", name="ExtVariables(hFile, spec, options)",
+					common.Extensions(),
+				},
 				{ type="blank"},
 				{ type="block", name="Enumerators(hFile, spec, options)",
-					{ type="enum-seen",
-						{ type="ext-iter",
-							{type="enum-iter",
-								{ type="write", name="SmallHeader(hFile, value, options)", value="Extension: %extName", first=true},
-								{ type="write", name="Enumerator(hFile, enum, enumTable, spec, options, enumSeen)", },
-								{ type="blank", last=true },
-							},
-						},
-						{ type="version-iter",
-							{ type="core-ext-cull-iter",
-								{type="enum-iter",
-									{ type="write", name="SmallHeader(hFile, value, options)", value="Core Extension: %extName", first=true},
-									{ type="write", name="Enumerator(hFile, enum, enumTable, spec, options, enumSeen)", },
-									{ type="blank", last=true },
-								},
-							},
-							{type="enum-iter",
-								{ type="write", name="SmallHeader(hFile, value, options)", value="Version: %version", first=true},
-								{ type="write", name="Enumerator(hFile, enum, enumTable, spec, options, enumSeen)", },
-								{ type="blank", last=true },
-							},
-						},
-					},
+					common.Enumerators(),
 				},
 				{ type="blank"},
-				func_variables,
+				common.Functions(),
 				sys_functions,
 			},
 		},
 		{ type="write", name="LoaderFunc(hFile, spec, options)", },
 		{ type="blank"},
 		{ type="block", name="MainNamespace(hFile, spec, options)",
-			ext_variables,
+			{ type="block", name="ExtVariables(hFile, spec, options)",
+				common.Extensions(),
+			},
 			{ type="blank"},
 			{ type="group", style="typedefs",
-				func_variables,
+				common.Functions(),
 			},
 			{ type="blank"},
 			{ type="group", style="defs",
-				func_variables,
+				common.Functions(),
 			},
 			{ type="blank"},
 			{ type="group", style="switch",
-				func_variables,
+				common.Functions(),
 			},
 			{ type="blank"},
 			{ type="block", name="Struct(hFile, spec, options)", style="init",
-				func_variables,
+				common.Functions(),
 			},
 			{ type="blank"},
 			sys_functions,