Harlequin RIP SDK

File related utility functions. More...

#include "pfile.h"

Macros

#define LONGESTFILENAME   2048
 The longest file name supported by the SDK.
 

Typedefs

typedef struct FileDesc FileDesc
 Opaque file descriptor structure which hides platform-specific content.
 

Enumerations

enum  PKError {
  PKErrorNone , PKErrorUnknown , PKErrorParameter , PKErrorPointerNull ,
  PKErrorNumericRange , PKErrorNumericValue , PKErrorStringEmpty , PKErrorStringLength ,
  PKErrorStringSyntax , PKErrorStringValue , PKErrorOperationDenied , PKErrorNonExistent ,
  PKErrorAlreadyExists , PKErrorAccessDenied , PKErrorInUse , PKErrorOperationFailed ,
  PKErrorAbort , PKErrorNoMemory , PKErrorDiskFull , PKErrorSoftwareLimit ,
  PKErrorHardware , PKErrorUnimplemented , PKErrorFatal
}
 This set of error returns should cover most cases – at least enough for the RIP to extract the information it needs from this platform abstraction layer. More...
 

Functions

HqBool PKAppDir (uint8 *pAppDir)
 Copy, into the buffer provided, the directory in which the application executable lives. This directory will be terminated with a directory separator. More...
 
HqBool PKCurrDir (uint8 *pCurrDir)
 Copy into the buffer provided the directory in which the application is running. This directory will be terminated with a directory separator. More...
 
HqBool PKSWDir (uint8 *pSWDir)
 Copy the SW directory name into the buffer provided. This directory will be terminated with a directory separator. More...
 
HqBool PKSetSWDir (const uint8 *pSWDir)
 Record an explicit path to the SW folder, overriding any default search rules. More...
 
HqBool PKSWWriteRAM (void)
 Return a boolean indicating if a RAM device should be mounted for writing files. A RAM device may be used as the writable folder for files when using a union device. More...
 
uint8PKSWWriteDir (void)
 Return the writable SW directory name, if set. More...
 
HqBool PKSetSWWriteDir (uint8 *pSWDir)
 Record an explicit path to a writable SW folder. More...
 
HqBool PKParseRoot (uint8 *pOutput, const uint8 **ppInput)
 Parse the root part of an absolute filename *ppInput. More...
 
uint32 PKBuildRoot (uint8 *pOutput, const uint8 *pInput)
 Performs the inverse of PKParseRoot(), and builds a complete root part of a platform dependent filename from the variable part as previously output by PKParseRoot(). More...
 
HqBool PKMakePSFilename (const uint8 *filename, uint8 *psFilename)
 Converts an absolute or relative filename to an absolute PostScript filename. Relative filenames are made absolute by prefixing the current working directory as returned by PKCurrDir(). More...
 
FileDescPKOpenFile (const uint8 *filename, int32 openflags, int32 *pError)
 Open a file, with the given flags (from swdevice.h.) More...
 
int32 PKReadFile (FileDesc *pDescriptor, uint8 *buff, int32 len, int32 *pError)
 Read a specified number of bytes from a file into a buffer. More...
 
int32 PKWriteFile (FileDesc *pDescriptor, const uint8 *buff, int32 len, int32 *pError)
 Write a specified number of bytes from a buffer into a file. More...
 
int32 PKCloseFile (FileDesc *pDescriptor, int32 *pError)
 Close an open file. More...
 
HqBool PKSeekFile (FileDesc *pDescriptor, Hq32x2 *destination, int32 flags, int32 *pError)
 Seek to a byte position within a file, with the given flags. More...
 
HqBool PKBytesFile (FileDesc *pDescriptor, Hq32x2 *bytes, int32 reason, int32 *pError)
 Return the number of bytes in a file in the bytes parameter. More...
 
int32 PKStatusFile (const uint8 *filename, STAT *statbuff, int32 *pError)
 Populate a structure with information about a file. More...
 
int32 PKDeleteFile (const uint8 *filename, int32 *pError)
 Delete a file. More...
 
int32 PKRenameFile (const uint8 *fromfile, const uint8 *tofile, int32 *pError)
 Rename a file. More...
 
void * PKFindFirstFile (const uint8 *pszPattern, uint8 *pszEntryName, int32 *pError)
 Find the first file matching a pattern. More...
 
HqBool PKFindNextFile (void *handle, uint8 *pszEntryName, int32 *pError)
 Enumerate file entries matching a pattern. It returns, in pszEntryName, the path of an entry in the directory. Calls on the same handle will enumerate the matched entries until all entries have been enumerated. More...
 
HqBool PKCloseFindFile (void *handle, int32 *pError)
 Close the file matching specified by the handle. More...
 
void * PKDirOpen (const uint8 *pszDirName, int32 *pError)
 Open a directory. More...
 
HqBool PKDirNext (void *handle, uint8 *pszEntryName, HqBool *fIsFolder, int32 *pError)
 Enumerate entries in a directory. It returns, in pszEntryName, the leaf name of an entry in the directory. Calls on the same handle will enumerate the entries in the directory until all entries have been enumerated. More...
 
HqBool PKDirClose (void *handle, int32 *pError)
 Close the directory specified by the handle. More...
 
HqBool PKOSFontDir (uint8 *pszFontDir)
 Get an explicit path to the OS font folder, converted to PostScript form (e.g., %C%/WINDOWS/fonts/). More...
 
int32 PKFilenameToUTF8 (const uint8 *filename, uint8 *utf8name, int32 *pError)
 Convert a partial filename to UTF-8. More...
 
int32 PKFlushFile (FileDesc *pDescriptor, int32 *pError)
 Flush an open file. More...
 

Detailed Description

File related utility functions.

Platform file abstraction. Each platform can have its own implementation of these functions.

Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved.

This example is provided on an "as is" basis and without warranty of any kind. Global Graphics Software Ltd. does not warrant or make any representations regarding the use or results of use of this example.