Pdftools SDK
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
PdfTools_PdfToolsSys.h File Reference
#include <stdarg.h>
#include <stdio.h>

Go to the source code of this file.

Classes

struct  TPdfToolsSys_StreamDescriptor
 Structure that groups a set of callbacks that model streams. More...
 

Macros

#define PdfToolsSys_PathStreamDescriptor_Create   PdfToolsSys_PathStreamDescriptor_CreateA
 

Typedefs

typedef pos_t(STDCALLTGetLength) (void *handle)
 
typedef int(STDCALLTSeek) (void *handle, pos_t iPos)
 
typedef pos_t(STDCALLTTell) (void *handle)
 
typedef size_t(STDCALLTRead) (void *handle, void *pData, size_t nSize)
 
typedef size_t(STDCALLTWrite) (void *handle, const void *pData, size_t nSize)
 
typedef void(STDCALLTRelease) (void *handle)
 
typedef struct TPdfToolsSys_StreamDescriptor TPdfToolsSys_StreamDescriptor
 Structure that groups a set of callbacks that model streams.
 

Functions

static pos_t STDCALL PdfToolsSysFILEPtrGetLength__ (void *handle)
 Callback implementation for TPdfToolsSys_StreamDescriptor::pfGetLength for FILE*.
 
static int STDCALL PdfToolsSysFILEPtrSeek__ (void *handle, pos_t iPos)
 Callback implementation for TPdfToolsSys_StreamDescriptor::pfSeek for FILE*.
 
static pos_t STDCALL PdfToolsSysFILEPtrTell__ (void *handle)
 Callback implementation for TPdfToolsSys_StreamDescriptor::pfTell for FILE*.
 
static size_t STDCALL PdfToolsSysFILEPtrRead__ (void *handle, void *pData, size_t nSize)
 Callback implementation for TPdfToolsSys_StreamDescriptor::pfRead for FILE*.
 
static size_t STDCALL PdfToolsSysFILEPtrWrite__ (void *handle, const void *pData, size_t nSize)
 Callback implementation for TPdfToolsSys_StreamDescriptor::pfWrite for FILE*.
 
static void STDCALL PdfToolsSysFILEPtrRelease__ (void *handle)
 Callback implementation for TPdfToolsSys_StreamDescriptor::pfRelease for FILE*.
 
static void PdfToolsSysCreateFILEStreamDescriptor (TPdfToolsSys_StreamDescriptor *pDescriptor, FILE *handle, int bCloseOnRelease)
 Initialization function for TPdfToolsSys_StreamDescriptor for FILE*.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsSys_PathStreamDescriptor_CreateA (TPdfToolsSys_StreamDescriptor *pDescriptor, const char *szPath, BOOL bIsReadOnly)
 Initialization function for TPdfToolsSys_StreamDescriptor for a given path.
 
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsSys_PathStreamDescriptor_CreateW (TPdfToolsSys_StreamDescriptor *pDescriptor, const WCHAR *szPath, BOOL bIsReadOnly)
 Initialization function for TPdfToolsSys_StreamDescriptor for a given path.
 
PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfToolsSys_PathStreamDescriptor_Close (TPdfToolsSys_StreamDescriptor *pDescriptor)
 Close the underlying file.
 

Macro Definition Documentation

◆ PdfToolsSys_PathStreamDescriptor_Create

#define PdfToolsSys_PathStreamDescriptor_Create   PdfToolsSys_PathStreamDescriptor_CreateA

Typedef Documentation

◆ TGetLength

typedef pos_t(STDCALL * TGetLength) (void *handle)

◆ TPdfToolsSys_StreamDescriptor

typedef struct TPdfToolsSys_StreamDescriptor TPdfToolsSys_StreamDescriptor

Structure that groups a set of callbacks that model streams.

◆ TRead

typedef size_t(STDCALL * TRead) (void *handle, void *pData, size_t nSize)

◆ TRelease

typedef void(STDCALL * TRelease) (void *handle)

◆ TSeek

typedef int(STDCALL * TSeek) (void *handle, pos_t iPos)

◆ TTell

typedef pos_t(STDCALL * TTell) (void *handle)

◆ TWrite

typedef size_t(STDCALL * TWrite) (void *handle, const void *pData, size_t nSize)

Function Documentation

◆ PdfToolsSys_PathStreamDescriptor_Close()

PDFTOOLS_EXPORT void PDFTOOLS_CALL PdfToolsSys_PathStreamDescriptor_Close ( TPdfToolsSys_StreamDescriptor * pDescriptor)

Close the underlying file.

Parameters
[in]pDescriptorPointer to the TPdfToolsSys_StreamDescriptor that wraps the file.

