PX_GET_DATA_BLOB(3)

πŸ’– PX_GET_DATA_BLOB πŸ’–

okay so bestie, gather round, because we're talking about PX_get_data_blob β€” the Get blob data field girlie from the paradox library (that's PX_GET_DATA_BLOB(3) if you're keeping track, and you should be, because she's lowkey iconic) πŸŽ€


✨ SYNOPSIS ✨

#include <paradox.h>

int PX_get_data_blob(pxdoc_t *pxdoc, char *data, int len, int *mod, int
*blobsize, char **value)

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function reads a blob data field. That's it, that's the job, and she does it well πŸ’…

She works for all types of blobs β€” with one little exception, and it's a big one, so listen up: not fields of type pxfGraphic. Those are a different girl's problem, not hers.

Now, data β€” this one is important, no cap. It points to the start of the data field inside the record. But here's the thing: you can't just point it anywhere. You have to calculate it yourself, by summing up all the field lengths before the field you want to operate on, and then adding that whole sum to the base pointer of the record. Yes, it's giving math homework. Yes, you still have to do it. πŸ™ˆ

And like... you should use this function instead of accessing the data directly. fr fr. Just use the function.

What does she actually return to you? PX_get_data_blob hands back blob data that's either stored in the record itself, or sitting in an MB file β€” and that MB file has to have been set with PX_set_blob_file(3) first, or this whole thing is not gonna work, bestie.

Oh and heads up about memory, because this part matters πŸ‘‘: the function allocates memory for the data it returns in *value. That memory is yours to deal with β€” the application has to free it, but only if the function returns successfully. Don't be out here freeing stuff that never got allocated, that's not the vibe.

  • The amount of memory for the blob? That comes back in *blobsize.
  • And *mod returns the so called modification number of the blob, which can often be used as an unique id for creating file names β€” super handy if the data is being saved into a file. iykyk 😌
⚠️ Note: This function is deprecated and obsolete if PX_retrieve_record(3) is used.

🌈 RETURN VALUE 🌈

  • 0 β€” if the value is NULL
  • -1 β€” in case of an error (sad girl hours 😭)
  • 1 β€” otherwise, aka the good ending ✨

🌸 SEE ALSO 🌸


πŸ’œ AUTHOR πŸ’œ

This manual page was written by Uwe Steinmann uwe@steinmann.cx.


okay that's the whole page bestie, you ate that 🫢 this one came from the Library Functions Manual (so that's our source, mwah), and yeah β€” the page signs off as PX_GET_DATA_BLOB(3) every single time, like a true main character. periodt. πŸ’…βœ¨