VistaIOOffset(3)

✨ NAME ✨

VistaIOOffset, VistaIOOffsetOf β€” bestie, they figure out the byte offset of a structure field πŸ’…


🌸 SYNTAX 🌸

#include <vistaio.h>

size_t VistaIOOffset (pointer_type, field_name)
       Type pointer_type;
       Field field_name;

size_t VistaIOOffsetOf (struct_type, field_name)
       Type struct_type;
       Field field_name;

πŸŽ€ ARGUMENTS πŸŽ€

  • field_name β€” the name of the structure field whose byte offset you're tryna calculate. that's it, that's the whole job 🫢
  • pointer_type β€” a type that's declared as a pointer to a structure.
  • struct_type β€” a type that's declared as a structure (no pointer energy, just straight-up struct).

πŸ’– DESCRIPTION πŸ’–

okay so the VistaIOOffset and VistaIOOffsetOf macros hand you back the byte offset of the field_name field, measured inside its structure. literally that. it's giving "where does this field live" and they ate πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

nothing here, bestie β€” the SEE ALSO is empty, it's giving quiet luxury πŸ™ˆ


πŸ‘‘ NOTES πŸ‘‘

These two are equivalent to the X Toolkit macros XtOffset(3Xt) and XtOffsetOf(3Xt). no cap.

also β€” ANSI C defines an offsetof macro, and that one is to be preferred over any of these. so if you've got offsetof available, use it, periodt. πŸ’…

fr fr, offsetof is the main character here. VistaIOOffset and VistaIOOffsetOf are iconic but they're the supporting cast. ✨

VistaIO Version 1.2.14 🌈 19 January 1993 β€” yeah bestie, this page is vintage vintage, a whole 1993 era. the lore is ancient but the byte offsets are eternal πŸ’œπŸŽ€πŸ¦‹