Harlequin RIP SDK
DeviceType Struct Reference

This is the structure used to represent a device type (class) implementation in the Harlequin RIP core. More...

#include "swdevice.h"

Data Fields

int32 devicenumber
 The device type number.
 
int32 devicetypeflags
 Flags to indicate specifics of device. More...
 
int32 sizeof_private
 The size of the private data to allocate when a device instance is mounted.
 
int32 unused1
 Reserved for future use.
 
DEVICELIST_TICKLE unused2
 Reserved for future use.
 
DEVICELIST_LAST_ERROR last_error
 Return last error for this device. More...
 
DEVICELIST_INIT device_init
 Call to initialise device. More...
 
DEVICELIST_OPEN open_file
 Call to open file on device. More...
 
DEVICELIST_READ read_file
 Call to read data from file on device. More...
 
DEVICELIST_WRITE write_file
 Call to write data to file on device. More...
 
DEVICELIST_CLOSE close_file
 Call to close file on device. More...
 
DEVICELIST_ABORT abort_file
 Call to abort action on the device. More...
 
DEVICELIST_SEEK seek_file
 Call to seek file on device. More...
 
DEVICELIST_BYTES bytes_file
 Call to get bytes available for open file. More...
 
DEVICELIST_STATUS_FILE status_file
 Call to check status of file. More...
 
DEVICELIST_START_LIST start_file_list
 Call to start iterating file names. More...
 
DEVICELIST_NEXT next_file
 Call to get next file in list. More...
 
DEVICELIST_END_LIST end_file_list
 Call to end listing. More...
 
DEVICELIST_RENAME rename_file
 Rename file on the device. More...
 
DEVICELIST_DELETE delete_file
 Remove file from device. More...
 
DEVICELIST_SET_PARAM set_param
 Call to set a device parameter. More...
 
DEVICELIST_START_PARAM start_param
 Call to start iterating device parameters. More...
 
DEVICELIST_GET_PARAM get_param
 Call to get the next device parameter. More...
 
DEVICELIST_STATUS_DEVICE status_device
 Call to get the status of the device. More...
 
DEVICELIST_DISMOUNT device_dismount
 Call to dismount the device. More...
 
DEVICELIST_BUFFER_SIZE buffer_size
 Optional call to return buffer size. More...
 
DEVICELIST_IOCTL ioctl_call
 For "special" control notifications. More...
 
DEVICELIST_SPARE spare
 Spare slot.
 

Detailed Description

This is the structure used to represent a device type (class) implementation in the Harlequin RIP core.

A number of macros, e.g., theIDevTypeNumber(), are for convenience in accessing the fields of the structures: don't feel obliged to use them. You may want to call methods functions on a device in your own code, and the macros provide a notation for doing so.

Field Documentation

◆ abort_file

DEVICELIST_ABORT DeviceType::abort_file

Call to abort action on the device.

Parameters
devThe current device.
descriptorA descriptor returned by a previous open call.
Returns
0 for success, -1 for failure.

Calling this method is equivalent to calling a DEVICELIST_CLOSE method, except that it signals an error in the processing of the file. Any data waiting to be written to the file will be discarded.

◆ buffer_size

DEVICELIST_BUFFER_SIZE DeviceType::buffer_size

Optional call to return buffer size.

Parameters
devThe current device.
Returns
The buffer size requested in bytes. If this is less than zero, then the DEVICESMALLBUFF flag is examined to determine the size of the buffer.

◆ bytes_file

DEVICELIST_BYTES DeviceType::bytes_file

Call to get bytes available for open file.

Parameters
devThe current device.
descriptorA descriptor returned by a previous open call.
bytesThe number of bytes available.
reasonOne of SW_BYTES_AVAIL_REL, SW_BYTES_TOTAL_ABS.
Returns
TRUE if there are bytes available (in which case return 0 in bytes if the number is not known), FALSE for failure.

This routine returns the number of bytes available for reading without waiting. See the bytesavailable operator, described in [RB3]. If the number of bytes available is not known, but it is possible that there are some, 0 should be returned in bytes and TRUE should be returned. If the file has reached EOF or when some other error occurs, such as when the file is open for writing only, FALSE should be returned and the DEVICELIST_LAST_ERROR method should return DeviceIOError.

The value of reason is one of:

SW_BYTES_AVAIL_REL
Return the number of bytes immediately available after the current position.
SW_BYTES_TOTAL_ABS
Return the total extent of the file in bytes.

