EC_EDITLINE_TERM_SIZE(3)

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

✨ EC_EDITLINE_TERM_SIZE(3) ✨

okay bestie, so this is a page from the Libecoli Programmer's Manual β€” yes, that one, the EC_EDITLINE_TERM_SIZE(3) one, and honestly? it's giving "short but essential." πŸŽ€


πŸ’– NAME πŸ’–

ec_editline_term_size β€” get terminal width and height.

like. the terminal's actual size. how many columns, how many rows. that's it, that's the whole job, and it does it flawlessly. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ecoli/editline.h>

int ec_editline_term_size(
    const struct ec_editline   *editline,  /* The pointer to the ec_editline structure. */
    /*
     * The pointer where the number of columns is stored on success.
     */
    unsigned int               *width,
    /*
     * The pointer where the number of rows is stored on success.
     */
    unsigned int               *height
);

so you're passing in your editline pointer, plus two unsigned int pointers β€” one where the column count lands, one where the row count lands. both of them only get filled in on success, so like, don't go reading them if it flopped. πŸ’…


🌸 RETURN VALUE 🌸

  • 0 β€” slay, it worked. ✨
  • -1 β€” error, bestie. 😭 and in this case, the value pointed by width and height are not modified. so they stay exactly how you left them. no sneaky half-written numbers, no chaos. periodt.

🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” go read these too:


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


no cap: every flag, every pointer, every return value up there is exactly as written. don't come for me, I keep the facts immaculate. πŸ’–

and that's the tea, bestie 🫢 β€” this one's from libecoli, dated 2026-06-11, and it lives at EC_EDITLINE_TERM_SIZE(3). go resize a terminal and feel powerful. πŸ¦‹β­πŸ’œ

πŸ“¦ where this page comes from