Function Name: AreaCode

Extract USA Area Code from dialed number

Inputs:  Parm1 = Dialed number

Outputs: Parm2 = name of area

Returns: Area Code number, or 0 if not identified

 

Function Name: CountryCode

Extract Country Code from dialed number

Inputs:  Parm1 = Dialed number
         Parm3 = -1 to cause the function to return a Windows locale value

Outputs: Parm2 = name of country

Returns: Country Code number, or 0 if not identified
         Locale value if called with parm3=-1    

 

Function Name: DLLClose

This function should be called before termination by any application which directly or indirectly uses MSMQ operations

Inputs:  none

Outputs: none

Returns: 0

 

Function Name: GetCopiaShare

Get the pathname of the Copia Application Data folder.

Inputs:  none

Outputs: Parm1 = pathname of base FAXFACTS folder

Returns:  0 = success
         -1 = cannot determine folder

Note that Copia applications will not receive a -1 return code because the DLL will not be called if the configuration is invalid.

 

Function Name: GetDate

Get date the date value for use in setting system variable JOB_SCHEDULED from $fax_send_date and/or $fax_send_time in the job template properties; or for setting JOB_TIMESTAMP from the time of the last status change (.JST file).

Inputs:  Parm1 = Job Instance UJP pathname
         Parm3 = scheduled date (0), status date (1)

Outputs: Parm2 = YYYYMMDDHHNNSS

Returns:  0 = success
         -1 = job instance not found

 

Function Name: GetDigits

Inputs:  none

Returns: number of digits in job names (default 5)

 

Function Name: GetInstancePath

Builds a full pathname from Owner, Job Type, and instance number

Inputs:  Parm1 = owner
         Parm2 = jobtype
         Parm3 = job instance number

Outputs: Parm1 = path to instance UJP

Returns:  0 = instance found 
         -1 = owner not found
         -2 = jobtype not found
         -3 = instance not found
         -4 = resulting path >256 bytes

 

Function Name: GetJobtypeInst

Searches for a job instance number anywhere under a specific jobtype.

Inputs:  Parm1 = Path to jobtype UJP
         Parm3 = Instance number

Outputs: Parm1 = full path to instance UJP

Returns: Instance number or <0 if error
         -1 = No instance found with passed number
         -3 = Passed JobType.UJP not found

 

Function Name: GetOwnerInst

Searches for a job instance number anywhere under a specific owner.

Inputs:  Parm1 = Path to owner UJP
         Parm3 = Instance number

Outputs: Parm1 = full path to instance UJP

Returns: Instance number or <0 if error
         -1 = No instance found with passed number
         -2 = Instance numbering not owner-based nor system
         -3 = Passed Owner.UJP not found

 

Function Name: GetStartFS

Gets the starting FS number for an already-launched job.  The number is always the first sequential number of the job, even in the presence of the ReverseFS job option.

Inputs:  Parm1 = Instance UJP name

Returns: Starting FS number of job
          0 = job not launched
         -1 = no such instance

 

Function Name: GetSystemInst

Searches for a job instance number anywhere in the system (numbering must set as system-wide).

Inputs:  Parm3 = Instance number

Outputs: Parm1 = full path to instance UJP

Returns: Instance number or <0 if error
         -1 = No instance found with passed number
         -2 = Instance numbering is not system-wide

 

AddQuotes

Applies double-quotes to the specified string

Inputs:  Parm1 = Input string

Outputs: Parm2 = Quoted string

Example:

strcopy(parm1, "C:\\Program Files\\Copia");

(void)JobDllEntry("AddQuotes", parm1, parm2, 0);

// output in parm2 : "C:\Program Files\Copia"

 

StripQuotes

Strip double-quotes from the specified string

Inputs:  Parm1 = Input string

Outputs: Parm2 = Quotes-stripped string

Example:

strcopy(parm1, "\"This is a \"\"test\"\"\");

(void)JobDllEntry("StripQuotes", parm1, parm2, 0);

// output in parm2 : This is a "test"

 

ExpandFolderVariables

Expand any standard CopiaFacts folder variables

Inputs:  Parm1 = Input string

Outputs: Parm2 = Expanded string

Example:

strcopy(parm1, "@FFBASE\FAXFACTS.CFG");

(void)JobDllEntry("ExpandFolderVariables", parm1, parm2, 0);

// output in parm2 : \\MNAME\COPIA\FAXFACTS\FAXFACTS.CFG

 

EmbedFolderVariable

Embed a standard CopiaFacts folder variable

Inputs:  Parm1 = Input string
         Parm2 = Folder variable to use

Outputs: Parm2 = String including applicable variable

Example:

strcopy(parm1, "\\MNAME\COPIA\FAXFACTS\USERJOBS\SYSTEM.UJP");

strcopy(parm2, "@FFJOBS");

(void)JobDllEntry("EmbedFolderVariable", parm1, parm2, 0);

// output in parm2 : @FFJOBS\SYSTEM.UJP

 

CheckCP

Check the encoding of a file or string

Inputs:  Parm1 = Pathname/String
         Parm2 = set of keywords (as defined here)
         Parm3 = flags: 1: to write debug trace lines

                        2: parm1 is a string of 'char', not a filename

Returns: >0 = detected code page

          0 = no code page detected and no default supplied

         -1 = file open failure

         -2 = no keywords specified

         -3 = file too short to read BOM

         -4 = unsupported BOM

         -5 = invalid keyword

         -6 = file read failure

         -7 = exception

The check is controlled by the keywords described in the topic Handling Multiple Encodings.

 

SetCache

Sets cache parameters for the NEXTFS and NEXTJOB files.

Inputs:  Parm1 = keyword

         Parm3 = value

Returns:  0 = success

         -1 = invalid keyword

Valid keywords are:

NEXTFSBATCHSets the minimum size for each batch of FS numbers obtained from the NEXTFS file.
NEXTSFSSMALLMAXSets the maximum size of a request for FS numbers which will be met from the cached batch of numbers.  The value should be smaller than the NEXTFSBATCH value.  Requests larger than this value will always be met from the NEXTFS file.
NEXTJOBBATCHSets the minimum size for each batch of JOB numbers obtained from the NEXTJOB file.  Only one job number is requested at a time, so the request is always met from the batch.

The default values for the three parameters are respectively 1, 0, 1.  The override values set remain in use for the process calling calling the DLL until that process either ends or unload the DLL.

 

MaxBuf

Used to set a larger maximum buffer size for values returned in parm2 from the Direct UJP Access function set.  You should call this function as the first job function you call, or immediately after dynamic load of the DLL, and it acts globally in the calling process.  You are still responsible for providing a large enough buffer when you call the direct access function.  Values larger than 256 are ignored for calls to JobDLLEntryA and JobDllEntry and the default remains 256.  Values less than 256 are always ignored.  The value is in wide characters.

Inputs:  Parm3 = buffer size (in wchar_t)

Returns:  0 = success

 

NextFS

Obtains a on or more FS numbers from the NEXTFS file

Inputs:  Parm3 = quantity of FS numbers to obtain (normally 1)

Returns: >0 the first FS number of the batch obtained

         -1 could not obtain any FS numbers

 

MSMQPRI

Translates a TOSEND number to an MSMQ priority value using the tables specified by $msmq_pri.

Inputs:  Parm1 = MSMQ type (preproc, altproc or notify)

         Parm3 = TOSEND number

Returns: 0..7 The MSMQ priority selected

         -1   The specified priority was X (do not enqueue)

         -2   Invalid parameter