Ensured function names are trimmed using the same code as documentation and function parameters.

Improved trimming for functions with '64' suffices.
This commit is contained in:
the_fiddler 2011-12-07 00:01:48 +00:00
parent 5ee3013e49
commit 59cfdf4664
6 changed files with 2727 additions and 1544 deletions

View file

@ -41,7 +41,7 @@ namespace Bind
{
const string Path = "/signatures/replace/function[@name='{0}' and @extension='{1}']";
static readonly Regex Endings =
new Regex(@"((((d|f|fi)|u?[isb])_?v?)|v)", RegexOptions.Compiled | RegexOptions.RightToLeft);
new Regex(@"((((d|f|fi)|(L?u?[isb]))_?(64)?v?)|(64)|v)", RegexOptions.Compiled | RegexOptions.RightToLeft);
static readonly Regex EndingsNotToTrim =
new Regex("(ib|[tdrey]s|[eE]n[vd]|bled|Flag|Tess|Status|Pixels|Instanced|Indexed|Varyings|Boolean|IDs)", RegexOptions.Compiled | RegexOptions.RightToLeft);
static readonly Regex EndingsAddV = new Regex("^0", RegexOptions.Compiled);
@ -76,7 +76,7 @@ namespace Bind
}
// Trims unecessary suffices from the specified OpenGL function name.
static string TrimName(string name, bool keep_extension)
public static string TrimName(string name, bool keep_extension)
{
string trimmed_name = Utilities.StripGL2Extension(name);
string extension = Utilities.GetGL2Extension(name);

View file

@ -122,33 +122,7 @@ namespace Bind.Structures
}
else
{
TrimmedName = Utilities.StripGL2Extension(value);
Match m = endingsNotToTrim.Match(TrimmedName);
if ((m.Index + m.Length) != TrimmedName.Length)
{
// Some endings should not be trimmed, for example: 'b' from Attrib
m = endings.Match(TrimmedName);
if (m.Length > 0 && m.Index + m.Length == TrimmedName.Length)
{
// Only trim endings, not internal matches.
if (m.Value[m.Length - 1] == 'v' && endingsAddV.IsMatch(Name) &&
!Name.StartsWith("Get") && !Name.StartsWith("MatrixIndex"))
{
// Only trim ending 'v' when there is a number
TrimmedName = TrimmedName.Substring(0, m.Index) + "v";
}
else
{
if (!TrimmedName.EndsWith("xedv"))
TrimmedName = TrimmedName.Substring(0, m.Index);
else
TrimmedName = TrimmedName.Substring(0, m.Index + 1);
}
}
}
TrimmedName = FuncProcessor.TrimName(Name, false);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1736,7 +1736,7 @@ namespace OpenTK.Graphics.OpenGL
internal extern static unsafe void GetBooleanv(OpenTK.Graphics.OpenGL.GetPName pname, [OutAttribute] bool* @params);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBufferParameteri64v", ExactSpelling = true)]
internal extern static unsafe void GetBufferParameteri64v(OpenTK.Graphics.OpenGL.Version32 target, OpenTK.Graphics.OpenGL.Version32 pname, [OutAttribute] Int64* @params);
internal extern static unsafe void GetBufferParameteri64v(OpenTK.Graphics.OpenGL.BufferTarget target, OpenTK.Graphics.OpenGL.BufferParameterName pname, [OutAttribute] Int64* @params);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetBufferParameteriv", ExactSpelling = true)]
internal extern static unsafe void GetBufferParameteriv(OpenTK.Graphics.OpenGL.BufferTarget target, OpenTK.Graphics.OpenGL.BufferParameterName pname, [OutAttribute] Int32* @params);
@ -2324,7 +2324,7 @@ namespace OpenTK.Graphics.OpenGL
internal extern static unsafe void GetQueryivARB(OpenTK.Graphics.OpenGL.ArbOcclusionQuery target, OpenTK.Graphics.OpenGL.ArbOcclusionQuery pname, [OutAttribute] Int32* @params);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetQueryObjecti64v", ExactSpelling = true)]
internal extern static unsafe void GetQueryObjecti64v(UInt32 id, OpenTK.Graphics.OpenGL.ArbTimerQuery pname, [OutAttribute] Int64* @params);
internal extern static unsafe void GetQueryObjecti64v(UInt32 id, OpenTK.Graphics.OpenGL.GetQueryObjectParam pname, [OutAttribute] Int64* @params);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetQueryObjecti64vEXT", ExactSpelling = true)]
internal extern static unsafe void GetQueryObjecti64vEXT(UInt32 id, OpenTK.Graphics.OpenGL.ExtTimerQuery pname, [OutAttribute] Int64* @params);
@ -2336,7 +2336,7 @@ namespace OpenTK.Graphics.OpenGL
internal extern static unsafe void GetQueryObjectivARB(UInt32 id, OpenTK.Graphics.OpenGL.ArbOcclusionQuery pname, [OutAttribute] Int32* @params);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetQueryObjectui64v", ExactSpelling = true)]
internal extern static unsafe void GetQueryObjectui64v(UInt32 id, OpenTK.Graphics.OpenGL.ArbTimerQuery pname, [OutAttribute] UInt64* @params);
internal extern static unsafe void GetQueryObjectui64v(UInt32 id, OpenTK.Graphics.OpenGL.GetQueryObjectParam pname, [OutAttribute] UInt64* @params);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glGetQueryObjectui64vEXT", ExactSpelling = true)]
internal extern static unsafe void GetQueryObjectui64vEXT(UInt32 id, OpenTK.Graphics.OpenGL.ExtTimerQuery pname, [OutAttribute] UInt64* @params);

View file

@ -1734,7 +1734,7 @@ namespace OpenTK.Graphics.OpenGL
internal unsafe delegate void GetBooleanv(OpenTK.Graphics.OpenGL.GetPName pname, [OutAttribute] bool* @params);
internal unsafe static GetBooleanv glGetBooleanv;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void GetBufferParameteri64v(OpenTK.Graphics.OpenGL.Version32 target, OpenTK.Graphics.OpenGL.Version32 pname, [OutAttribute] Int64* @params);
internal unsafe delegate void GetBufferParameteri64v(OpenTK.Graphics.OpenGL.BufferTarget target, OpenTK.Graphics.OpenGL.BufferParameterName pname, [OutAttribute] Int64* @params);
internal unsafe static GetBufferParameteri64v glGetBufferParameteri64v;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void GetBufferParameteriv(OpenTK.Graphics.OpenGL.BufferTarget target, OpenTK.Graphics.OpenGL.BufferParameterName pname, [OutAttribute] Int32* @params);
@ -2322,7 +2322,7 @@ namespace OpenTK.Graphics.OpenGL
internal unsafe delegate void GetQueryivARB(OpenTK.Graphics.OpenGL.ArbOcclusionQuery target, OpenTK.Graphics.OpenGL.ArbOcclusionQuery pname, [OutAttribute] Int32* @params);
internal unsafe static GetQueryivARB glGetQueryivARB;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void GetQueryObjecti64v(UInt32 id, OpenTK.Graphics.OpenGL.ArbTimerQuery pname, [OutAttribute] Int64* @params);
internal unsafe delegate void GetQueryObjecti64v(UInt32 id, OpenTK.Graphics.OpenGL.GetQueryObjectParam pname, [OutAttribute] Int64* @params);
internal unsafe static GetQueryObjecti64v glGetQueryObjecti64v;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void GetQueryObjecti64vEXT(UInt32 id, OpenTK.Graphics.OpenGL.ExtTimerQuery pname, [OutAttribute] Int64* @params);
@ -2334,7 +2334,7 @@ namespace OpenTK.Graphics.OpenGL
internal unsafe delegate void GetQueryObjectivARB(UInt32 id, OpenTK.Graphics.OpenGL.ArbOcclusionQuery pname, [OutAttribute] Int32* @params);
internal unsafe static GetQueryObjectivARB glGetQueryObjectivARB;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void GetQueryObjectui64v(UInt32 id, OpenTK.Graphics.OpenGL.ArbTimerQuery pname, [OutAttribute] UInt64* @params);
internal unsafe delegate void GetQueryObjectui64v(UInt32 id, OpenTK.Graphics.OpenGL.GetQueryObjectParam pname, [OutAttribute] UInt64* @params);
internal unsafe static GetQueryObjectui64v glGetQueryObjectui64v;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void GetQueryObjectui64vEXT(UInt32 id, OpenTK.Graphics.OpenGL.ExtTimerQuery pname, [OutAttribute] UInt64* @params);

View file

@ -21602,7 +21602,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.GetQueryObjecti64, GL.GetQueryObjectui64
/// Not used directly.
/// </summary>
public enum ArbTimerQuery : int
{
@ -29280,7 +29280,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.Ext.GetQueryObjecti64, GL.Ext.GetQueryObjectui64
/// Used in GL.Ext.GetQueryObject
/// </summary>
public enum ExtTimerQuery : int
{
@ -36611,7 +36611,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.NV.GetVideoi64, GL.NV.GetVideo, GL.NV.GetVideoui64, GL.NV.PresentFrameDualFill, GL.NV.PresentFrameKeye
/// Used in GL.NV.GetVideo, GL.NV.PresentFrameDualFill, GL.NV.PresentFrameKeye
/// </summary>
public enum NvPresentVideo : int
{
@ -36911,7 +36911,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.NV.GetBufferParameterui64, GL.NV.GetIntegerui64, GL.NV.GetNamedBufferParameterui64, GL.NV.IsBufferResident, GL.NV.MakeBufferNonResident, GL.NV.MakeBufferResident, GL.NV.MakeNamedBufferResident
/// Used in GL.NV.GetBufferParameter, GL.NV.GetInteger, GL.NV.GetNamedBufferParameter, GL.NV.IsBufferResident, GL.NV.MakeBufferNonResident, GL.NV.MakeBufferResident, GL.NV.MakeNamedBufferResident
/// </summary>
public enum NvShaderBufferLoad : int
{
@ -37828,7 +37828,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.NV.GetVertexAttribLi64, GL.NV.GetVertexAttribLui64, GL.NV.VertexAttribLFormat
/// Used in GL.NV.GetVertexAttrib, GL.NV.VertexAttribLFormat
/// </summary>
public enum NvVertexAttribInteger64bit : int
{
@ -51169,7 +51169,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.GetBufferParameteri64, GL.GetInteger64
/// Used in GL.GetInteger64
/// </summary>
public enum Version32 : int
{