PX_GET_DATA_GRAPHIC(3)

๐Ÿ’– PX_GET_DATA_GRAPHIC ๐Ÿ’–

okay bestie, welcome to the Library Functions Manual, section 3, and today's main character is PX_get_data_graphic. she grabs graphic data fields and she's lowkey iconic for it. let's get into it ๐Ÿฆ‹


โœจ NAME โœจ

PX_get_data_graphic โ€” get that graphic data field, periodt ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <paradox.h>

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

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

so what she does is read a graphic data field. that's it, that's the job. but listen โ€” you can only use this function for blobs of type pxfGraphic. any other blob type and she's not the girl for you, no cap.

data points to the start of the data field inside the record. and how do you figure out where that is? you gotta sum up all the field lengths before the field you're operating on, then add that to the base pointer of the record. do the math, bestie ๐Ÿงฎ. and fr fr, you should use this function instead of accessing the data directly โ€” just trust her.

PX_get_data_graphic returns blob data stored in the record itself, or in an MB file โ€” and that MB file has to have been set with PX_set_blob_file(3) beforehand, okay? no file set, no data. simple as.

she allocates memory for the data and hands it back to you in *value. and here's the thing โ€” that memory is yours to free, the application has to do it. don't just leave it there, that's not cute. the amount of memory for the blob 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 if the data is saved in a file. very handy, iykyk ๐Ÿ’œ

โš ๏ธ Note: This function is deprecated and obsolete if PX_retrieve_record(3) is used. like, she still works, but if you're on PX_retrieve_record(3) you genuinely don't need her anymore. rip bestie ๐Ÿ˜ญ

๐ŸŒˆ RETURN VALUE ๐ŸŒˆ

  • 0 โ€” if the value is NULL
  • -1 โ€” in case of an error ๐Ÿ’€
  • 1 โ€” otherwise โœจ

๐Ÿซถ SEE ALSO ๐Ÿซถ

(and yes, PX_get_data_byte(3) is listed twice, we're keeping it exactly as the original has it, she said what she said ๐Ÿ‘‘)


๐Ÿ’œ AUTHOR ๐Ÿ’œ

This manual page was written by Uwe Steinmann uwe@steinmann.cx. thank you for your service ๐Ÿซก


and that's a wrap on PX_GET_DATA_GRAPHIC(3), from the Library Functions Manual โœจ go forth and free your allocated memory, bestie, mwah ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