A fully-qualified C-like identifier of this model entity.

The C-name is a name that respects the rule of identifiers in the C language: it is only made of alphanumeric characters and starts with a letter (or a underscore).

The C-name can be seen as a mangled version of the full_name. Therefore, it is expected to be unique and unambiguous in lawful Nit models for the same kind of entity.

The C-name is used by tools that need some identifiers in generated files to designate the entity.

Is is not suitable to use it directly with the user (e.g. in message) and indirect use should be restricted (e.g. to name a web-page)

Property definitions

nitc $ MEntity :: c_name
	# A fully-qualified C-like identifier of this model entity.
	#
	# The C-name is a name that respects the rule of identifiers in the C language:
	# it is only made of alphanumeric characters and starts with a letter (or a underscore).
	#
	# The C-name can be seen as a mangled version of the `full_name`.
	# Therefore, it is expected to be unique and unambiguous in lawful Nit models for the same kind of entity.
	#
	# The C-name is used by tools that need some identifiers in generated files to designate the
	# entity.
	#
	# Is is not suitable to use it directly with the user (e.g. in message) and
	# indirect use should be restricted (e.g. to name a web-page)
	fun c_name: String is abstract
src/model/model_base.nit:59,2--72,31

nitc $ MClass :: c_name
	redef var c_name is lazy do
		return "{intro_mmodule.c_namespace_for(visibility)}__{name.to_cmangle}"
	end
src/model/model.nit:456,2--458,4

nitc $ MPackage :: c_name
	redef var c_name = name.to_cmangle is lazy
src/model/mpackage.nit:33,2--43

nitc $ MProperty :: c_name
	redef var c_name is lazy do
		# FIXME use `namespace_for`
		return "{intro_mclassdef.mmodule.c_name}__{intro_mclassdef.mclass.name.to_cmangle}__{name.to_cmangle}"
	end
src/model/model.nit:2185,2--2188,4

nitc $ MModule :: c_name
	# Return the name of the global C identifier associated to `self`.
	# This name is used to prefix files and other C identifiers associated with `self`.
	redef var c_name is lazy do
		var g = mgroup
		var res
		if g != null and g.mpackage.name != name then
			res = g.mpackage.name.to_cmangle + "__" + name.to_cmangle
		else
			res = name.to_cmangle
		end
		return res
	end
src/model/mmodule.nit:145,2--156,4

nitc $ MClassType :: c_name
	redef fun c_name do return mclass.c_name
src/model/model.nit:1309,2--41

nitc $ MNullType :: c_name
	redef fun c_name do return "null"
src/model/model.nit:1898,2--34

nitc $ MBottomType :: c_name
	redef fun c_name do return "bottom"
src/model/model.nit:1925,2--36

nitc $ MErrorType :: c_name
	redef fun c_name do return "error"
src/model/model.nit:1951,2--35

nitc $ MGenericType :: c_name
	redef var c_name is lazy do
		var res = mclass.c_name
		# Note: because the arity is known, a prefix notation is enough
		for t in arguments do
			res += "__"
			res += t.c_name
		end
		return res.to_s
	end
src/model/model.nit:1434,2--1442,4

nitc $ MVirtualType :: c_name
	redef fun c_name do return self.mproperty.c_name
src/model/model.nit:1620,2--49

nitc $ MParameterType :: c_name
	redef var c_name is lazy do return mclass.c_name + "__" + "#{name}".to_cmangle
src/model/model.nit:1671,2--79

nitc $ MNullableType :: c_name
	redef var c_name is lazy do return "nullable__{mtype.c_name}"
src/model/model.nit:1843,2--62

nitc $ MNotNullType :: c_name
	redef var c_name is lazy do return "notnull__{mtype.c_name}"
src/model/model.nit:1871,2--61