PX_GET_DATA_BYTES(3)
π PX_get_data_bytes(3) π
okay bestie, so this one lives in the Library Functions Manual, section 3 β that's the "C library calls" section, iykyk. Grab a boba, we're doing a deep dive. π§β¨
πΈ NAME πΈ
PX_get_data_bytes β snag the value out of a bytes data field, bestie π
π¦ SYNOPSIS π¦
#include <paradox.h>
int PX_get_data_bytes(pxdoc_t *pxdoc, char *data, int len, char **value)
β¨ DESCRIPTION β¨
So here's the vibe: this function reads a data field that's literally just an array of bytes, copies it into a fresh chunk of memory, and hands you back a pointer to that chunk in value. π
π«Ά Heads up though β the memory is allocated by this function, which means you, the calling application, have to free it. She's not gonna clean up after herself, that's your job now. π
And like, genuinely, please use this function instead of poking at the data directly? Trust the process. π₯
Now about that data argument β it points to the start of the data field in the record. You can't just guess it, bestie, you have to calculate it: sum up all the field lengths before the field you're operating on, and add that to the base pointer of the record. Math is giving main character energy today. πβ¨
β οΈ Note: this function is deprecated and obsolete if PX_retrieve_record(3) is used. Like, she's an icon but she's retired, no cap.
π RETURN VALUE π
0β returned if the value isNULLπ-1β returned in case of an error π1β returned otherwise, and that's the slay case π
π SEE ALSO π
PX_get_data_short(3)PX_get_data_long(3)PX_get_data_double(3)PX_get_data_alpha(3)PX_get_data_byte(3)
the whole friend group fr fr π«Ά
π AUTHOR π
This manual page was written by Uwe Steinmann uwe@steinmann.cx. absolute legend, we stan π
and that's the whole page, bestie!! it's from the Library Functions Manual, section 3 (PX_GET_DATA_BYTES(3), so you know exactly where to find her again) β go forth and free your memory, mwah π
β¨πΈ
π¦ where this page comes from
- debian bookworm: pxlib-dev 0.6.8-1+b1
- debian trixie: pxlib-dev 0.6.9-1+b1
- ubuntu jammy: pxlib-dev 0.6.8-1
- ubuntu noble: pxlib-dev 0.6.8-1
- ubuntu questing: pxlib-dev 0.6.9-1
- ubuntu resolute: pxlib-dev 0.6.9-1build1
- ubuntu stonking: pxlib-dev 0.6.10-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms