GumboSourcePosition(3)
β¨ 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:
lineandcolumnare 1-based β so the first line is line 1, not line 0, we are NOT doing zero-index shenanigans here.offsetis 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
offsetfield 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
columnfield 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
- fedora 43: gumbo-parser-devel 1:0.12.1-7.fc43 Β· Apache-2.0
- fedora 43: gumbo-parser-devel 1:0.12.1-7.fc43 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms