Pajdeg  0.2.2
Pajdeg
Data Structures | Macros
pd_internal.h File Reference

Internal definitions for Pajdeg. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "PDDefines.h"
#include "PDOperator.h"
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  PDObject
 
struct  PDObjectStreamElement
 
struct  PDObjectStream
 
struct  PDContentStream
 
struct  PDPage
 
struct  PDEnv
 
struct  pd_btree
 
struct  PDOperator
 
struct  PDParser
 
struct  PDPageReference
 
struct  PDCatalog
 
struct  PDScannerSymbol
 
struct  PDScanner
 
struct  pd_stack
 
struct  PDArray
 
struct  PDDictionaryNode
 
struct  PDDictionary
 
struct  PDDictionaryStack
 
struct  PDFontDictionary
 
struct  PDFont
 
struct  PDCMap
 
struct  PDCryptoInstance
 
struct  pd_crypto
 
struct  PDState
 
struct  PDStaticHash
 
struct  PDTask
 
struct  PDTwinStream
 
struct  PDPipe
 
struct  PDReference
 
struct  PDNumber
 
struct  PDString
 
struct  PDStringConv
 

Macros

#define true   1
 
#define false   0
 

Typedefs

Conversion (PDF specification)
typedef struct PDStringConvPDStringConvRef
 

Functions

Construction
PDObjectRef PDObjectCreate (PDInteger obid, PDInteger genid)
 
Environment
void PDEnvDestroy (PDEnvRef env)
 
Twin streams
void PDPipeCloseFileStream (FILE *stream)
 
FILE * PDPipeOpenInputStream (const char *path)
 
FILE * PDPipeOpenOutputStream (const char *path)
 
String
void PDStringAttachCryptoInstance (PDStringRef string, PDCryptoInstanceRef ci, PDBool encrypted)
 
void PDArrayAttachCryptoInstance (PDArrayRef array, PDCryptoInstanceRef ci, PDBool encrypted)
 
void PDDictionaryAttachCryptoInstance (PDDictionaryRef dictionary, PDCryptoInstanceRef ci, PDBool encrypted)
 

Private structs

#define PDTYPE_PTR_LEN   4
 
#define PDAlloc(s, d, z)   PDAllocTyped(PDInstanceTypeUnset,s,d,z)
 
#define PDTYPE_ASSERT(ob)   PDAssert(((PDTypeRef)ob - 1)->pdc == PDC)
 
typedef struct PDCryptoInstancePDCryptoInstanceRef
 
typedef void(* PDInstanceCryptoExchange) (void *inst, PDCryptoInstanceRef ci, PDBool encrypted)
 
typedef struct PDObjectStreamElementPDObjectStreamElementRef
 
char * PDC
 
PDInstanceCryptoExchange PDInstanceCryptoExchanges []
 
void * PDAllocTyped (PDInstanceType it, PDSize size, void *dealloc, PDBool zeroed)
 
void PDFlush (void)
 
void PDFlushUntil (void *ob)
 
PDCryptoInstanceRef PDCryptoInstanceCreate (pd_crypto crypto, PDInteger obid, PDInteger gennum)
 
PDObjectStreamRef PDObjectStreamCreateWithObject (PDObjectRef object)
 
PDBool PDObjectStreamParseRawObjectStream (PDObjectStreamRef obstm, char *rawBuf)
 
void PDObjectStreamParseExtractedObjectStream (PDObjectStreamRef obstm, char *buf)
 
void PDObjectStreamCommit (PDObjectStreamRef obstm)
 

Parser

enum  PDParserState { PDParserStateBase, PDParserStateObjectDefinition, PDParserStateObjectAppendix, PDParserStateObjectPostStream }
 
typedef struct PDXTablePDXTableRef
 
typedef struct PDPageReference PDPageReference
 

Scanner

enum  PDScannerSymbolType {
  PDScannerSymbolTypeDefault = PDOperatorSymbolGlobRegular, PDScannerSymbolTypeWhitespace = PDOperatorSymbolGlobWhitespace, PDScannerSymbolTypeDelimiter = PDOperatorSymbolGlobDelimiter, PDScannerSymbolTypeNumeric = PDOperatorSymbolExtNumeric,
  PDScannerSymbolTypeEOB = PDOperatorSymbolExtEOB, PDScannerSymbolTypeFake = PDOperatorSymbolExtFake
}
 
