What are @ variables in Vala?

I am trying to debug the pantheon-greeter application for my Ubuntu installation but the problem is that I just a beginner to Vala.

Where and how are these variables set ?

The code below is not correct please check the link mentioned above. I had to remove @ signs because the question parser did not allow me to put them in.

namespace Constants {
public const string CONF_DIR = “aCONF_DIRa”;
public const string GETTEXT_PACKAGE = “aGETTEXT_PACKAGEa”;
public const string GSD_DIR = “aGSD_DIRa”;
public const string VERSION = “aVERSIONa”;
}

What are @ variables in vala ?
Are they command line variables or environment variables or something else entirely ?

The config.vala.in file is a “template file”; it is processed during the build to generate the config.vala file that will then be used. The @NAME@ variables are expanded by Meson to their value as determined during the project’s configuration, via the configure_file() function:

conf_data = configuration_data()
conf_data.set('CONF_DIR', join_paths(get_option('sysconfdir'), 'lightdm'))
conf_data.set('GETTEXT_PACKAGE', meson.project_name())

[...]

conf_data.set('GSD_DIR', gsd_dir)
conf_data.set('VERSION', meson.project_version())
config_header = configure_file (
    input: 'config.vala.in',
    output: 'config.vala',
    configuration: conf_data
)

More information about configure_file() is available on the Meson website.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.