ARIF_QUERY(3)
π NAME π
arif_query β query for candidates π
β¨
okay bestie, this is the ARIF User Manual page for arif_query, and itβs giving βask the IME for candidatesβ energy. no cap.
π¦ SYNOPSIS π¦
#include <arif.h>
int
arif_query (
struct arif_ctx *ctx,
char const *line,
int offset,
int len
);
β¨ DESCRIPTION β¨
The arif_query() function queries the input method engine associated with input context ctx for candidates to replace the given input text line. Candidates can be later obtained using the arif_fetch(3) function. iconic behavior, honestly.
The actual text to query for candidates starts at offset byte offset, and has a length of len bytes. The IME may look at the text before offset, so it should not contain garbage data. vibe check: keep that pre-offset text clean, fr fr.
The caller is free to modify or deallocate line after the arif_query() call, since the function keeps its copy inside ctx. slay, your line is free to touch after the call.
If the text referred to by line and len is empty, or identical to the previous text, this function has no effect. literally nothing happens, bestie.
π₯ Trailing digits π₯
If the input text contains trailing ASCII digits, the function removes them (by modifying len) before sending the text to IME. Meanwhile, if the remaining text is identical to the text from the last query, the aforementioned digits are converted into an integer and then used as an index to select a candidate from the current page. the way that digits can just become a candidate selector? obsessed.
When a candidate is selected, candidates from the previous query are replaced by a single candidate page containing only the selected candidate. If the integer cannot be used to select a valid candidate, it is ignored.
See the βInlined candidate selectionβ subsection in NOTES for the rationale behind this.
π RETURN VALUES π
Returns the byte length of the input text after removing the trailing digits. periodt.
π NOTES π
π Inlined candidate selection π
In a typical input method framework, numeric keys are used for candidate selection. The ARIF library, however, is designed to work with line editors like GNU Readline, where numeric keys serve the same purpose as alphabet keys. iykyk.
In an arif_query() function call, a candidate selection request can be inlined into the input text. This approach works well with Readlineβs completion API, and eliminates the need to hack the keymap. main character energy for real.
π COPYRIGHT π
Copyright (C) 2023 CismonX <admin@cismon.net>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
You should have received a copy of the license along with this document. If not, see https://www.gnu.org/licenses/fdl-1.3.html.
π SEE ALSO π
thatβs the whole page, bestie β version 0.1.0, dated Jan 02, 2023, page ARIF_QUERY(3). mwah πβ¨
π¦ where this page comes from
- alpine 3.24: arif-doc 0.3.0-r1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms