mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-07-15 21:40:11 +02:00
Implement object mapping framework.
This commit is contained in:
@ -135,7 +135,7 @@ typedef struct _pdfio_pair_s // Key/value pair
|
||||
_pdfio_value_t value; // Value
|
||||
} _pdfio_pair_t;
|
||||
|
||||
struct _pdfio_dict_s
|
||||
struct _pdfio_dict_s // Dictionary
|
||||
{
|
||||
pdfio_file_t *pdf; // PDF file
|
||||
size_t num_pairs, // Number of pairs in use
|
||||
@ -143,6 +143,13 @@ struct _pdfio_dict_s
|
||||
_pdfio_pair_t *pairs; // Array of pairs
|
||||
};
|
||||
|
||||
typedef struct _pdfio_objmap_s // PDF object map
|
||||
{
|
||||
pdfio_obj_t *obj; // Object for this file
|
||||
pdfio_file_t *src_pdf; // Source PDF file
|
||||
size_t src_number; // Source object number
|
||||
} _pdfio_objmap_t;
|
||||
|
||||
struct _pdfio_file_s // PDF file structure
|
||||
{
|
||||
char *filename; // Filename
|
||||
@ -173,6 +180,9 @@ struct _pdfio_file_s // PDF file structure
|
||||
size_t num_objs, // Number of objects
|
||||
alloc_objs; // Allocated objects
|
||||
pdfio_obj_t **objs; // Objects
|
||||
size_t num_objmaps, // Number of object maps
|
||||
alloc_objmaps; // Allocated object maps
|
||||
_pdfio_objmap_t *objmaps; // Object maps
|
||||
size_t num_pages, // Number of pages
|
||||
alloc_pages; // Allocated pages
|
||||
pdfio_obj_t **pages; // Pages
|
||||
@ -230,9 +240,11 @@ extern pdfio_dict_t *_pdfioDictRead(pdfio_file_t *pdf, _pdfio_token_t *ts) PDFIO
|
||||
extern bool _pdfioDictSetValue(pdfio_dict_t *dict, const char *key, _pdfio_value_t *value) PDFIO_INTERNAL;
|
||||
extern bool _pdfioDictWrite(pdfio_dict_t *dict, off_t *length) PDFIO_INTERNAL;
|
||||
|
||||
extern bool _pdfioFileAddMappedObject(pdfio_file_t *pdf, pdfio_obj_t *dst_obj, pdfio_obj_t *src_obj) PDFIO_INTERNAL;
|
||||
extern bool _pdfioFileConsume(pdfio_file_t *pdf, size_t bytes) PDFIO_INTERNAL;
|
||||
extern bool _pdfioFileDefaultError(pdfio_file_t *pdf, const char *message, void *data) PDFIO_INTERNAL;
|
||||
extern bool _pdfioFileError(pdfio_file_t *pdf, const char *format, ...) PDFIO_FORMAT(2,3) PDFIO_INTERNAL;
|
||||
extern pdfio_obj_t *_pdfioFileFindMappedObject(pdfio_file_t *pdf, pdfio_file_t *src_pdf, size_t src_number) PDFIO_INTERNAL;
|
||||
extern bool _pdfioFileFlush(pdfio_file_t *pdf) PDFIO_INTERNAL;
|
||||
extern int _pdfioFileGetChar(pdfio_file_t *pdf) PDFIO_INTERNAL;
|
||||
extern bool _pdfioFileGets(pdfio_file_t *pdf, char *buffer, size_t bufsize) PDFIO_INTERNAL;
|
||||
|
Reference in New Issue
Block a user