PX_PUT_RECORDN(3)
πΎ PX_put_recordn β bestie, we're filing your record in a Paradox file at a very specific spot π
okay so picture this: it's PX_put_recordn(3), from the Library Functions Manual, and it is literally the girl who knows exactly where every record belongs. Not "somewhere near the end", not "wherever there's space" β a specific position, bestie. she has a seating chart. she's got main character energy and the seating chart is her personality. β¨
πΈ SYNOPSIS πΈ
#include <paradox.h>
int PX_put_recordn(pxdoc_t *pxdoc, char *data, int recpos)
π DESCRIPTION π
So here's the tea: this function stores a record from the buffer data into a Paradox file, and it drops it at the given position recpos. And the very first position is number 0, not 1, because of course it is. Programmers love starting at zero. iykyk. π
The function will figure out the data block for this record all by itself. no hand-holding needed, she's independent. π
Now, the spicy part. If the position you asked for is after the last data block? Then as many empty data blocks as needed get added. As many as needed. She'll build the whole neighborhood just to give your record a house. π β¨
But wait, there's more. If the position lands in the middle of a data block and there's no record right before that position, then the position gets recalculated so the new record lands in the first free slot of the datablock. She's not gonna leave a lil gap in the seating chart, that's not the vibe.
Example time, because honestly this one needs it: let's say a datablock contains H records, and the first call of PX_put_recordn wants to store a record at position 11. Guess what β that gets corrected to position H. PX_put_recordn will also add an empty data block and store the record as the first record of the second data block. boom. π«Ά
And then β and this is the part that lowkey sends me β storing a second record at position 11 again will be executed without any position change. She remembered. She always remembers. π
One thing though, no cap: data must be constructed with the PX_put_data_xxx(3) functions beforehand. It has the same structure as the record returned by PX_get_record(3) and PX_get_record2(3). Don't just show up with raw data and expect her to make it work β that's not giving prepared. π
β RETURN VALUE β
Returns the record position on success, and -1 on failure. And yeah, we said it before but we're saying it again because it matters: the first position has number 0. periodt. π
π¦ SEE ALSO π¦
PX_get_record(3)PX_get_record2(3)PX_put_record(3)PX_put_data_byte(3)PX_put_data_short(3)PX_put_data_long(3)PX_put_data_double(3)PX_put_data_alpha(3)
π AUTHOR π
This manual page was written by Uwe Steinmann uwe@steinmann.cx. iconic of him honestly, we love a documentation king. π
and that's the whole page bestie!! this lil legend lives in the Library Functions Manual as PX_PUT_RECORDN(3), and this version of it is dated... okay well, the original footer date didn't survive the vibe check, but the manual name and source line are PX_PUT_RECORDN(3) from the Library Functions Manual, so jot that down. 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