Category : C Source Code
Archive   : TC-DBF.ZIP
Filename : D_GETFLD.C
Output of file : D_GETFLD.C contained in archive : TC-DBF.ZIP
** file: d_getfld.c
** purpose: routine to fill a buffer with field data from a dbiii file
** opened with d_open and accessed with d_getrec. the data from the
** record is copied into the buffer and terminated with '\0'
** usage: d = (struct DBF *)malloc(sizeof(struct DBF));
** strcpy(d->filename,"filename.dbf");
** d_open(d);
** d_getrec(d,(long)recordno);
** d_getfld(d,fieldno,buffer);
** ... use field data ...
** d_close(d);
** free(d);
** notes: compile with "tcc -c d_getfld". include this file in dbf.li
** see dbf.h for structure of DBF
** returns: field type if successful
** null if not
** author: Mark Sadler
** revised: 6/14/87
*/
#include
#include
#include "dbf.h"
char d_getfld(struct DBF *d,int f,char *buff)
{
struct FIELD_RECORD *fp;
if(f > 0 && f <= d->num_fields)
{
fp = d->fields_ptr + (f - 1);
memcpy(buff,fp->field_data_address,fp->len);
buff[fp->len] = '\0';
return(fp->typ);
}
else
{
buff[0]='\0';
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/