Fields in list data, names of source nodes, and everything in between use human readable text to represent their identity. When working with the Data API, ink_ident is used to represent these names. Reasons for using ink_ident instead of raw strings is largely for performance and program complexity.

An ink_ident is a 64 bit integer, with a few APIs to handle converting to and from text.

Automatic Identifier Generation

A project's settings file has options for generating code that maps between all identifiers used in quill and constant language specific identifiers.

For example, take the following configuration in a project's quill.toml file:

identifiers_c = "idents.h"
identifiers_cs = "I.cs"
identifiers_rust = ""
identifiers_java = ""

Will cause Quill to create something that might look like this:

Which would allow you to use these identifier constants instead of calling ink_ident_from_str.

Identifiers generated by Quill have their original string value saved in gui.bin. Upon loading they are added to the reverse lookup cache and accessible from ink_ident_as_char.


Convert a string to an identifier:

ink_ident ink_ident_from_str(const char*);
ink_ident ink_ident_from_strn(const char* str, size_t len);

Convert a string to an identifier without adding it to the reverse lookup cache:

ink_ident ink_ident_from_strn_no_reverse(const char* str, size_t len);

Adds a string to the reverse lookup cache:

void ink_ident_add_reverse(const char* str, size_t len);

Retrieve the string that was used to create the ident, returns null if the ident doesn't exist in the reverse lookup cache:

const char* ink_ident_as_char(ink_ident);