glLoadGen / modules / CommonStruct.lua

local common = {}

--Iterates over all requested extensions
--Calls Extension(hFile, extName, spec, options)
local extensions = 
{ type="group",
	{ type="ext-iter",
		{ type="write", name="Extension(hFile, extName, spec, options)", },
	},
}

function common.Extensions() return extensions end

--Iterates over every enumerator, in order:
-- Requested extension enums.
-- For each version:
--  Core extension enumerators from version X
--  Core enumerators from version X
-- Calls Enumerator(hFile, enum, enumTable, spec, options, enumSeen)
-- Optional small headers
local enumerators =
{ type="group",
{ type="enum-seen",
	{ type="ext-iter",
		{type="enum-iter",
			{ type="write", name="SmallHeader(hFile, value, options)", value="Extension: %extName", first=true, optional=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, optional=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, optional=true},
			{ type="write", name="Enumerator(hFile, enum, enumTable, spec, options, enumSeen)", },
			{ type="blank", last=true },
		},
	},
},
}

function common.Enumerators() return enumerators end

--Iterates over each function, in order:
-- Requested extension functions.
-- For each version:
--  Core extensions from for version X
--  Core functions from version X
-- Calls Function(hFile, func, typemap, spec, options, funcSeen)
-- Optional small headers.
-- Can provide an optional ending table, that will be placed within
-- the "func-seen" block.
function common.Functions(ending)
	ending = ending or { type="group" }
	return
	{ type="func-seen",
		{ type="ext-iter",
			{type="func-iter",
				{ type="write", name="SmallHeader(hFile, value, options)", value="Extension: %extName", first=true, optional=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, optional=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, optional=true},
				{ type="write", name="Function(hFile, func, typemap, spec, options, funcSeen)", },
				{ type="blank", last=true },
			},
		},
		ending,
	}
end

return common
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.