ARIF_FETCH(3)
π ARIF_FETCH(3) β fetch candidates π
okay bestie, welcome to the ARIF User Manual page for arif_fetch(3). This function is lowkey the candidate-fetching main character, and we're gonna get you comfy with it. No cap. π«Ά
π NAME π
arif_fetch β fetch candidates. That's the whole job description, and it ate. β¨
πΈ SYNOPSIS πΈ
#include <arif.h>
int
arif_fetch (
struct arif_ctx *ctx,
struct arif_cand const **candidates_ptr
);
π¦ DESCRIPTION π¦
Okay so the arif_fetch() function fetches all candidates from the current page of the input context ctx into an array of struct arif_cand, and stores a pointer to that array into candidates_ptr. The array is valid until the next time arif_query(3) is called with new input text. So like, it's giving borrowed-pointer era β don't keep staring at it after the next query, bestie. π
π« Candidates π«
A candidate is a piece of text generated by an IME that is meant to replace part of the original input text. Tiny replacement text with main character energy, honestly.
The struct arif_cand type is defined as:
struct arif_cand {
char const *text;
int text_len;
int replace_start;
int replace_len;
char const *transform;
int transform_len;
char const *display;
int display_len;
};
textβ the actual text of the candidate, andlenis its length in bytes. (Yes, the page sayslenhere β I'm not gonna gaslight you.)replace_lenβ the number of leading bytes of the original text that are meant to be replaced by the candidate, starting from byte offsetreplace_start. Byte math, but make it fashion π .transformβ should the original text passed toarif_query(3)be transformed into another text when selecting this candidate, the resulting text is put intotransform, andtransform_lenis its length in bytes. Otherwise,transformvalue isNULL. No transform, no problem.displayβ the text to display when listing candidates for the user to choose.display_lenis its length in bytes. This is the candidate's little outfit for the UI π.
π RETURN VALUES π
Returns the number of items in the array stored to candidates_ptr. That's it, that's the number. Count 'em, bestie. π₯
π 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 π
kisses and byte-aligned dreams π this page is from version 0.1.0, dated Jan 02, 2023. ARIF_FETCH(3) out. π
π¦ 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