Category : C Source Code
Archive   : TC-DBF.ZIP
Filename : D_ADDREC.C
Output of file : D_ADDREC.C contained in archive : TC-DBF.ZIP
** file: d_addrec.c
** purpose: routine to append a record to a open dbaseiii file.
** usage: d = (struct DBF *)malloc(sizeof(struct DBF));
** strcpy(d->filename,"filename.dbf");
** d_open(d);
** ... put desired data into memory at location pointed to by
** d->record_ptr ...
** d_addrec(d);
** d_close(d);
** free(d);
** notes: compile with "tcc -c d_addrec". include this file in dbf.li
** see dbf.h for structure of DBF
** author: Mark Sadler
** revised: 6/6/87
*/
#include
#include "dbf.h"
int d_addrec(struct DBF *d)
{
fseek(d->file_ptr,((long)d->header_length + (d->records * d->record_length)),0);
fwrite(d->record_ptr,d->record_length,1,d->file_ptr);
d->current_record = ++d->records;
d->status = updated;
return(0);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/