◆ close_file

DEVICELIST_CLOSE DeviceType::close_file

Call to close file on device.

Parameters
devThe current device.
descriptorA descriptor returned by a previous open call.
Returns
0 for success, -1 for failure.

Any data waiting to be written on the file will be written before this call returns. Note that the Harlequin Core itself buffers data read from or written to a file, and so the device implementation normally need not (and indeed should not) also implement a buffering scheme.

◆ delete_file

DEVICELIST_DELETE DeviceType::delete_file

Remove file from device.

Parameters
devThe current device.
filenameThe name of a file to remove.
Returns
0 for success, -1 for failure.

This routine removes the file with the given name. If the file has been opened it is implementation-dependent whether any further operations can be done with the open file. This permits the file to be closed in the underlying operating system, if necessary, before deleting this file, as is necessary for example with Windows.

If there is no file named filename, then the DEVICELIST_LAST_ERROR method should return DeviceUndefined. If the device does not support renaming, or the particular filename is not permitted to be changed, then the DEVICELIST_LAST_ERROR method should return DeviceInvalidAccess. After any other failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

◆ device_dismount

DEVICELIST_DISMOUNT DeviceType::device_dismount

Call to dismount the device.

Parameters
devThe current device.
Returns
0 for success, -1 for failure. This should normally return 0, even if most device operations are not implemented.

This routine is called when a device is dismounted. All files open when the Harlequin Core unmounted the device will have been closed. The routine should perform any required tasks, such as freeing any resources used by that device.

◆ device_init

DEVICELIST_INIT DeviceType::device_init

Call to initialise device.

Parameters
devThe current device.
Returns
0 for success, -1 for failure.

This call is made once for each device instance, and will be the first call for the device instance.

◆ devicetypeflags

int32 DeviceType::devicetypeflags

Flags to indicate specifics of device.

Values are a combination of the DEVICETYPE_flags values.

◆ end_file_list

DEVICELIST_END_LIST DeviceType::end_file_list

Call to end listing.

Parameters
devThe current device.
handleA file list iterator pointer returned by the DEVICELIST_START_LIST method.
Returns
0 for success, -1 for failure.

This method is called to free any resources allocated to enumerate file names. If DEVICELIST_START_LIST was successful, this routine will be called at any time after it. It is possible that not all matches have been requested.

After a failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

◆ get_param

DEVICELIST_GET_PARAM DeviceType::get_param

Call to get the next device parameter.

Parameters
devThe current device.
paramA structure in which to store the parameter value. If the paramname field is NULL, then store the next parameter in an iteration, otherwise store the value of the requested parameter.
Returns
One of the values: ParamIgnored, ParamAccepted, ParamError (or -1).

This routine has two functions. If the DEVICEPARAM::paramname field of the param argument is NULL when it is called, the next parameter name and value in an iteration started by DEVICELIST_START_PARAM should be returned through the DEVICEPARAM structure. If the DEVICEPARAM::paramname field is not NULL then the value of that specific parameter name should be returned through the DEVICEPARAM structure.

In the second case if the parameter name is not recognized the routine should return ParamIgnored, otherwise it should return ParamAccepted. If an error occurs, ParamError should be returned and the DEVICELIST_LAST_ERROR method should return an appropriate error code.

If not returning ParamIgnored, the DEVICEPARAM::type field must be set to one of DEVICEPARAM_type values. The appropriate union field and length if necessary should be set to the value of the parameter. If a string value is returned, the string value field should point to the device's local copy of the string. The RIP will copy the string into its own storage. If returning a composite object (an array or a dictionary), the implementation may allocate memory for the DEVICEPARAM array representing the composite object and store the memory pointer in the DEVICEPARAM::paramval.compobval field. The RIP will copy the value into its own storage as necessary. This memory should be freed by the device type implementation on the next call to DEVICELIST_GET_PARAM or DEVICELIST_START_PARAM. The client is required to call DEVICELIST_START_PARAM if the final call it made to DEVICELIST_GET_PARAM returned a composite object.

If returning the next parameter (DEVICEPARAM::paramname is NULL on function entry) the DEVICEPARAM::paramname field should be set to point to the name of the parameter being returned, and the DEVICEPARAM::paramnamelen field set to the length of that name.

Note
The iteration may not be thread-safe, so can generally only be used from PostScript language code, or code called from the PostScript language.

