Harlequin RIP SDK
ripthread.c File Reference

Example implementation of corerip integration: Starting the RIP. More...

#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#include "skinkit.h"
#include "hqcstass.h"
#include "hqmemcpy.h"
#include "ripthread.h"
#include "dlliface.h"
#include "swstart.h"
#include "swdevice.h"
#include "swtrace.h"
#include "file.h"
#include "mem.h"
#include "kit.h"
#include "skinmon.h"
#include "probelog.h"
#include "rdrapi.h"
#include "skintimeline.h"

Enumerations

enum  
 
enum  
 

Functions

static void RipExit (int32 n, uint8 *text)
 RipExit will be called if for some reason the rip exits.
 
static void RipReboot (void)
 The RIP will call back on this function if the interpreter reboots. More...
 
static void RipWarn (uint8 *buffer)
 RipWarn.
 
void HqCustomAssert (const char *pszFilename, int nLine, const char *pszFormat, va_list vlist, int assertflag)
 
void HqCustomTrace (const char *pszFilename, int nLine, const char *pszFormat, va_list vlist)
 
void SwLeSetTraceHandler (SwTraceHandlerFn *handler)
 Set a probe callback function to capture fine-grained tracing information. More...
 
void SwLeProbe (int trace_id, int trace_type, intptr_t designator)
 Call the skinkit trace handler, if installed. More...
 
HqBool InitRipMemory (size_t RIP_maxAddressSpaceInBytes, size_t RIP_workingSizeInBytes, size_t RIP_emergencySizeInBytes, void *pMemory)
 Initialise memory for RIP, and call SwDllInit(). More...
 
HqBool SwLeAddCustomDevices (int32 nCustomDevices, DEVICETYPE **ppCustomDevices)
 Makes DEVICETYPE objects available for discovery by the RIP. More...
 
void SwLeSetRipRendererThreads (int32 nThreads)
 Sets the number of renderer threads. More...
 
void SwLeSetHqAssertHandlers (HqAssertHandlers_t *handlers)
 Set the HQASSERT() and HQTRACE() handler functions to be used by the Skin, SDK and the RIP. More...
 
void GetHqAssertHandlers (HqAssertHandlers_t *handlers)
 Get the custom assertion functions provided by a module. More...
 
void StartRip (void)
 Sets up the environment for SwDllStart() and then calls it.
 

Variables

SWSTART memory []
 
static SWSTART starters []
 
static DllFuncs dllFuncs
 
DEVICETYPE Fs_Device_Type
 The device type structure for the file system devices. More...
 

Detailed Description

Example implementation of corerip integration: Starting the RIP.

The StartRip() function sets up the environment for SwDllStart by allocating memory for the rip and gathering together all the devices it requires.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Indexes into memory structure

◆ anonymous enum

anonymous enum

Indexes into starters structure

Function Documentation

◆ GetHqAssertHandlers()

void GetHqAssertHandlers ( HqAssertHandlers_t functions)

Get the custom assertion functions provided by a module.

Parameters
[out]functionsA pointer to a custom assert handler structure.

This function is used by some dynamic libraries to hook into assertion functions provided by the host program. The linker options should be set to export this function for dynamic libraries that provide assert handlers.

◆ HqCustomAssert()

void HqCustomAssert ( const char *  pszFilename,
int  nLine,
const char *  pszFormat,
va_list  vlist,
int  assertflag 
)

It is customary to name the assert handler function HqCustomAssert. This prototypes exist to help make it easy to use.

Parameters
[in]pszFilenameThe filename in which the assert happened.
nLineThe line in pszFilename at which the assert happened.
[in]pszFormatA printf() style format used to interpret the vlist variable argument list.
[in]vlistA variable argument list to construct the assert message from.
assertflagEither AssertNotRecursive or AssertRecursive.

◆ HqCustomTrace()

void HqCustomTrace ( const char *  pszFilename,
int  nLine,
const char *  pszFormat,
va_list  vlist 
)

It is customary to name the trace handler function HqCustomTrace. This prototype exists to help make it easy to use.

Parameters
[in]pszFilenameThe filename in which the trace happened.
nLineThe line in pszFilename at which the trace happened.
[in]pszFormatA printf() style format used to interpret the vlist variable argument list.
[in]vlistA variable argument list to construct the assert message from.

◆ InitRipMemory()

HqBool InitRipMemory ( size_t  RIP_maxAddressSpaceInBytes,
size_t  RIP_workingSizeInBytes,
size_t  RIP_emergencySizeInBytes,
void *  pMemory 
)

Initialise memory for RIP, and call SwDllInit().

<Memory required by the RIP; value is pointer_value type to SWSTART_MEMORY

<Use instead of SWMemoryTag for RIP to manage its own memory, growing as required.

◆ RipReboot()

static void RipReboot ( void  )
static

The RIP will call back on this function if the interpreter reboots.

A reboot of the interpreter is a "soft" reboot. This callback allows the host application to react to the situation where the RIP's job server loop has reset itself. This can happen due to a serious error during processing of a job, or because the job itself has called the PostScript quit operator explicitly. The RIP restarts its server loop automatically and continues running.

The application may wish to react by soft-rebooting one or more of its own modules, but no specific actions are required by the RIP. Any modules that are shutdown by this function should also be re-started. A reboot of the interpreter does not necessarily mean that the host application is shutting down, although it can, of course, choose to do so.

A client reboot callback can be registered via SwLeSetRipRebootFunction().

Variable Documentation

◆ dllFuncs

DllFuncs dllFuncs
static

Functions provided by app for use by corerip library

◆ Fs_Device_Type

DEVICETYPE Fs_Device_Type
extern

The device type structure for the file system devices.

Device type list

Points to note: (a) of the function pointers included in this structure, only the tickle function should be a NULL pointer. The rest must be filled in with stub routines which at least set the last error flag appropriately. (b) the device is "relative" (it can support named files, unlike, for example, a serial line). This means that when an attempt is made to open a named file in PostScript unqualified by a device, devices of this type will each receive open requests until one does not report an "undefined" error. See SDK DG 10.7.2. (c) the device is "writable": this means that devices of this type will be considered when trying to open a file for writing from PostScript.

◆ memory

SWSTART memory[]
Initial value:
= {
{ 0, { 0 } },
{ (14) , { 0 } },
{ (5) , { 0 } },
{ (17) , { 0 } },
{ (18) , { 0 } },
{ (-1) , { 0 } },
{ (-1) , { 0 } }
}

Structures required for passing to SwDllInit

◆ starters

SWSTART starters[]
static
Initial value:
= {
{ (4) , { 0 } },
{ (-1) , { 0 } }
}

Structures required for passing to SwDllStart