PX_GET_DATA_BCD(3)
π PX_GET_DATA_BCD π
okay bestie, we're doing a manual page for PX_get_data_bcd, and yes it lives in the Library Functions Manual, section 3, right where all the library girlies hang out. this is your girl's guide to the bcd data field situation, let's GO π¦
β¨ NAME β¨
PX_get_data_bcd β get the bcd data field, that's literally it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <paradox.h>
int PX_get_data_bcd(pxdoc_t *pxdoc, char *data, int len, char **value)
look at that signature. iconic. no notes π
π DESCRIPTION π
so what this does: it takes a data field exactly the way it's stored in the database file and turns it into a bcd string for you. glow-up but for bytes, fr fr β¨
the string it hands back will not be longer than 20 chars including the final 0. and it contains only these characters: +, -, 0-9, and .. that's it, that's the whole guest list, nobody else gets in π«
you should use this function instead of accessing the data directly. like, please. don't rawdog the struct. this is the way. iykyk π
now the deets on the args, because they matter:
datapoints to the start of the data field in the record. to get it, you gotta sum up all field length before the field to operate on and add that to the base pointer of the record. yes, it's a little math homework, but you got this bestie, i believe in you π«Άlenis the number of digits after the decimal point.
and here's the part that's giving responsibility: the function allocates memory for the string it returns in *value. that memory has to be freed by the application. so like, it's yours now. it's your baby. take care of it or it leaks. no cap π
Note: this function is deprecated and obsolete ifPX_retrieve_record(3)is used. so if you're on thePX_retrieve_record(3)train, this one's lowkey retired, she's in her retirement era π§
β RETURN VALUE β
- returns
0if the value isNULL - returns
-1in case of an error π - returns
1otherwise β slay π
π¦ SEE ALSO π¦
the whole friend group, go say hi:
PX_get_data_alpha(3)PX_get_data_byte(3)PX_get_data_long(3)PX_get_data_short(3)PX_get_data_double(3)
π AUTHOR π
this manual page was written by Uwe Steinmann uwe@steinmann.cx. thank you for your service, legend π«‘π
okay that's the whole page bestie!! this one came out of the Library Functions Manual and it's filed under PX_GET_DATA_BCD(3) β go forth, handle your bcd data, and remember to free() that 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