pxlib (Librería para leer tablas paradox)

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
Posts: 131
Joined: Wed Nov 28, 2012 5:55 pm
DBs Used: DBF, mySQL, Mariadb, postgreSQL, Oracle, Db2, Interbase, Firebird, and SQLite
Location: Buenos Aires - Argentina
Been thanked: 10 times

pxlib (Librería para leer tablas paradox)

Post by Ismach »

He logrado compilar la pxlib desde Mingw
sin problemas, pero quiero
usarlo desde hmg y estoy perdido como tanga en...
mi primera pregunta es:

sabiendo que en c

Code: Select all

typedef struct px_doc pxdoc_

y px_doc es una estructura

Code: Select all

struct px_doc {
        /* database file */
//      FILE *px_fp;       /* File pointer of file */
        pxstream_t *px_stream; /* input stream to read file from */
        char *px_name;     /* Name of file */
        int px_close_fp;   /* set to true if file pointer must be closed, deprecated */
//      int px_filemode;   /* set to pxfFileRead|pxfFileWrite */
        pxhead_t *px_head; /* Pointer to header of file */
        void *px_data;     /* Pointer to data of file (used in prim. index for
                                                * index data, used in db files for an self build
                                                * index) */
        int px_datalen;    /* length of data field in number of units */
        void *px_indexdata;/* Pointer to index data */
        int px_indexdatalen; /* number of index data records */

        /* primary index file */
        pxdoc_t *px_pindex;

        /* blob file */
        pxblob_t *px_blob;

        /* record accounting */
        int last_position; /* Position (starting at 0) where last record was put. */

        int warnings;      /* Turn of/off output of warnings */

        /* output function */
        size_t (*writeproc)(pxdoc_t *p, void *data, size_t size);

        /* error handler function */
        void (*errorhandler)(pxdoc_t *p, int level, const char* msg, void *data);

        /* user data passed to error handler */
        void *errorhandler_user_data;

        /* Memory allocation functions */
        void *(*malloc)(pxdoc_t *p, size_t size, const char *caller);
        void *(*calloc)(pxdoc_t *p, size_t size, const char *caller);
        void *(*realloc)(pxdoc_t *p, void *mem, size_t size, const char *caller);
        void  (*free)(pxdoc_t *p, void *mem);

        /* input stream functions */
        size_t (*read)(pxdoc_t *p, pxstream_t *stream, size_t numbytes, void *buffer);
        int (*seek)(pxdoc_t *p, pxstream_t *stream, long offset, int whence);
        long (*tell)(pxdoc_t *p, pxstream_t *stream);
        size_t (*write)(pxdoc_t *p, pxstream_t *stream, size_t numbytes, void *buffer);

        char *targetencoding;
        char *inputencoding;
        RECODE_OUTER recode_outer;
        RECODE_REQUEST out_recode_request; /* Encoding of written data */
        RECODE_REQUEST in_recode_request; /* Encoding of read data */
        iconv_t out_iconvcd;  /* Encoding of written data */
        iconv_t in_iconvcd;   /* Encoding of read data */

        long curblocknr;      /* Number of current block in cache (0-n) */
        int curblockdirty;    /* Set to px_true if the block needs to be written */
        unsigned char *curblock;       /* Data of block in read cache */
como llevo a harbour esto?

O mas simple como llamo desde harbour a esta funcion de la lib?

Code: Select all

PXLIB_API int PXLIB_CALL PX_open_fp(pxdoc_t *pxdoc, FILE *fp);

Post Reply