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_TIMESTAMP2STRING(3)													    PX_TIMESTAMP2STRING(3)

px_timestamp2string - Converts the timestamp into a string.

SYNOPSIS
string px_timestamp2string (resource $pxdoc, float $value, string $format) DESCRIPTION
Turns a timestamp as it stored in the paradox file into human readable format. Paradox timestamps are the number of miliseconds since 0001-01-02. This function is just for convenience. It can be easily replaced by some math and the calendar functions as demonstrated in the following example. PARAMETERS
o $pxdoc - Resource identifier of the paradox database. o $value - Value as stored in paradox database field of type PX_FIELD_TIME, or PX_FIELD_TIMESTAMP. o $format - String format similar to the format used by date(3). The placeholders support by this function is a subset of those supported by date(3) (Y, y, m, n, d, j, H, h, G, g, i, s, A, a, L). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Turn a paradox timestamp into a human readable form <?php $px = px_new(); /* make up a date as it could be stored in */ /* a date field of a paradox db. */ /* 700000 days since 1.1.0000. */ $days = 700000; /* Use the calendar functions to print a */ /* human readable format of the date */ echo jdtogregorian($days+1721425)." "; /* Turn it into a timestamp as it stored in a paradox database */ /* Timestamps are stored in miliseconds since 0001-01-02 */ $stamp = $days * 86400.0 * 1000.0; /* Add one hour */ $stamp += 3600000.0; /* The following will output '7/15/1917 01:00:00'. */ echo px_timestamp2string($px, $stamp, "n/d/Y H:i:s")." "; px_delete($px); ?> The above example will output: 7/15/1917 7/15/1917 01:00:00 The Julian day count as passed to jdtogregorian(3) has a different base of 1.1.4714 b.c. and must therefore be calculated by adding 1721425 to the day count used in the paradox file. Turning the day count into a timestamp is easily done by multiplying with 86400000.0 to obtain miliseconds. SEE ALSO
px_date2string(3), jdtogregorian(3). PHP Documentation Group PX_TIMESTAMP2STRING(3)
Man Page