36 #ifndef INCLUDED_pd_internal_h
37 #define INCLUDED_pd_internal_h
79 #define PDTYPE_PTR_LEN 4
81 #define PDTYPE_PTR_LEN 3
116 #define PDAlloc(s,d,z) PDAllocTyped(PDInstanceTypeUnset,s,d,z)
118 #ifdef DEBUG_PD_RELEASES
119 #define PDAllocTyped(it,s,d,z) _PDAllocTypedDebug(__FILE__,__LINE__,it,s,d,z)
120 extern void *_PDFocusObject;
121 extern void *_PDAllocTypedDebug(
const char *file,
int lineNumber,
PDInstanceType it,
PDSize size,
void *dealloc,
PDBool zeroed);
156 # define PDTYPE_ASSERT(ob) PDAssert(((PDTypeRef)ob - 1)->pdc == PDC)
158 # define PDTYPE_ASSERT(ob)
161 #ifdef PD_SUPPORT_CRYPTO
213 #ifdef PD_SUPPORT_CRYPTO
535 #define PD_STACK_STRING 0
536 #define PD_STACK_ID 1
537 #define PD_STACK_STACK 2
538 #define PD_STACK_PDOB 3
539 #define PD_STACK_FREEABLE 4
616 #ifdef PD_SUPPORT_CRYPTO
617 PDCryptoInstanceRef
ci;
625 #ifdef PD_SUPPORT_CRYPTO
648 #ifdef PD_SUPPORT_CRYPTO
649 PDCryptoInstanceRef
ci;
704 #ifdef PD_SUPPORT_CRYPTO
846 extern void PDPipeCloseFileStream(FILE *stream);
847 extern FILE *PDPipeOpenInputStream(
const char *path);
848 extern FILE *PDPipeOpenOutputStream(
const char *path);
895 #ifdef PD_SUPPORT_CRYPTO
896 PDCryptoInstanceRef
ci;
901 extern void PDStringAttachCryptoInstance(
PDStringRef string, PDCryptoInstanceRef ci,
PDBool encrypted);
902 extern void PDArrayAttachCryptoInstance(
PDArrayRef array, PDCryptoInstanceRef ci,
PDBool encrypted);
903 extern void PDDictionaryAttachCryptoInstance(
PDDictionaryRef dictionary, PDCryptoInstanceRef ci,
PDBool encrypted);
904 extern void PDDictionaryAttachCryptoInstance(
PDDictionaryRef hm, PDCryptoInstanceRef ci,
PDBool encrypted);
924 #define PDDEF const void*[]
929 #define PDDef(defs...) (PDDEF){(void*)defs, NULL}
939 # if defined(DEBUG) || defined(PD_WARNINGS)
941 extern void _PDBreak();
942 # define PDError(args...) do {\
943 fprintf(stderr, "[pajdeg::error] %s:%d - ", __FILE__,__LINE__); \
944 fprintf(stderr, args); \
945 fprintf(stderr, "\n"); \
949 # define PDError(args...)
960 # if defined(DEBUG) || defined(PD_WARNINGS)
962 # define PDWarn(args...) do { \
963 fprintf(stderr, "[pajdeg::warning] %s:%d - ", __FILE__,__LINE__); \
964 fprintf(stderr, args); \
965 fprintf(stderr, "\n"); \
968 # define PDWarn(args...)
979 # if defined(PD_NOTICES)
980 # define PDNotice(args...) do { \
981 fprintf(stderr, "[pajdeg::notice] %s:%d - ", __FILE__,__LINE__); \
982 fprintf(stderr, args); \
983 fprintf(stderr, "\n"); \
986 # define PDNotice(args...)
1001 # if defined(DEBUG) || defined(PD_ASSERTS)
1002 # include <assert.h>
1003 # if defined(PD_WARNINGS)
1004 # define PDAssert(args...) \
1006 PDWarn("assertion failure : %s", #args); \
1010 # define PDAssert(args...) assert(args)
1013 # define PDAssert(args...)
1024 #define PDRequire(state, retval, msg...) \
1026 PDWarn("requirement failure : " msg); \
1039 #define as(type, expr...) ((type)(expr))
1048 #define PDInstancePrinterRequire(b, r) \
1049 if (*cap - offs < b) { \
1051 *buf = realloc(*buf, *cap); \
1054 #define PDInstancePrinterInit(itype, b, r) \
1055 itype i = (itype) inst;\
1056 PDInstancePrinterRequire(b, r)
1066 #define fmatox(x, ato) \
1067 static inline x fast_mutative_##ato(char *str, PDInteger len) \
1069 char t = str[len]; \
Definition: PDDefines.h:242
PDTwinStreamMethod method
The current method.
Definition: pd_internal.h:806
PDOperatorRef next
the next operator, if any
Definition: pd_internal.h:383
PDSize size
size of heap
Definition: pd_internal.h:815
float PDReal
Definition: PDDefines.h:194
PDStringRef identifier
PDF /ID found in the trailer dictionary.
Definition: pd_internal.h:720
char * streamBuf
the stream, if fetched via parser, otherwise an undefined value
Definition: pd_internal.h:200
void * bufFuncInfo
buffer function info object
Definition: pd_internal.h:510
PDCMapRangeMapping * bfrs
BF ranges.
Definition: pd_internal.h:700
PDStateRef state
The wrapped state.
Definition: pd_internal.h:344
PDBool encryptedDoc
if set, the object is contained in an encrypted PDF; if false, PDObjectSetStreamEncrypted is NOP ...
Definition: pd_internal.h:209
void ** values
Resolved values.
Definition: pd_internal.h:614
pd_stack dicts
Stack of PDDictionaries.
Definition: pd_internal.h:657
#define fmatox(x, ato)
Definition: pd_internal.h:1066
PDTaskResult(* PDTaskFunc)(PDPipeRef pipe, PDTaskRef task, PDObjectRef object, void *info)
Definition: PDDefines.h:778
pd_stack xstack
A stack of partial xref tables based on offset; see [1] below.
Definition: pd_internal.h:414
PDBool typedTasks
Whether type tasks (excluding unfiltered tasks) are activated; activation results in a slight decreas...
Definition: pd_internal.h:832
PDInteger value
The filter value, if any.
Definition: pd_internal.h:793
pd_auth_event
Definition: PDDefines.h:417
PDInteger first
first object's offset
Definition: pd_internal.h:252
pd_crypto_method cfMethod
crypt filter method
Definition: pd_internal.h:736
const char * lastOperator
the last operator that was encountered
Definition: pd_internal.h:312
enum item count
Definition: PDDefines.h:732
fpos_t offso
absolute offset in output for file pointer
Definition: pd_internal.h:812
PDInteger version
algorithm version (V key in PDFs)
Definition: pd_internal.h:723
PDCryptoInstanceRef ci
Crypto instance, if array is encrypted.
Definition: pd_internal.h:617
PDInteger length
length of the encryption key, in bits; must be a multiple of 8 in the range 40 - 128; default = 40 ...
Definition: pd_internal.h:724
PDSize genid
generation number of the current object
Definition: pd_internal.h:427
void(* PDScannerBufFunc)(void *info, PDScannerRef scanner, char **buf, PDInteger *size, PDInteger req)
Definition: PDDefines.h:925
PDInteger capacity
Size of kids array.
Definition: pd_internal.h:474
PDBool leaveKeys
if set, the keys are not deallocated on destruction; default = false (i.e. dealloc keys) ...
Definition: pd_internal.h:777
void ** table
The static hash table.
Definition: pd_internal.h:781
PDInteger count
Number of entries.
Definition: pd_internal.h:640
PDSize xrefnewiter
iterator for locating unused id's for usage in master xref table
Definition: pd_internal.h:418
PDSize csrCount
Number of codespace ranges.
Definition: pd_internal.h:695
PDPropertyType propertyType
The filter property type.
Definition: pd_internal.h:792
PDStringRef enckey
encryption key
Definition: pd_internal.h:732
long PDInteger
Definition: PDDefines.h:184
PDBool dynamicFiltering
Whether dynamic filtering is necessary; if set, the static hash filtering of filters is skipped and f...
Definition: pd_internal.h:831
PDInteger bucketm
Bucket mask.
Definition: pd_internal.h:645
PDBool strict
if true, the scanner will complain loudly when erroring out, otherwise it will silently fail ...
Definition: pd_internal.h:530
PDArrayRef contentRefs
array of content references for the page
Definition: pd_internal.h:330
PDNumberRef type
CMapType.
Definition: pd_internal.h:691
char * PDC
Definition: PDType.c:281
PDOperatorRef numberOp
number operator
Definition: pd_internal.h:763
PDBool isActive
Whether task is still active; sometimes tasks cannot be unloaded properly even though the task return...
Definition: pd_internal.h:790
pd_stack envStack
environment stack; e.g. root -> arb -> array -> arb -> ...
Definition: pd_internal.h:513
PDInteger offs
The current offset inside the buffer.
Definition: pd_internal.h:915
FILE * fi
Reader.
Definition: pd_internal.h:835
char * name
name of the state
Definition: pd_internal.h:755
PDStateRef pushedState
for "PushNewEnv", this is the environment being pushed
Definition: pd_internal.h:378
unsigned char PDBool
Definition: PDDefines.h:207
PDF delimiter character.
Definition: pd_internal.h:488
PDObjectRef root
the root object, if instantiated
Definition: pd_internal.h:435
char * heap
heap in which buffer is located
Definition: pd_internal.h:814
PDParserRef parser
Parser reference.
Definition: pd_internal.h:673
PDBool PDObjectStreamParseRawObjectStream(PDObjectStreamRef obstm, char *rawBuf)
Definition: PDObjectStream.c:96
Definition: PDStreamFilter.h:121
PDStringRef user
user string ("U"), 32-byte string based on user password, used in determining whether to prompt the u...
Definition: pd_internal.h:729
PDInteger * symindex
symbol indices (for hash)
Definition: pd_internal.h:759
pd_stack appends
stack of objects that are meant to be appended at the end of the PDF
Definition: pd_internal.h:421
PDBool failed
if set, the scanner aborted due to a failure
Definition: pd_internal.h:528
PDParserRef parser
The owning parser.
Definition: pd_internal.h:664
PDBool outgrown
if true, a scanner with fixedBuf set needed more data
Definition: pd_internal.h:529
PDObjectStreamElementRef elements
n sized array of elements (non-pointered!)
Definition: pd_internal.h:254
pd_stack def
the object content
Definition: pd_internal.h:195
#define PDOperatorSymbolGlobWhitespace
PDF whitespace character.
Definition: PDOperator.h:49
PDStringRef filter
filter name
Definition: pd_internal.h:721
void ** values
Values array.
Definition: pd_internal.h:780
PDInteger shift
The shift.
Definition: pd_internal.h:776
const char ** PDID
Definition: PDDefines.h:284
PDInteger bsize
buffer capacity
Definition: pd_internal.h:522
a numeric symbol
Definition: pd_internal.h:489
PDScannerRef scanner
the master scanner
Definition: pd_internal.h:807
PDStringRef alt
Alternative representation.
Definition: pd_internal.h:894
PDFontDictionaryRef fontDict
The font dictionary for the page; lazily constructed on first call to PDPageGetFont().
Definition: pd_internal.h:332
PDObjectClass obclass
object class (regular, compressed, or trailer)
Definition: pd_internal.h:193
PDArrayRef args
pending operator arguments
Definition: pd_internal.h:308
PDInteger obid
object id of element
Definition: pd_internal.h:237
PDF whitespace character.
Definition: pd_internal.h:487
PDObjectRef obj
Font object reference.
Definition: pd_internal.h:675
PDInteger symbols
number of symbols in total
Definition: pd_internal.h:757
PDArrayRef populated
Array of buckets which were created (as opposed to remaining NULL due to index never being touched) ...
Definition: pd_internal.h:647
PDInteger obid
object id
Definition: pd_internal.h:191
PDInteger offset
offset inside object stream
Definition: pd_internal.h:238
PDInteger revision
revision ("R") of algorithm: 2 if version < 2 and perms have no 3 or greater values, 3 if version is 2 or 3, or P has rev 3 stuff, 4 if version = 4
Definition: pd_internal.h:727
void * value
The value.
Definition: pd_internal.h:364
#define PDOperatorSymbolExtNumeric
Numeric value.
Definition: PDOperator.h:51
PDInteger key
The (primitive) key.
Definition: pd_internal.h:363
#define PDOperatorSymbolExtFake
"Fake" symbol
Definition: PDOperator.h:52
PDBool ovrStreamAlloc
if set, ovrStream will be free()d by the object after use
Definition: pd_internal.h:206
void ** keys
Keys array.
Definition: pd_internal.h:779
PDObjectRef ob
the /Page object
Definition: pd_internal.h:327
char * data
Buffer containing string data.
Definition: pd_internal.h:893
PDBool done
parser has passed the last object in the input PDF
Definition: pd_internal.h:417
void * info
The (user) info object.
Definition: pd_internal.h:797
PDFontDictionaryRef mfd
Master font dictionary, containing all fonts processed so far.
Definition: pd_internal.h:444
parser is right after the endstream keyword, at the endobj keyword
Definition: pd_internal.h:402
PDParserRef parser
The parser.
Definition: pd_internal.h:839
PDSize bfcLength
Length (in bytes) of input characters in BF ranges.
Definition: pd_internal.h:698
void(* PDScannerPopFunc)(PDScannerRef scanner)
Definition: PDDefines.h:936
PDSize hash
the hash code
Definition: pd_internal.h:628
PDInteger boffset
buffer offset (we are at position &buf[boffset]
Definition: pd_internal.h:523
PDStreamFilterRef filter
filter used to extract the initial raw content
Definition: pd_internal.h:253
PDSize streamLen
stream length of the current object
Definition: pd_internal.h:425
char * ovrDef
definition override
Definition: pd_internal.h:207
PDInstanceType
Definition: PDDefines.h:557
PDSplayTreeRef constructs
instances of objects (i.e. constructs)
Definition: pd_internal.h:255
PDScannerSymbolType stype
symbol type
Definition: pd_internal.h:501
pd_stack typeTasks[_PDFTypeCount]
Tasks which run depending on all objects of the given type; the 0'th element (type NULL) is triggered...
Definition: pd_internal.h:842
PDInteger ovrStreamLen
length of ^
Definition: pd_internal.h:205
pd_stack buildStack
Build stack (for sub-components)
Definition: pd_internal.h:345
char ** symbol
symbol strings
Definition: pd_internal.h:756
PDInteger streamLen
length of stream (if one exists)
Definition: pd_internal.h:198
PDSynchronizer synchronizer
synchronizer callback, called right before the object is serialized and written to the output stream ...
Definition: pd_internal.h:211
PDInteger extractedLen
length of extracted stream; -1 until stream has been fetched via the parser
Definition: pd_internal.h:199
char type
Stack type.
Definition: pd_internal.h:546
void * info
The stack content, based on its type.
Definition: pd_internal.h:547
int32_t privs
privileges (see Table 3.20 in PDF spec v 1.7, p. 123-124)
Definition: pd_internal.h:730
PDOperatorRef delimiterOp
delimiter operator
Definition: pd_internal.h:764
char * key
the argument to the operator, for PopVariable, Push/StoveComplex, PullBuildVariable ...
Definition: pd_internal.h:379
pd_stack resultStack
results stack
Definition: pd_internal.h:514
pd_auth_event cfAuthEvent
when authentication occurs; currently only supports '/DocOpen'
Definition: pd_internal.h:737
PDSplayTreeRef opertree
operator tree
Definition: pd_internal.h:307
PDInteger capacity
Capacity of array.
Definition: pd_internal.h:613
pd_stack resetters
resetter (func, userInfo) pairs – called at the end of every execution call; these adhere to the PDD...
Definition: pd_internal.h:311
void PDFlush(void)
Definition: PDType.c:419
PDInteger genid
generation id
Definition: pd_internal.h:192
PDSize csrCap
Codespace range capacity.
Definition: pd_internal.h:692
PDInteger entries
Number of entries in static hash.
Definition: pd_internal.h:774
PDInteger slen
symbol length
Definition: pd_internal.h:500
PDObjectClass
Definition: PDDefines.h:631
PDBool skipStream
if set, even if an object has a stream, the stream (including keywords) is skipped when written to ou...
Definition: pd_internal.h:201
PDInteger genid
The generation ID.
Definition: pd_internal.h:460
char * pi
The path of the input file.
Definition: pd_internal.h:833
PDOperatorType
Definition: PDDefines.h:887
PDParserState state
The parser state.
Definition: pd_internal.h:411
PDSplayTreeRef filter
The filters, in a tree with the object ID as key.
Definition: pd_internal.h:840
PDSize bfrCap
BF range capacity.
Definition: pd_internal.h:693
void PDObjectStreamCommit(PDObjectStreamRef obstm)
Definition: PDObjectStream.c:221
PDSplayTreeRef aiTree
bin-tree identifying the (in-memory) PDObjectRefs in appends and inserts by their object ID's ...
Definition: pd_internal.h:423
PDSize length
Length of the string.
Definition: pd_internal.h:891
Definition: pd_internal.h:190
PDBool fixedBuf
if set, the buffer is fixed (i.e. buffering function should not be called)
Definition: pd_internal.h:527
PDInteger genid
Associated generation number.
Definition: pd_internal.h:712
PDStringRef subfilter
sub-filter name
Definition: pd_internal.h:722
PDArrayRef * buckets
Buckets containing content.
Definition: pd_internal.h:646
PDStringRef name
CMapName.
Definition: pd_internal.h:690
pd_crypto_method
Definition: PDDefines.h:408
Definition: PDXTable.h:93
PDPropertyType
Definition: PDDefines.h:746
PDSize holds
bytes in heap
Definition: pd_internal.h:816
PDBool skipObject
if set, entire object is discarded
Definition: pd_internal.h:202
PDSplayTreeRef attachments
PDParserAttachment entries.
Definition: pd_internal.h:843
PDOperatorRef fallbackOp
fallback operator
Definition: pd_internal.h:765
PDFontRef font
The font associated with the string.
Definition: pd_internal.h:889
void * def
definition; NULL if a construct has been made for this element
Definition: pd_internal.h:241
PDObjectType type
Type of the number; as a special case, PDObjectTypeReference is used for pointers.
Definition: pd_internal.h:870
PDObjectRef trailer
the trailer object
Definition: pd_internal.h:434
PDSize cursor
position in heap (bytes 0..cursor have been written (unless discarded) to output) ...
Definition: pd_internal.h:817
Definition: pd_internal.h:306
PDBool leaveValues
if set, the values are not deallocated on destruction; default = false (i.e. dealloc values) ...
Definition: pd_internal.h:778
PDID identifier
identifier (constant string pointer pointer)
Definition: pd_internal.h:380
PDObjectRef construct
cannot be relied on to contain anything; is used to hold constructed objects until iteration (at whic...
Definition: pd_internal.h:424
struct PDXTable * PDXTableRef
Definition: pd_internal.h:393
pd_crypto crypto
Crypto object.
Definition: pd_internal.h:710
size_t PDSize
Definition: PDDefines.h:213
PDSplayTreeRef skipT
whenever an object is ignored due to offset discrepancy, its ID is put on the skip tree; when the las...
Definition: pd_internal.h:443
char * refString
reference string, cached from calls to
Definition: pd_internal.h:210
PDOperatorRef * symbolOp
symbol operators
Definition: pd_internal.h:762
FILE * fo
writer
Definition: pd_internal.h:810
PDStringEncoding
Definition: PDDefines.h:656
#define PDOperatorSymbolGlobRegular
PDF regular character.
Definition: PDOperator.h:48
PDTaskFunc func
The function callback, if the task is not a filter.
Definition: pd_internal.h:794
PDBool collection
If set, this is a /Type /Pages object, which is a group of page and pages references.
Definition: pd_internal.h:452
PDCryptoInstanceRef ci
Crypto instance, if dictionary is encrypted.
Definition: pd_internal.h:649
pd_stack deallocators
deallocator (func, userInfo) pairs – called when content stream object is about to be destroyed ...
Definition: pd_internal.h:310
PDReferenceRef encryptRef
reference to the encrypt object
Definition: pd_internal.h:433
PDTwinStreamRef stream
The I/O stream from the pipe.
Definition: pd_internal.h:409
PDScannerBufFunc bufFunc
buffer function
Definition: pd_internal.h:509
PDObjectRef PDObjectCreate(PDInteger obid, PDInteger genid)
Definition: PDObject.c:57
PDStringType type
Type of the string.
Definition: pd_internal.h:888
PDInteger filterCount
Number of filters in the pipe.
Definition: pd_internal.h:837
PDFontDictionaryRef fontDict
The owning font dictionary.
Definition: pd_internal.h:674
PDStringEncoding enc
String encoding, or NULL if not a string encoding.
Definition: pd_internal.h:677
PDCryptoInstanceRef cryptoInstance
crypto instance, if set up
Definition: pd_internal.h:215
end of buffer marked
Definition: pd_internal.h:490
PDBool opened
Whether pipe has been opened or not.
Definition: pd_internal.h:830
PDObjectStreamRef PDObjectStreamCreateWithObject(PDObjectRef object)
Definition: PDObjectStream.c:68
PDScannerSymbolRef sym
the latest symbol
Definition: pd_internal.h:525
PDInteger obid
Associated object ID.
Definition: pd_internal.h:711
pd_stack prev
Previous object in stack.
Definition: pd_internal.h:545
PDInteger bmark
buffer mark
Definition: pd_internal.h:524
PDPageReference * kids
Kids.
Definition: pd_internal.h:456
void * inst
instance of def, or NULL if not yet instantiated
Definition: pd_internal.h:196
PDTwinStreamRef stream
The pipe stream.
Definition: pd_internal.h:838
PDCMapRef toUnicode
CMap, or NULL if not yet compiled or if non-existent.
Definition: pd_internal.h:676
fake symbol, which is when sstart is actually a real string, rather than a pointer into the stream bu...
Definition: pd_internal.h:491
parser is in between objects
Definition: pd_internal.h:399
PDEnvRef env
the current environment
Definition: pd_internal.h:508
void(* PDInstanceCryptoExchange)(void *inst, PDCryptoInstanceRef ci, PDBool encrypted)
Definition: pd_internal.h:175
PDObjectRef ob
obstream object
Definition: pd_internal.h:250
PDXTableRef cxt
current input xref table
Definition: pd_internal.h:416
PDObjectType
Definition: PDDefines.h:611
PDInteger cfLength
crypt filter length, e.g. 16 for AESV2
Definition: pd_internal.h:735
#define PDOperatorSymbolExtEOB
End of buffer (usually synonymous with end of file) symbol.
Definition: PDOperator.h:53
PDCatalogRef catalog
the root catalog, if instantiated
Definition: pd_internal.h:438
char * sidebuf
temporary buffer (e.g. for Fetch)
Definition: pd_internal.h:819
PDBool deleteObject
if set, the object's XREF table slot is marked as free
Definition: pd_internal.h:203
short symindices
number of index slots in total (not = symbols, often bigger)
Definition: pd_internal.h:760
PDXTableRef mxt
master xref table, used for output
Definition: pd_internal.h:415
PDBool wrapped
Whether the string is wrapped.
Definition: pd_internal.h:892
PDObjectRef * contentObs
array of content objects for the page, or NULL if unfetched
Definition: pd_internal.h:331
char * po
The path of the output file.
Definition: pd_internal.h:834
char * allocBuf
The allocated buffer.
Definition: pd_internal.h:914
unsigned char * encMap
Encoding map, a 256 byte array mapping bytes to bytes.
Definition: pd_internal.h:678
Definition: PDSplayTree.c:20
void(* PDSynchronizer)(void *parser, void *object, const void *syncInfo)
Definition: PDDefines.h:311
pd_stack opers
current operators stack
Definition: pd_internal.h:309
PDDictionaryRef fonts
Dictionary mapping font names to their values.
Definition: pd_internal.h:665
PDOperatorType type
The operator type.
Definition: pd_internal.h:375
PDCryptoInstanceRef ci
Crypto instance.
Definition: pd_internal.h:896
PDInteger bucketc
Number of buckets.
Definition: pd_internal.h:644
Definition: pd_internal.h:362
Definition: pd_internal.h:718
Definition: pd_internal.h:544
Definition: pd_internal.h:611
Definition: pd_internal.h:468
Definition: pd_internal.h:688
Definition: pd_internal.h:709
Definition: pd_internal.h:639
Definition: pd_internal.h:622
Definition: pd_internal.h:656
Definition: pd_internal.h:343
Definition: pd_internal.h:672
Definition: pd_internal.h:663
Definition: pd_internal.h:869
Definition: pd_internal.h:249
Definition: pd_internal.h:236
Definition: pd_internal.h:374
Definition: pd_internal.h:451
Definition: pd_internal.h:408
Definition: pd_internal.h:829
Definition: pd_internal.h:857
Definition: pd_internal.h:507
Definition: pd_internal.h:497
PDInteger n
number of objects
Definition: pd_internal.h:251
Definition: pd_internal.h:753
Definition: pd_internal.h:773
Definition: pd_internal.h:887
Definition: pd_internal.h:913
Definition: pd_internal.h:789
Definition: pd_internal.h:805
pd_stack symbolStack
symbols stack; used to "rewind" when misinterpretations occur (e.g. for "number_or_obref" when one or...
Definition: pd_internal.h:515
parser is right after the object's content, and expects to see endobj or stream next ...
Definition: pd_internal.h:401
Definition: pd_internal.h:326
PDStringType
Definition: PDDefines.h:649
PDStreamFilterRef filter
filter, if any
Definition: pd_internal.h:518
PDBool encrypted
Flag indicating whether the string is encrypted or not; the value of this flag is UNDEFINED if ci == ...
Definition: pd_internal.h:897
Definitions for the Pajdeg interface.
PDParserState
Definition: pd_internal.h:398
PDSplayTreeRef branch[2]
The left and right branches of the tree.
Definition: pd_internal.h:366
FILE * fi
Reader.
Definition: pd_internal.h:809
PDScannerRef scanner
The main scanner.
Definition: pd_internal.h:410
void PDTwinStreamAsserts(PDTwinStreamRef ts)
Definition: PDTwinStream.c:409
pd_crypto crypto
crypto instance, if the document is encrypted
Definition: pd_internal.h:439
PDTaskRef child
The task's child task; child tasks are called in order.
Definition: pd_internal.h:795
standard symbol
Definition: pd_internal.h:486
PDCMapRange * csrs
Array of codespace ranges.
Definition: pd_internal.h:699
PDSize oboffset
offset of the current object
Definition: pd_internal.h:428
PDInteger * kids
Array of object IDs for all pages.
Definition: pd_internal.h:475
pd_stack garbageStack
temporary allocations; only used in operator function when a symbol is regenerated from a malloc()'d ...
Definition: pd_internal.h:516
PDReferenceRef rootRef
reference to the root object
Definition: pd_internal.h:431
PDSize bfcCap
BF char capacity.
Definition: pd_internal.h:694
#define PDTYPE_PTR_LEN
Definition: pd_internal.h:79
PDInteger bresoffset
previously popped result's offset relative to buf
Definition: pd_internal.h:521
PDBool encryptMetadata
whether metadata should be encrypted or not ("/EncryptMetadata true")
Definition: pd_internal.h:731
PDInteger mask
The mask.
Definition: pd_internal.h:775
PDBool isFilter
Whether task is a filter or not. Internally, a task is only a filter if it is assigned to a specific ...
Definition: pd_internal.h:791
PDScannerSymbolType
Definition: pd_internal.h:485
const void * syncInfo
user info object for synchronizer callback (usually a class instance, for wrappers) ...
Definition: pd_internal.h:212
#define PDOperatorSymbolGlobDelimiter
PDF delimiter character.
Definition: PDOperator.h:50
PDStringRef owner
owner string ("O"), 32-byte string based on owner and user passwords, used to compute encryption key ...
Definition: pd_internal.h:728
PDInteger contentCount
of content objects in the page
Definition: pd_internal.h:329
struct PDCryptoInstance * PDCryptoInstanceRef
Definition: pd_internal.h:166
FILE * fo
Writer.
Definition: pd_internal.h:836
PDInteger count
Number of entries.
Definition: pd_internal.h:455
PDInteger obid
The object ID.
Definition: pd_internal.h:858
PDBool hasStream
if set, object has a stream
Definition: pd_internal.h:197
void * decrypted
the data, in decrypted form
Definition: pd_internal.h:626
PDReferenceRef infoRef
reference to the info object
Definition: pd_internal.h:432
PDObjectType type
element object type
Definition: pd_internal.h:240
void * data
the data
Definition: pd_internal.h:624
short shash
symbol hash (not normalized)
Definition: pd_internal.h:499
void * PDAllocTyped(PDInstanceType it, PDSize size, void *dealloc, PDBool zeroed)
Definition: PDType.c:312
PDPageReference pages
The root pages.
Definition: pd_internal.h:472
PDInstanceCryptoExchange PDInstanceCryptoExchanges[]
Definition: pd_pdf_implementation.c:947
PDCMapCharMapping * bfcs
BF chars.
Definition: pd_internal.h:701
char * ovrStream
stream override
Definition: pd_internal.h:204
void PDObjectStreamParseExtractedObjectStream(PDObjectStreamRef obstm, char *buf)
Definition: PDObjectStream.c:122
PDSize obid
object ID of the current object
Definition: pd_internal.h:426
PDRect mediaBox
The media box of the catalog object.
Definition: pd_internal.h:471
PDBool outgrown
if true, a buffer with growth disallowed attempted to grow and failed
Definition: pd_internal.h:821
PDScannerPopFunc popFunc
the symbol pop function
Definition: pd_internal.h:526
PDParserRef parser
the parser associated with the owning PDF document
Definition: pd_internal.h:328
PDInteger ovrDefLen
take a wild guess
Definition: pd_internal.h:208
PDDictionaryRef systemInfo
The CIDSystemInfo dictionary, which has /Registry, /Ordering, and /Supplement.
Definition: pd_internal.h:689
PDStringEncoding enc
Encoding of the string.
Definition: pd_internal.h:890
PDInteger left
The current bytes left (remaining) in the buffer.
Definition: pd_internal.h:916
PDTwinStreamMethod
Definition: PDDefines.h:812
PDObjectRef encrypt
the encrypt object, if instantiated
Definition: pd_internal.h:437
pd_stack contextStack
context stack for buffer function/info
Definition: pd_internal.h:511
char * sstart
symbol start
Definition: pd_internal.h:498
PDObjectType type
data structure of def below
Definition: pd_internal.h:194
fpos_t offsi
absolute offset in input for heap
Definition: pd_internal.h:811
pd_stack * vstacks
Unresolved values in pd_stack form.
Definition: pd_internal.h:615
PDDeallocator deallocator
The deallocator for the task.
Definition: pd_internal.h:796
pd_stack varStack
Variable stack (for incomplete components)
Definition: pd_internal.h:346
PDObjectRef object
The object representation of the catalog.
Definition: pd_internal.h:470
PDInteger length
length of the (stringified) definition; only valid during a commit
Definition: pd_internal.h:239
PDDictionaryRef encodings
Encoding dictionary.
Definition: pd_internal.h:666
char * buf
buffer
Definition: pd_internal.h:520
PDSize bfcCount
Number of BF chars.
Definition: pd_internal.h:697
PDParserRef parser
The parser owning the catalog.
Definition: pd_internal.h:469
char * key
the key for this node
Definition: pd_internal.h:623
PDInteger count
Number of elements.
Definition: pd_internal.h:612
void PDEnvDestroy(PDEnvRef env)
Definition: PDEnv.c:31
PDInteger count
Number of pages (in total)
Definition: pd_internal.h:473
PDBool iterates
if true, scanner will stop while in this state, after reading one entry
Definition: pd_internal.h:754
pd_stack inserts
stack of objects that are meant to be inserted as soon as the current object is dealt with ...
Definition: pd_internal.h:422
parser is right after 1 2 obj and right before whatever the object consists of
Definition: pd_internal.h:400
void PDFlushUntil(void *ob)
Definition: PDType.c:427
PDInteger genid
The generation number.
Definition: pd_internal.h:859
PDSize bfrCount
Number of BF ranges.
Definition: pd_internal.h:696
PDObjectRef info
the info object, if instantiated
Definition: pd_internal.h:436
pd_crypto crypto
crypto object, if available
Definition: pd_internal.h:214
void(* PDDeallocator)(void *ob)
Definition: PDDefines.h:299
PDBool success
if true, the parser has so far succeeded at parsing the input file
Definition: pd_internal.h:442
PDInteger obid
The object ID.
Definition: pd_internal.h:459