typedef struct PDScannerSymbolPDScannerSymbolRef
 

Stack

#define PD_STACK_STRING   0
 Stack string type.
 
#define PD_STACK_ID   1
 Stack identifier type.
 
#define PD_STACK_STACK   2
 Stack stack type.
 
#define PD_STACK_PDOB   3
 Stack object (PDTypeRef managed) type.
 
#define PD_STACK_FREEABLE   4
 Stack freeable type.
 
typedef struct PDDictionaryNodePDDictionaryNodeRef
 
typedef struct PDCMapRange PDCMapRange
 Private structure for ranges (<hex> <hex>), where multi-byte ranges are rectangles, not sequences (see PDF specification)
 
typedef struct PDCMapRangeMapping PDCMapRangeMapping
 Private structure for range mappings (<hex> <hex> <hex>)
 
typedef struct PDCMapCharMapping PDCMapCharMapping
 Private structure for individual char mappings (<hex> <hex>)
 

Macros / convenience

#define PDDEF   const void*[]
 
#define PDDef(defs...)   (PDDEF){(void*)defs, NULL}
 
#define PD_WARNINGS
 
#define PDError(args...)
 
#define PD_WARNINGS
 
#define PDWarn(args...)
 
#define PDNotice(args...)
 
#define PDAssert(args...)
 
#define PDRequire(state, retval, msg...)
 
#define as(type, expr...)   ((type)(expr))
 
#define PDInstancePrinterRequire(b, r)
 
#define PDInstancePrinterInit(itype, b, r)
 
#define fmatox(x, ato)
 
void _PDBreak ()
 
void PDTwinStreamAsserts (PDTwinStreamRef ts)
 
 fmatox (long long, atoll) fmatox(long
 

Detailed Description

Internal definitions for Pajdeg.

Macro Definition Documentation

#define false   0

The false value.

#define PDAlloc (   s,
  d,
 
)    PDAllocTyped(PDInstanceTypeUnset,s,d,z)

// IGNORE Allocate a new PDType object, with given size and deallocator.

Parameters
sSize of object.
dDealloc method as a (*)(void*).
zWhether the allocated block should be zeroed or not. If true, calloc is used to allocate the memory.
#define PDTYPE_ASSERT (   ob)    PDAssert(((PDTypeRef)ob - 1)->pdc == PDC)

A macro for asserting that an object is a proper PDType.

#define PDTYPE_PTR_LEN   4

The length of PDType, in pointers.

#define true   1

The truth value.

Typedef Documentation

Crypto instance for arrays/dicts.

typedef void(* PDInstanceCryptoExchange) (void *inst, PDCryptoInstanceRef ci, PDBool encrypted)

Crypto object exchange function signature.

Used to hand crypto information to arbitrary objects.

Function Documentation

void* PDAllocTyped ( PDInstanceType  it,
PDSize  size,
void *  dealloc,
PDBool  zeroed 
)

Allocate a new PDType object with a defined instance type, with given size and deallocator.

Parameters
itInstance type.
sizeSize of object.
deallocDealloc method as a (*)(void*).
zeroedWhether the allocated block should be zeroed or not. If true, calloc is used to allocate the memory.
void PDFlush ( void  )

Flush autorelease pool.

void PDFlushUntil ( void *  ob)

Flush until the given object is encountered, or until the autorelease pool is exhausted. The object is released as well.

Parameters
obTermination marker for flush
PDObjectRef PDObjectCreate ( PDInteger  obid,
PDInteger  genid 
)

Create PDObjectRef with given ID and generation number.

Note
Normally this method is not called directly, but instead PDParserRef's PDParserCreateNewObject() is used.
Parameters
obidObject ID
genidGeneration number
Returns
A detached object.

Variable Documentation

char* PDC

Identifier for PD type checking.

PDInstanceCryptoExchange PDInstanceCryptoExchanges[]

Crypto object exchange function array, matching up with all non-negative PDInstanceType entries.