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