Hot folder support. More...
Files | |
file | hotfolder.h |
Hot folder implementation. | |
file | hotfoldererrors.h |
Header file defining the hotfolder result translation. | |
file | pnotify.c |
Implementation of the skinkit file change notification interfaces, in terms of the Microsoft Windows API. | |
file | hotfolder.c |
Hot folder implementation. | |
file | hotfolderprv.h |
Hot folder skinkit private API. | |
file | pnotify.h |
API for platform implementations of directory and file change notification. | |
Typedefs | |
typedef HqnResult | hotfolder_result |
Status return type for API calls. More... | |
Enumerations | |
enum | HOTFOLDER_RESULT { HOTFOLDER_SUCCESS = HQN_RESULT_SUCCESS , HOTFOLDER_ERROR , HOTFOLDER_ERROR_MEMORY , HOTFOLDER_ERROR_PARAMS , HOTFOLDER_ERROR_MISSING , HOTFOLDER_ERROR_DELETE , HOTFOLDER_ERROR_NAME } |
Return type for hotfolder monitoring calls. More... | |
Functions | |
hotfolder_result | hotfolder_monitor (const uint8 *directory, const uint8 *setupname, const uint8 *overrideps, uint32 rescan_ms, uint32 stabilise_ms, HqBool append, sw_inputq_mkcontext_fn *mkcontext, void *mkdata) |
Add a hot folder for monitoring, along with a configuration that will be used to submit jobs to the input queue. More... | |
hotfolder_result | hotfolder_unmonitor (const uint8 *directory) |
Remove a hot folder from monitoring. More... | |
static HqnResult | hotfolder_result_translate (hotfolder_result result) |
Translate a hotfolder-specific error code to a generic HqnResult error code. More... | |
Hot folder support.
This is the Harlequin SDK library's implementation of a hot folder monitor. The hot folder monitor watches one or more directories for new files, monitors them until they stabilize, then uses the input queue API to submit jobs to the RIP, monitors the jobs for completion, and then deletes the jobs from the hot folder.
The hotfolder_monitor() function is used to add a directory to monitor for jobs. The hotfolder_unmonitor() function is used to stop monitoring a directory.
Each hot folder can have its own configuration and override associated with it, and a different scanning and stabilization period. This may be useful for jobs submitted over network links, where the rate of change when copying a job is not as fast as a local filesystem.
The hotfolder_result_translate() function is used to convert hotfolder function results to HqnResult codes that can be used as RIP errors.
typedef HqnResult hotfolder_result |
Status return type for API calls.
This is a subclass of HqnResult that also supports some specific extra error codes generated by the hotfolder (declared as the HOTFOLDER_RESULT enumeration). Before assigning to values of HqnResult type or any of its other subclasses, hotfolder_result values must be converted to change the API specific values to HQN_RESULT_SUCCESS or a monitor UID error code greater than MON_CLASS_ERROR. This can be done by including the file hotfoldererrors.h and calling the function hotfolder_result_translate().
enum HOTFOLDER_RESULT |
Return type for hotfolder monitoring calls.
hotfolder_result hotfolder_monitor | ( | const uint8 * | directory, |
const uint8 * | setupname, | ||
const uint8 * | overrideps, | ||
uint32 | rescan_ms, | ||
uint32 | stabilise_ms, | ||
HqBool | append, | ||
sw_inputq_mkcontext_fn * | mkcontext, | ||
void * | mkdata | ||
) |
Add a hot folder for monitoring, along with a configuration that will be used to submit jobs to the input queue.
[in] | directory | The hot folder directory to monitor, as a platform path name. The directory must already exist. |
[in] | setupname | The configuration name that will be submitted to the input queue API for newly stabilized files in the hot folder. |
[in] | overrideps | An optional buffer of PostScript that will be run after the setup when running jobs from the hot folder. |
[in] | rescan_ms | The time, in milliseconds, between rescans of the hot folder. Setting this value to a lower number may result in more prompt response to new files in the hot folder, but will consume more processing time. Note that the hot folder implementation may use other techniques (such as file system change notification APIs) on some platforms to improve responsiveness. For such implementations, setting this value too low will consume processing time for no benefit. If this value is zero, a sensible default value will be chosen for the platform. |
[in] | stabilise_ms | The time, in milliseconds, between rescans of a file that is not in a stable state. When a new file is detected by a hotfolder scan, it is marked as unstable, and this timeout is used to check for key aspects of the file changing. Setting this value to a lower number may result in more prompt response to completed file copies into the hot folder, but will consume more processing time. Note that the hot folder implementation may use other techniques (such as file system change notification APIs) on some platforms to improve responsiveness. For such implementations, setting this value too low will consume processing time for no benefit. If this value is zero, a sensible default value will be chosen for the platform. |
[in] | append | This should be TRUE for normal hotfolders, where new items are added to the end of the input queue, giving first-in-first-out behaviour. If it is FALSE , the hotfolder will insert items at the head of the input queue, overriding all other input sources. |
[in] | mkcontext | A function to construct job contexts suitable for passing to inputq_print_job() when submitting hotfolder jobs. |
[in] | mkdata | A data pointer passed to the mkcontext job constructor function to create job contexts. |
Note that if a hot folder monitor is started on a directory that already has files in it, the files will be added to the input queue as soon as the monitor determines they are stable.
|
inlinestatic |
Translate a hotfolder-specific error code to a generic HqnResult error code.
[in] | result | One of the HOTFOLDER_RESULT values, or an error value greater than MON_CLASS_ERROR. |
The header file defining this function should be included explicitly in every C or C++ file that calls it.
hotfolder_result hotfolder_unmonitor | ( | const uint8 * | directory | ) |
Remove a hot folder from monitoring.
[in] | directory | The hot folder directory to stop monitoring, as a platform path name. If this parameter is NULL, all hot folder monitors are removed. |