void GetFunctionNameAndType(string[] words, out string funcname, out string rettype)
{
funcname = null;
rettype = null;
bool inRettype = false;
bool quit = false;
for (int i = 0; !quit && i < words.Length; ++i) {
switch (words [i]) {
case "const":
// ignore
break;
case "GLAPI": // ES 1.0
case "GL_API": // ES 1.1
case "GL_APICALL": // ES 2.0
case "CL_API_ENTRY": // CL 1.0
inRettype = true;
break;
case "APIENTRY": // ES 1.0
case "GL_APIENTRY": // ES 1.1 & 2.0
case "CL_API_CALL": // CL 1.0
inRettype = false;
funcname = words [i+1].Substring(Prefix.Length);
quit = true;
break;
default:
if (inRettype)
rettype += words [i];
break;
}
}
}
}