The Harlequin RIP SDK provides some utility routines to assist writing parameter methods:

◆ ioctl_call

DEVICELIST_IOCTL DeviceType::ioctl_call

For "special" control notifications.

Parameters
devThe current device.
fileDescriptorA descriptor returned by a previous open call.
opcodeA device-specific value, or one of the generic values:
DeviceIOCtl_PDFFilenameToPS
This may be used on file system devices, when interpreting PDF files. The data value arg should be cast to a PDF_FILESPEC. The filename in this structure should be converted from a platform specific form to a generic form.
DeviceIOCtl_OSDeviceName
This may be used on file system devices, when interpreting SOAR host device files. The data value arg should be cast to an OS_FILESPEC. The filename in this structure should be converted from a platform specific form to a suitable form for the %os% device.
DeviceIOCtl_RasterRequirements
Only used by the page buffer device. The data value arg should be cast to a RASTER_REQUIREMENTS pointer.
DeviceIOCtl_RenderingReady
Only used by the page buffer device. The data value arg should be cast to a RASTER_REQUIREMENTS pointer.
DeviceIOCtl_RenderingPass
Only used by the page buffer device. The data value arg should be cast to a RASTER_REQUIREMENTS pointer.
DeviceIOCtl_RenderingSheet
Only used by the page buffer device. The data value arg should be cast to a RASTER_REQUIREMENTS pointer.
DeviceIOCtl_GetBufferForRaster
Only used by the page buffer device. The data value arg should be cast to a RASTER_DESTINATION pointer.
DeviceIOCtl_RasterBandSize
Only used by the page buffer device. The data value arg should be cast to a RASTER_BANDSIZE pointer.
DeviceIOCtl_BlankPage
Only used by the page buffer device. The data value arg should be cast to a RASTER_BLANK pointer.
Parameters
argA data parameter for the control function.
Return values
0for success
-1for failure.
-2if the opcode is not implemented.

◆ last_error

DEVICELIST_LAST_ERROR DeviceType::last_error

Return last error for this device.

Parameters
devThe current device.
Returns
One of the values: DeviceNoError, DeviceInvalidAccess, DeviceIOError, DeviceLimitCheck, DeviceUndefined, DeviceUnregistered, DeviceVMError, DeviceTimeout, DeviceInterrupted. The %pagebuffer% device may also return one of: DeviceReOutput, DeviceNotReady, DeviceCancelPage, DeviceReOutputPageBuffer. Any value greater than or equal to MON_CLASS_ERROR will be interpreted as a sw_mon_type error UID, and may be deconstructed using the macros in monevent.h to get the error subclass, PostScript error, and error UID.

This method should use a thread local variable to store and retrieve the error code. The device instance may be called from multiple different RIP or SDK threads. The RIP skins provide the functions skindevices_set_last_error() and skindevices_last_error() that a device type implementation can use to set or retrieve a thread-local variable containing the device error.

◆ next_file

DEVICELIST_NEXT DeviceType::next_file

Call to get next file in list.

Parameters
devThe current device.
handleA file list iterator pointer returned by the device type's DEVICELIST_START_LIST method.
patternThe pattern passed to the DEVICELIST_START_LIST method.
entryA structure in which to store the next matching filename.
Returns
One of the values: FileNameMatch, FileNameRangeCheck, FileNameNoMatch, FileNameError (or -1).

If there is another match for the pattern, a pointer to the filename should be stored in the entry argument's FILEENTRY::name field, and its length should be stored in the FILEENTRY::namelength field. The file name need not be zero-terminated. It must not be string on the C stack. The return value of the method should be FileNameMatch if there was a match.

After a failure, the DEVICELIST_LAST_ERROR method should return:

FileNameRangeCheck
If the filename is too long.
FileNameNoMatch
If there are no more matches.
FileNameError
If an error occurred while looking for a match.

After a failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

Note that if the underlying file system supports directories and the permissions on one or more directories do not allow the filenames in those directories to be enumerated this should not be treated as an error. The routine should just ignore those directories and continue the search for matches.

The Harlequin Core provides two routines to help implement this method in a device type. These are:

  • SwPatternMatch(), which returns TRUE if a zero-terminated string matches a zero-terminated pattern, or FALSE if the string does not match the pattern.
  • SwLengthPatternMatch(), which is similar to SwPatternMatch(), but the pattern and string are given by start address and length, and need not be zero-terminated.

