final class · System.Bindings

CFunction

public final class CFunction

A C function the library exports: an [Import] of the binding.

Tipo
final class
Espacio de nombres
System.Bindings
Ensamblado
System.Bindings
Acceso
public, final
Archivo fuente
Model.ant

Herencia

Clases base
Any CFunction

Constructores

new(str entry, str header, CType result)
#

Métodos

Add(str cName, str type, str typedef) : CFunction
#

Adds a parameter (the model is built this way).

Parameter(str cName) : CParameter?
#

The parameter named cName in C.

Campos

str Entry
#

The C symbol (what the library exports; never changed).

str Name
#

Its name in the binding.

str Namespace
#

Where it goes: "" is the settings' (or the header's, with NamespaceByHeader / ClassByHeader).

str Class
#
str File
#
List<CParameter> Parameters
#
CType Result
#

Miembros heredados (5)

Código fuente

CFunction en Antril, descompilado a partir de su Larva HIR.

System.Bindings.CFunction.ant
// System.Bindings.CFunction — System.Bindings (decompiled from Larva HIR)

import System;

into namespace System.Bindings
{
	/// A C function the library exports: an `[Import]` of the binding.
	public final class CFunction
	{
		public:
			/// The C symbol (what the library exports; never changed).
			str Entry;

			/// Its name in the binding.
			str Name;

			/// The header that declares it ("" when not known).
			str Header;

			/// Where it goes: "" is the settings' (or the header's, with NamespaceByHeader / ClassByHeader).
			str Namespace;
			str Class;
			str File;
			List<CParameter> Parameters;
			CType Result;

			new(str entry, str header, CType result)
			{
				Namespace = "";
				Class = "";
				File = "";
				Parameters = new List<CParameter>();
				Entry = entry;
				Name = entry;
				Header = header;
				Result = result;
			}

			/// Adds a parameter (the model is built this way).
			Add(str cName, str type, str typedef) : CFunction
			{
				Parameters.Add(new CParameter(cName, new CType(type, typedef)));
				return this;
			}

			/// The parameter named `cName` in C.
			Parameter(str cName) : CParameter? => Parameters.Any(p => p.CName == cName) ? Parameters.First(p => p.CName == cName) : null;
	}
}
Esc