Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

px_create_fp(3) [debian man page]

PX_CREATE_FP(3) 					     Library Functions Manual						   PX_CREATE_FP(3)

NAME
PX_create_fp -- create a new Paradox file SYNOPSIS
#include <paradox.h> int PX_create_fp(pxdoc_t *pxdoc, pxfield_t *fields, int numfields, FILE *fp, int type) DESCRIPTION
Creates a new Paradox document in an already open file with the given field specification. pxdoc must be created before with PX_new(3) or PX_new2(3). The file must be opened in read/write mode (w+) with fopen(3). fields is an array of numfields 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 PX_new(3). The memory for the field names is usually allocated with PX_strdup(3). 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. After creating the paradox database you may want to call PX_set_tablename(3) in order to set the table name as it is stored in the header of the database. RETURN VALUE
Returns 0 on success and -1 on failure. SEE ALSO
PX_new2(3), PX_new(3), PX_create_file(3), PX_set_tablename(3) AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx. PX_CREATE_FP(3)

Check Out this Related Man Page

PX_RETRIEVE_RECORD(3)					     Library Functions Manual					     PX_RETRIEVE_RECORD(3)

NAME
PX_retrieve_record -- Returns record in Paradox file SYNOPSIS
#include <paradox.h> pxval_t ** PX_retrieve_record(pxdoc_t *pxdoc, int recno) DESCRIPTION
Returns the record with the given number in a Paradox file. The first record has number 0, the last one has number_of_records-1. If you are accessing several records, do it in ascending order, because this is the most efficient way. The return value is an array of field values. Each value is stored in a structure like the following: typedef struct px_val pxval_t; struct px_val { char isnull; int type; union { long lval; double dval; struct { char *val; int len; } str; } value; }; The element isnull is set to 1 if the value is NULL otherwise it is set to 0. type is the type of the paradox field as defined in paradox.h. A field value can be either a long int, a double or a string, depending on the paradox field type. The paradox field types pxfShort, pxfLong, pxfDate, pxfTime, pxfLogical, and pxfAutoInc are returned as long int values. pxfTimestamp, pxfNumber, and pxfCurrency are returned as double values and all remaining paradox field types are stored as strings with the length in value.len. You can rely on strings being Null terminated. Blobs are stored as string but are not guarented to be Null terminated. The paradox field types pxfTimestamp, pxfTime, an pxfDate use an uncommon format which can be converted into a string with PX_time- stamp2string(3), PX_time2string(3), and PX_date2string(3). RETURN VALUE
Returns a pointer on success and NULL on failure. SEE ALSO
PX_update_record(3), PX_timestamp2string(3), PX_time2string(3), PX_date2string(3) AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx. PX_RETRIEVE_RECORD(3)
Man Page