.TH "PX_CREATE_FP" "3" .SH "NAME" PX_create_fp \(em create a new Paradox file .SH "SYNOPSIS" .PP #include .PP int PX_create_fp(pxdoc_t *pxdoc, pxfield_t *fields, int numfields, FILE *fp, int type) .SH "DESCRIPTION" .PP Creates a new Paradox document in an already open file with the given field specification. \fBpxdoc\fP must be created before with \fBPX_new(3)\fP or \fBPX_new2(3)\fP. The file must be opened in read/write mode (w+) with \fBfopen(3)\fP. \fBfields\fP is an array of \fBnumfields\fP field specifications to set the schema of the database. The memory for the field specifications and field names must be allocated by the caller and may not be freed, since the memory is freed when the document is deleted. Make sure to use the same memory allocation function as passed to \fBPX_new(3)\fP. The memory for the field names is usually allocated with \fBPX_strdup(3)\fP. The field name can be left empty if a primary index file is to be created. The type of the file can be set in the last parameter. Currently only database (pxfFileTypIndexDB, pxfFileTypNonIndexDB) and primary index (pxfFileTypPrimIndex) files are supported. .PP After creating the paradox database you may want to call \fBPX_set_tablename(3)\fP in order to set the table name as it is stored in the header of the database. .SH "RETURN VALUE" .PP Returns 0 on success and \-1 on failure. .SH "SEE ALSO" .PP PX_new2(3), PX_new(3), PX_create_file(3), PX_set_tablename(3) .SH "AUTHOR" .PP This manual page was written by Uwe Steinmann uwe@steinmann.cx. .\" created by instant / docbook-to-man