GumboSourcePosition(3)

πŸ“¦
version 0.12.1 Β· 4 versions
, in fedora 43

✨ GumboSourcePosition ✨

okay bestie, welcome to the GumboSourcePosition page, it's giving struct core energy and honestly? it's a little icon. πŸ’… it lives in the Gumbo fam (that's the HTML parser, iykyk) and it's basically the lil map dot that tells you where in your text something happened. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <gumbo.h>

πŸŽ€ Data Fields πŸŽ€

  • unsigned int line β€” the line number, bestie. πŸ“
  • unsigned int column β€” the column number. πŸ“
  • unsigned int offset β€” the byte offset. πŸ”’

πŸ’– DETAILED DESCRIPTION πŸ’–

so like. it's a struct. it represents a character position inside the original text buffer. that's the whole job. that's the vibe. 🌈

here's the part you actually need to remember tho, no cap:

  • line and column are 1-based β€” so the first line is line 1, not line 0, we are NOT doing zero-index shenanigans here.
  • offset is 0-based β€” starting at zero like a normal little byte counter.

and that combo? that's exactly how most editors and command-line tools work, so if you've ever been like "why does my compiler say line 1" β€” yeah. that. 😌

now the spicy bit πŸ”₯: column counts by characters while offset counts by bytes. they are NOT the same thing and they are not trying to be. here's the why, and it's genuinely so smart:

  • the offset field gets used a lot to pull out a particular region of text β€” and in most languages that bind to C, that means pointer arithmetic on a buffer of bytes. bytes. that's the unit. 🫢
  • the column field gets used a lot to point at a particular column on a printable display, and nowadays that display is usually UTF-8. so characters it is. πŸ’–

so yeah, two different rulers, two different jobs, both slaying in their own lane. ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for Gumbo from the source code. not a human, just a robot doing its lil thing, and honestly? it ate. πŸ€–βœ¨


bestie reminder: line/column = 1-based, offset = 0-based. column = characters, offset = bytes. do not mix them up, i am begging. πŸ˜­πŸ™ˆ

and that's the page!! Version 0.12.1, dated Fri Sep 19 2025 00:00:00, and yes this was literally the footer of the man page, so consider this the cute lil sign-off β€” mwah, go parse some HTML, you absolute main character. πŸ’œπŸ§šπŸ“

πŸ“¦ where this page comes from