◆ PdfToolsSys_PathStreamDescriptor_CreateA()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsSys_PathStreamDescriptor_CreateA ( TPdfToolsSys_StreamDescriptor * pDescriptor,
const char * szPath,
BOOL bIsReadOnly )

Initialization function for TPdfToolsSys_StreamDescriptor for a given path.

Parameters
[out]pDescriptorStream descriptor that is initialized.
[in]szPathPath to a file for which a stream descriptor shall be initialized.
[in]bIsReadOnlyIf set TRUE the stream only allows for reading; if set to FALSE the stream allows for reading and writing.
Returns
TRUE file opened successfully; FALSE failed to open the file.

◆ PdfToolsSys_PathStreamDescriptor_CreateW()

PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsSys_PathStreamDescriptor_CreateW ( TPdfToolsSys_StreamDescriptor * pDescriptor,
const WCHAR * szPath,
BOOL bIsReadOnly )

Initialization function for TPdfToolsSys_StreamDescriptor for a given path.

Parameters
[out]pDescriptorStream descriptor that is initialized.
[in]szPathPath to a file for which a stream descriptor shall be initialized.
[in]bIsReadOnlyIf set TRUE the stream only allows for reading; if set to FALSE the stream allows for reading and writing.
Returns
TRUE file opened successfully; FALSE failed to open the file.

◆ PdfToolsSysCreateFILEStreamDescriptor()

static void PdfToolsSysCreateFILEStreamDescriptor ( TPdfToolsSys_StreamDescriptor * pDescriptor,
FILE * handle,
int bCloseOnRelease )
static

Initialization function for TPdfToolsSys_StreamDescriptor for FILE*.

Parameters
[out]pDescriptorFILE* stream descriptor that is initialized.
[in]handleHandle of stream.
[in]bCloseOnReleaseDetermines if the stream needs to be explicitly closed by fclose((FILE*)handle). If set TRUE the stream does not need to be explicitly closed; if set FALSE the stream needs to be explicitly closed.

◆ PdfToolsSysFILEPtrGetLength__()

static pos_t STDCALL PdfToolsSysFILEPtrGetLength__ ( void * handle)
static

Callback implementation for TPdfToolsSys_StreamDescriptor::pfGetLength for FILE*.

Parameters
[in,out]handleHandle of stream.
Returns
Length of stream in bytes. -1 in case of an error.

◆ PdfToolsSysFILEPtrRead__()

static size_t STDCALL PdfToolsSysFILEPtrRead__ ( void * handle,
void * pData,
size_t nSize )
static

Callback implementation for TPdfToolsSys_StreamDescriptor::pfRead for FILE*.

Read from stream into buffer

Parameters
[in,out]handleHandle of stream.
[out]pDataPointer to the buffer to which the data from the stream is written.
[in]nSizeSize in bytes of the stream to be read.
Returns
Number of bytes read; 0 for end of stream, -1 in case of an error.

◆ PdfToolsSysFILEPtrRelease__()

static void STDCALL PdfToolsSysFILEPtrRelease__ ( void * handle)
static

Callback implementation for TPdfToolsSys_StreamDescriptor::pfRelease for FILE*.

Release handle to stream.

Parameters
[in,out]handleHandle of stream.

◆ PdfToolsSysFILEPtrSeek__()

static int STDCALL PdfToolsSysFILEPtrSeek__ ( void * handle,
pos_t iPos )
static

Callback implementation for TPdfToolsSys_StreamDescriptor::pfSeek for FILE*.

Set new stream position.

Parameters
[in,out]handleHandle of stream.
[in]iPosByte position of stream. -1 set position to end of stream.
Returns
1 for success; 0 for failure.

◆ PdfToolsSysFILEPtrTell__()

static pos_t STDCALL PdfToolsSysFILEPtrTell__ ( void * handle)
static

Callback implementation for TPdfToolsSys_StreamDescriptor::pfTell for FILE*.

Get current position of stream.

Parameters
[in,out]handleHandle of stream.
Returns
Current byte position of stream; -1 if position is unknown.

◆ PdfToolsSysFILEPtrWrite__()

static size_t STDCALL PdfToolsSysFILEPtrWrite__ ( void * handle,
const void * pData,
size_t nSize )
static

Callback implementation for TPdfToolsSys_StreamDescriptor::pfWrite for FILE*.

Write to stream from buffer

Parameters
[in,out]handleHandle of stream.
[in]pDataPointer to the buffer from which data is written to the stream.
[in]nSizeSize in bytes to be written.
Returns
Number of bytes written to stream; 0 or -1 indicate an error.