EC_INTERACT_PRINT_ERROR_HELPS(3)

πŸ“¦
version 0.11.7 Β· 4 versions
, in fedora 44

πŸ’… EC_INTERACT_PRINT_ERROR_HELPS(3) β€” bestie edition πŸ’…

okay so this is a page from the Libecoli Programmer's Manual, and it's about ec_interact_print_error_helps. yes that name is a whole mouthful, i know, but stay with me 🫢


✨ NAME ✨

ec_interact_print_error_helps β€” prints out the suggestions that ec_interact_get_error_helps() made for you. like, it does the saying part, the other one does the thinking part. iconic duo behaviour, honestly πŸ‘‘


🌸 SYNOPSIS 🌸

#include <ecoli/interact.h>

int ec_interact_print_error_helps(
    FILE                            *out,       /* The pointer to the output stream. */
    unsigned int                     width,     /* The number of columns on terminal. */
    const char                      *line,      /* The line used to generate the error helps. */
    /*
     * The helps array returned by ec_interact_get_helps().
     */
    const struct ec_interact_help   *helps,
    /*
     * The array size returned by ec_interact_get_helps().
     */
    size_t                           n,
    size_t                           char_idx   /* The index of the error in the line string. */
);

so you hand it:

  • out β€” the pointer to the output stream, aka where the goss gets printed πŸ’¬
  • width β€” the number of columns on the terminal, so it knows how much room it has to work with πŸ“
  • line β€” the line that was used to generate the error helps πŸ“
  • helps β€” the helps array, the one that ec_interact_get_helps() gave you 🎁
  • n β€” the size of that array, also courtesy of ec_interact_get_helps() πŸ”’
  • char_idx β€” the index of the error inside the line string, so it knows exactly where the oopsie is πŸ“

πŸ¦‹ STRUCTURES πŸ¦‹

here's the lil struct that describes a contextual help:

struct ec_interact_help {
};

that's it. that's the whole thing. it's giving minimalist πŸŽ€


⭐ RETURN VALUE ⭐

0 on success, or -1 on error. no in-between, she's not ambiguous πŸ’€

ngl bestie, if you get -1 back, something went wrong and you should probably look at it. not me being emotionally supportive about an error code 😭

πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, in order:


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.

like, respect the authors, they've been carrying this since 2010 ✨


and that's the page, bestie!! this whole thing lives under libecoli, dated 2026-06-11, and the manual section is EC_INTERA...RROR_HELPS(3) β€” yes the title got squished in the original too, it's not just you, iykyk πŸ§šπŸ’œ

πŸ“¦ where this page comes from