final class · System.Bindings

CFunction

public final class CFunction

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

Kind
final class
Namespace
System.Bindings
Assembly
System.Bindings
Access
public, final
Source file
Model.ant

Inheritance

Base classes
Any CFunction

Constructors

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

Methods

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.

Fields

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
#

Inherited members (5)

Source

CFunction as Antril, decompiled from its 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