◆ open_file

DEVICELIST_OPEN DeviceType::open_file

Call to open file on device.

Parameters
devThe current device.
filenameThe file name to open.
openflagsOne of the following: SW_RDONLY, SW_WRONLY, SW_RDWR, Combined (using bitwise OR) with any combination of: SW_APPEND, SW_CREAT, SW_TRUNC, SW_EXCL.
Returns
A non-negative file descriptor if successful, -1 for failure.

Descriptors have to be unique only for each device; different devices (even of the same device type) can use the same number for different files without confusion.

The PostScript language model of files is of a stream of bytes; that is, there is no record structure or distinction between binary and text files. The implementation of this method call must open the file in the appropriate way to support this (for example, by opening all files in binary mode on Windows).

After a failure, the DEVICELIST_LAST_ERROR method should return:

DeviceUndefined
If the filename is invalid for the device, or the file does not exist and the value of openflags does not imply creation.
DeviceInvalidAccess
If the requested access set by openflags are not allowed for this file.
DeviceLimitCheck
If the file cannot be opened because to do so would exceed some implementation-defined limit on the number of open files.
DeviceVMError
If the device type implementation could not allocate memory required to represent the open file.
DeviceIOError
For any other error that cannot be distinguished.

◆ read_file

DEVICELIST_READ DeviceType::read_file

Call to read data from file on device.

Parameters
devThe current device.
descriptorA descriptor returned by a previous open call.
buffBuffer into which the data read is stored.
lenThe maximum number of bytes to read.
Returns
The number of bytes of data read on success, 0 if the file is at EOF, or -1 for failure.

