Better doc comments for desktop_entry

This commit is contained in:
Sasha Koshka 2024-10-05 00:51:10 -04:00
parent 0b464d368c
commit baea275b66

View File

@ -30,7 +30,7 @@ export type entry = struct {
value: value,
};
// A localized entry.
// A localized key/value pair.
// Specification: §5
export type localized_entry = struct {
key: str,
@ -43,8 +43,8 @@ export type localized_entry = struct {
// this module are called, so [[value_dup]] is required to extend its lifetime.
export type value = (str | bool | f32);
// Gets a non-localized value from a file. If the group does not exist, or the
// group exists but the key isn't in it, it returns void.
// Gets a non-localized value from a [[file]]. If the group does not exist, or
// the group exists but the key isn't in it, it returns void.
export fn file_get(fil: *file, group_name: str, key: str) (value | void) = {
let grou = match (file_find_group(fil, group_name)) {
case let index: size => yield &fil.groups[index];
@ -60,10 +60,12 @@ export fn file_get(fil: *file, group_name: str, key: str) (value | void) = {
};
};
// Gets a localized value from a file. If the group does not exist, or the group
// exists but the key isnt in it, it returns void. If the key is in the group
// but is not localized to the specified locale, the non-localized value is
// returned.
// Gets a localized [[value]] from a [[file]]. If the group does not exist, or
// the group exists but the key isnt in it, it returns void. If the key is in
// the group but is not localized to the specified [[locale::locale]], the
// non-localized value is returned. Refer to the specification for the exact way
// which the locale is matched.
// Specification: §5
export fn file_get_localized(
fil: *file,
group_name: str,