Pajdeg  0.2.2
Pajdeg
Files | Macros | Functions | Variables
Pajdeg PDF Implementation

Files

file  pd_pdf_implementation.h
 

Macros

#define PDIdentifies(key, pdtype)   ((PDID)key == &pdtype)
 

Functions

void PDDeallocatorNullFunc (void *ob)
 
void pd_pdf_implementation_use ()
 
void pd_pdf_implementation_discard ()
 
void pd_pdf_conversion_use ()
 
void pd_pdf_conversion_discard ()
 
char * PDStringFromComplex (pd_stack *complex)
 
void * PDInstanceCreateFromComplex (pd_stack *complex)
 
PDObjectType PDObjectTypeFromIdentifier (PDID identifier)
 

Variables

const char * PD_META
 %meta entry
 
const char * PD_STRING
 A string.
 
const char * PD_NUMBER
 A number, boolean, or null value.
 
const char * PD_NAME
 /Name entry
 
const char * PD_OBJ
 an object (with definition)
 
const char * PD_REF
 an object reference
 
const char * PD_HEXSTR
 a <abcdef1234567890> hex string
 
const char * PD_ENTRIES
 entries in a dictionary or array
 
const char * PD_DICT
 a dictionary
 
const char * PD_DE
 a dictionary entry
 
const char * PD_ARRAY
 an array
 
const char * PD_AE
 an array entry
 
const char * PD_XREF
 an XREF
 
const char * PD_STARTXREF
 the "startxref" symbol
 
const char * PD_ENDSTREAM
 the "endstream" symbol
 
PDStateRef pdfRoot
 
PDStateRef xrefSeeker
 
PDStateRef stringStream
 
PDStateRef arbStream
 
PDDeallocator PDDeallocatorNull
 

Detailed Description

The PDF implementation in Pajdeg makes use of states and operators to set up how the scanner should interpret the source data.

States in Pajdeg are constant definitions for given states in the input file, and operators are chained together actions to take based on some given input to a state.

There are two main root states in the implementation: pdfRoot, for parsing PDF content as normal, and xrefSeeker, for locating the starting byte offset of the primary XREF table. There are a few additional root states, stringStream (currently unused) and arbStream (used to parse object streams).

These states are made up of operators which chain states together to form the complete specification implementation.

See also
STATE_GRP
OPERATOR_GRP

Macro Definition Documentation

#define PDIdentifies (   key,
  pdtype 
)    ((PDID)key == &pdtype)

Convenience macro for comparing a given value to one of the PD_ entries.

Function Documentation

void pd_pdf_conversion_discard ( )

Release the PDF conversion table.

void pd_pdf_conversion_use ( )

Retain the PDF conversion table.

void pd_pdf_implementation_discard ( )

Release (destructing, if no other retains remain) the PDF implementation.

void pd_pdf_implementation_use ( )

Retain (constructing, if no previous retains were made) the PDF implementation.

void* PDInstanceCreateFromComplex ( pd_stack complex)

Convert stack representation of complex object into an appropriate object.

Note
Returned strings are returned as PDString instances.
Returned entry must be PDRelease()'d
Parameters
complexStack representation
Returns
An appropriate object. Use PDResolve() to determine its type.
PDObjectType PDObjectTypeFromIdentifier ( PDID  identifier)

Determine object type from identifier.

Parameters
identifierOne of the PD_ identifiers.
char* PDStringFromComplex ( pd_stack complex)

Convert stack representation of complex object into PDF string.

Warning
Destroys target stack unless preserve flag is set.
Todo:
Change name to reflect that returned value is allocated and must be freed.
See also
pd_stack
pd_stack_set_global_preserve_flag

Variable Documentation

PDStateRef arbStream

Arbitrary object stream (e.g. object stream post-header) state.

PDDeallocator PDDeallocatorNull

A generic null deallocator.

PDStateRef pdfRoot

The root PDF state.

PDStateRef stringStream

String stream state. Instead of attempting to generate complex objects using definitions, this state always returns the next symbol (whitespace separated) as a string.

PDStateRef xrefSeeker

The PDF array state, useful for iterating over stuff. The root XREF seeking state.