Unless the device type specifies an explicit size (as described in device_buffersize determine file buffer size the space available in buff (len) is guaranteed to be at least 1024 bytes, although the read routine can return fewer if appropriate.

If an error occurs, the Harlequin Core will not assume anything about the contents of the buffer. Thus, it is safe to put bytes into this buffer even if an error occurs at some point before all the bytes have been read. After a failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

◆ rename_file

DEVICELIST_RENAME DeviceType::rename_file

Rename file on the device.

Parameters
devThe current device.
file1The name of a file to rename.
file2The name to which file1 will be renamed.
Returns
0 for success, -1 for failure.

If there is no file named file1, then the DEVICELIST_LAST_ERROR method should return DeviceUndefined. If the device does not support renaming, or the particular filenames are not permitted to be changed, then the DEVICELIST_LAST_ERROR method should return DeviceInvalidAccess. After any other failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

◆ seek_file

DEVICELIST_SEEK DeviceType::seek_file

Call to seek file on device.

Parameters
devThe current device.
descriptorA descriptor returned by a previous open call.
destnThe location to seek to.
flagsOne of SW_SET, SW_INCR, SW_XTND.
Returns
TRUE for success, FALSE for failure.

Some devices will be able to support positionable files that is, there is a current file position associated with the open file and the next read or write will read from, or write to, bytes at that point, and this current file position can be set.

The flags parameter indicates how the destn parameter should be interpreted. If flags is SW_SET, the current file position should be set to destn bytes from the start of the file. If flags is SW_INCR, the current file position should be changed by destn bytes, and if flags is SW_XTND, the current file position should be set to the length of the file plus destn. If this results in the current file position being beyond the current end of the file, the file is open for writing, and the file permissions allow it to be extended, then file will be extended to the current file position. [RB3] does not specify the values in any bytes between the old and new lengths of the file.

Calls to this method with a value of zero in the destn argument have special meanings. The meaning of such a call depends on the value of the flags argument. Even if a device cannot support seeking, it is usually possible to implement support for some or all of these special calls:

SW_SET
The RIP uses this flags value and a destn value of zero to ask a device if it supports arbitrary seeks. A device should return TRUE if it does, or FALSE otherwise.
SW_INCR
The RIP uses this flags value and a destn value of zero when it wants to know the current file position. It is often possible to support this feature even when other seeks are not supported. If supported, the file position value should be written back into destn.
SW_XTND
The RIP uses this flags value and a destn value of zero to ask a device to flush the file, discarding any remaining input. This may not always require reading the remaining input for example, a network connection could be shut down instead.

After a failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

◆ set_param

DEVICELIST_SET_PARAM DeviceType::set_param

Call to set a device parameter.

Parameters
devThe current device.
paramA structure describing the parameter to set and its value.
Returns
One of the values: ParamAccepted, ParamTypeCheck, ParamRangeCheck, ParamConfigError, ParamIgnored, ParamError (or -1).

The PostScript language operator setdevparams will call this device routine. The param argument specifies the device parameter name and its value in the DEVICEPARAM structure. Parameters are always named by a string, specified by DEVICEPARAM::paramname and DEVICEPARAM::paramnamelen, and accessible through theIDevParamName() and theIDevParamNameLen() macros. Note that the parameter name is not necessarily zero-terminated, the parameter length should always be checked when accessing the parameter name.

The DEVICEPARAM::type field indicates the type of the parameter to set. This will be one of:

ParamBoolean
A boolean value is stored in the DEVICEPARAM::paramval.boolval union field, accessible through theIDevParamBoolean() macro.
ParamInteger
An integer value is stored in the DEVICEPARAM::paramval.intval union field, accessible through theIDevParamInteger() macro.
ParamFloat
A real value is stored in the DEVICEPARAM::paramval.floatval union field, accessible through theIDevParamFloat() macro.
ParamNull
No value is stored. The interpretation of a null parameter depends on the device type.
ParamString
A real value is stored in the DEVICEPARAM::paramval.strval union field and the DEVICEPARAM::paramval.strvallen length, accessible through theIDevParamString() and theIDevParamStringLength() macros. Note that this string value is not necessarily zero-terminated, the string length should always be checked when accessing string values.

Strings set using this method are stored in the Harlequin Core internal memory which may be re-used; therefore, if the device needs to keep referring to the string, it must copy it into its own memory.

ParamArray
An array of DEVICEPARAM structures are stored in the DEVICEPARAM::paramval.compobval union field and the DEVICEPARAM::paramval.strvallen length, accessible through theIDevParamArray() and theIDevParamArrayLen() macros. The DEVICEPARAM structures in this array (and any sub-objects in them) are only guaranteed to remain valid for the duration of this method invocation. Therefore, if the device needs to keep referring to them, it must copy them into its own memory or unpack them into device-specific structures. The parameter name fields of the array of DEVICEPARAM structures are not used, and should not be dereferenced.
ParamDict
An array of DEVICEPARAM structures (arranged in pairs) are stored in the DEVICEPARAM::paramval.compobval union field and the DEVICEPARAM::paramval.strvallen length, accessible through theIDevParamDict() and theIDevParamDictLen() macros. The array of DEVICEPARAM structures is twice the length of theIDevParamDictLen(). The first structure in each pair represents a dictionary key; the second structure in each pair represents a dictionary value. The DEVICEPARAM structures in this array (and any sub-objects in them) are only guaranteed to remain valid for the duration of this method invocation. Therefore, if the device needs to keep referring to them, it must copy them into its own memory or unpack them into device-specific structures. The parameter name fields of the array of DEVICEPARAM structures are not used, and should not be dereferenced.

This method returns a code to indicate the success or failure of setting the parameter:

ParamAccepted
The value ParamAccepted means that the parameter has been set successfully. This does not necessarily mean the exact value was used, or that the parameter will read back with the value just set: these are implementation defined.
ParamTypeCheck
ParamTypeCheck means the value set was an incorrect type for the parameter of that name.
ParamRangeCheck
ParamRangeCheck indicates that the value was unreasonable for the device parameter.
ParamConfigError
ParamConfigError indicates that the value of the parameter was reasonable, but not achievable with this implementation.
ParamIgnored
If the parameter name is not supported by this device, ParamIgnored should be returned.
ParamError
ParamError means that some other error occurred for example, this error might be that configuring underlying hardware failed. If ParamError is returned, the DEVICELIST_LAST_ERROR method should return an appropriate error code.

The following device parameters are valid for all devices, and are not passed to the device. They are handled internally by the Harlequin Core:

/Password
See the description of setdevparams in [RB3].
/DeviceType
Binds an uninitialized device mount to a particular device type, and initializes an instance of the device.
/Enable
If set to true, permits file system operations on that device. An invalidaccess error is generated if the device's type has not been set yet.

The Harlequin RIP SDK provides some utility routines to assist writing parameter methods:

◆ start_file_list

DEVICELIST_START_LIST DeviceType::start_file_list

Call to start iterating file names.

Parameters
devThe current device.
patternA file pattern to match.
Returns
A pointer to an iterator structure if successful, NULL for failure. If it is known that no files match the pattern, then NULL may be returned, and an immediate call to the DEVICELIST_LAST_ERROR routine should return DeviceNoError.

This routine should do any initializion necessary such that successive calls to DEVICELIST_NEXT return filenames matching that template. The pointer returned by this function will be passed to the each call to DEVICELIST_NEXT. The implementation of DEVICELIST_NEXT should use the pointer to identify where in the enumeration of files matching this pattern it has reached. It is possible to have recursive calls to filenameforall, so nested filename enumerations must be supported.

If for some reason the enumeration cannot be started, the routine should return NULL. After a failure, the DEVICELIST_LAST_ERROR method should return:

DeviceNoError
If it is known that the enumeration will never return a matching file name. In this case the RIP will not then call DEVICELIST_NEXT and DEVICELIST_END_LIST.
DeviceLimitCheck
If the nesting level of filename enumerations is too deep, or some other limit has been exceeded.
DeviceVMError
If the device type implementation could not allocate memory required to enumerate files matching the pattern.
DeviceIOError
For any other error that cannot be distinguished.

If this function succeeds, the device type's DEVICELIST_END_LIST method must be called after iterating file names.

◆ start_param

DEVICELIST_START_PARAM DeviceType::start_param

Call to start iterating device parameters.

Parameters
devThe current device.
Returns
The number of device parameters to enumerate (this may be 0 if there are no device parameters), or -1 for failure.

This routine is called by the PostScript language operator currentdevparams to determine how many parameters will be returned, and to start enumerating them. The number returned need not be the same as the number of device parameter names recognized by the device, because some device parameters can be write only, or a parameter may only be returned once a value has been set for it. The number excludes the parameters that are handled by the interpreter itself (/Password, /DeviceType, /Enable). Following this call, DEVICELIST_GET_PARAM will be called multiple times with a NULL DEVICEPARAM::paramname field to get each of the parameters.

If there are no such device parameters, 0 should be returned. If an error occurs, -1 should be returned.

Note
The iteration may not be thread-safe, so can generally only be used from PostScript language code, or code called from the PostScript language.

◆ status_device

DEVICELIST_STATUS_DEVICE DeviceType::status_device

Call to get the status of the device.

Parameters
devThe current device.
devstatA structure in which to return the status of the device.
Returns
0 for success, -1 for failure.

This routine returns information on the device. The interpretation of these is device-dependent, but for a device that supports files such as a hard disk:

  • DEVSTAT::block_size is the size of blocks on the device.
  • DEVSTAT::size is the total size of the device.
  • DEVSTAT::free is the amount of space available on the device.

◆ status_file

DEVICELIST_STATUS_FILE DeviceType::status_file

Call to check status of file.

Parameters
devThe current device.
filenameThe file to check status.
statbuffPointer to a structure in which to put the file status.
Returns
0 for success, -1 for failure.

This routine returns information about a named file on the device. If the file exists, the fields in the structure pointed to by the statbuff argument should be set appropriately and 0 is returned to indicate success:

  • The STAT::bytes field should be set to the length of the file in bytes.
  • The STAT::referenced field should be set to the time of the last read or write operation to that file.
  • The STAT::created field should be set to the time that the file was created.

Suitable default values may be substituted for either time if they are not supported by the underlying file system. The time units and origin are not defined by [RB3]: the only legal interpretation of these values by a PostScript language program is to assume that a larger value means a later time. This implies that the value should not overflow a signed 32-bit integer in the near future. Global Graphics recommends that if the implementation has a real time clock, the times should be measured in seconds since 00:00:00 (midnight), 1st Jan. 1970. If additionally, the implementation supports time zones, this should be in measured in the UTC time zone. This is the same as the UNIX definition. If there is no real time clock, any monotonically increasing value can be used. If files persist between invocations of the product, the current value of this "clock" must be stored in some permanent storage.

After a failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.

◆ write_file

DEVICELIST_WRITE DeviceType::write_file

Call to write data to file on device.

Parameters
devThe current device.
descriptorA descriptor returned by a previous open call.
buffBuffer from which the data written is taken.
lenThe maximum number of bytes to write.
Returns
The number of bytes of data written on success, or -1 for failure.

After a failure, the DEVICELIST_LAST_ERROR method should return DeviceIOError.


The documentation for this struct was generated from the following file: