home *** CD-ROM | disk | FTP | other *** search
- NAME
- dbaddfld
-
- SYNOPSIS
- #include "dbapi.h"
-
- DBFFIELD *dbaddfld(DBFFIELD *base,char *name,
- int type,word len,int dec)
-
- DESCRIPTION
- dbaddfld adds an entry into field list which can be used
- to create dbase file. base is a pointer to first entry in
- list, name is field name (max 10 chars) type is field type
- identifier ( 'C','N','L','D' or 'M') len is a field length
- and dec is number of decimal places for 'N' type.
- the field definitions will be used for newly created
- dbase file and will be automatically disposed when the
- file is closed.
-
- DIAGNOSTICS
- returns pointer to newly created field definition if successful
- or NULL if runs out of memory (already existing entries, if any,
- are _not_ disposed)
-
- EXAMPLE
- #include "dbapi.h"
-
- DBFFILE *createxxx(void)
- {
- DBFFILE *dbf=NULL;
- DBFFIELD *nfd;
- nfd=dbaddfld(NULL,"ACCOUNT",'C',6,0);
- if (nfd) {
- dbaddfld(nfd,"CLIENT",'C',52,0);
- dbaddfld(nfd,"PHONE",'C',20,0);
- dbaddfld(nfd,"REGNUM",'C',11,0);
- unlink("CLIENTS.DBF");
- dbf=dbfcreate("CLIENTS.DBF",3,nfd);
- }
- return dbf;
- }
-
- SEE ALSO
- dbfcreate
- NAME
- dbkillflds
-
- SYNOPSIS
- #include "dbapi.h"
-
- void dbkillflds(DBFFIELD *f)
-
- DESCRIPTION
- disposes the whole field list built with dbaddfld. normally
- not needed as dbfclose disposes the list automatically but
- could be used if dbaddfld fails.
-
- SEE ALSO
- dbaddfld
-
- NAME
- dbfclose
-
- SYNOPSIS
- #include "dbapi.h"
-
- void dbfclose(DBFFILE *dbf)
-
- DESCRIPTION
- closes dbase opened with dbfopen or created with dbfcreate.
- if dbfwrite has been used on the dbase then file header is
- updated as well.
- NAME
- dbfcreate
-
- SYNOPSIS
- #include "dbapi.h"
-
- DBFFILE *dbfcreate(char *fn,int ver,DBFFIELD *fields)
-
- DESCRIPTION
- dbfcreate creates a new dbase file. fn is a file name for
- database and ver is version number (2 or 3 are supported
- at the moment). fields is a list of field definitions
- built with dbaddfld.
-
- DIAGNOSTICS
- dbfcreate will return opened dbase file pointer to newly
- created file if successful or NULL when create fails or
- the file already exists. In case of failure the field list
- is disposed and becomes invalid.
-
- SEE ALSO
- dbaddfld
- NAME
- dbfopen
-
- SYNOPSIS
- #include "dbapi.h"
-
- DBFFILE *dbfopen(char *fn)
-
- DESCRIPTION
- dbfopen opens an existing dbase file, automatically handling
- both version2 and version3 files.
-
- DIAGNOSTICS
- pointer to opened file is returned if everything's ok, NULL
- if something goes wrong.
- NAME
- dbread
-
- SYNOPSIS
- #include "dbapi.h"
-
- char *dbread(char *buf,dword recno,DBFFILE *dbf)
-
- DESCRIPTION
- dbread reads a single record from dbase into buf. the record
- length is taken from file record, recno is 0-based, so the
- first record in the file is #0, second is #1 and so on.
-
- DIAGNOSTICS
- returns buf if successful, NULL if fails.
- NAME
- dbwrite
-
- SYNOPSIS
- #include "dbapi.h"
-
- char *dbwrite(char *buf,dword recno,DBFFILE *dbf)
-
- DESCRIPTION
- dbwrite writes a single record into file at specified record
- position. first record is 0.
-
- DIAGNOSTICS
- returns buf if OK, NULL if fails.
- NAME
- fpmemoopen - open a foxpro memo file
-
- SYNOPSIS
- #include "dbapi.h"
-
- FPMEMOFILE *fpmemoopen(char *fn);
-
- DESCRIPTION
- opens a foxpro memo file for read/write and retrieves a block
- size for later offset calculations.
- NAME
- fpmemoclose - close memo file
-
- SYNOPSIS
- #include "dbapi.h"
-
- void fpmemoclose(FPMEMOFILE *mf);
-
- DESCRIPTION
- closes a memo file
- NAME
- fpmemofindblock - seet to beginning of the memo data in memo file
-
- SYNOPSIS
- #include "dbapi.h"
-
- long fpmemofindblock(FPMEMOFILE *mf,long blockno);
-
- DESCRIPTION
- this function seeks to the given memo block number in memo file
- and returns length of the memo data in bytes. file data pointer
- will be at the beginning of memo data.
-