Jump to content

DosPFSInit: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call allows the Font Switcher to initialize code page and font switching for a specified printer.
This call allows the Font Switcher to initialize code page and font switching for a specified printer.


==Syntax==
==Syntax==
<PRE>
  DosPFSInit (CPHdw, FontFileName, PrinterType, PrinterName, Instances, Reserved)
  DosPFSInit


    (CPHdw, FontFileName, PrinterType, PrinterName, Instances, Reserved)
</PRE>
==Parameters==
==Parameters==
; CPHdw (PUSHORT) - input : Address of the pointer list, in the following format, that specifies the hardware code page and fonts on the printer.
;CPHdw (PUSHORT) - input : Address of the pointer list, in the following format, that specifies the hardware code page and fonts on the printer.
 
::0 - Number of definitions that follow. DWord 1/N - Code page number (1st Word of DWord) and Font ID (2nd Word of DWord) for each hardware font in order corresponding to the hardware code page and font selection numbers. (For example, the first code page and font ID value corresponds to the default hardware font 0, the second, to hardware font 1, the third, to hardware font 2, and so on. If the default hardware font is not known, 0 should be specified for the default code page and font).
'''Word        Description Word'''
;FontFileName (PSZ) - input :  Address of the pathname of the font file of the specified printer that initiates the code page and font switching.
 
;PrinterType (PSZ) - input : Address of the printer type ID.
0       Number of definitions that follow.  
;PrinterName (PSZ) - input : Address of the name of the printer that initiates code page and font switching.
 
;Instances (USHORT) - input : Maximum number of different instances of use tracking code page and font switching. This value is advisory for the Font Switcher allocating enough resources for the specified number of instances being tracked.
DWord 1/N         Code page number (1st Word of DWord) and Font ID (2nd Word of DWord) for each hardware font in order corresponding to the hardware code page and font selection numbers. (For example, the first code page and font ID value corresponds to the default hardware font 0, the second, to hardware font 1, the third, to hardware font 2, and so on. If the default hardware font is not known, 0 should be specified for the default code page and font).  
;Reserved (ULONG) - input : Reserved must be set to zero.
 
; FontFileName (PSZ) - input :  Address of the pathname of the font file of the specified printer that initiates the code page and font switching.  
 
; PrinterType (PSZ) - input : Address of the printer type ID.  
 
; PrinterName (PSZ) - input : Address of the name of the printer that initiates code page and font switching.  
 
; Instances (USHORT) - input : Maximum number of different instances of use tracking code page and font switching. This value is advisory for the Font Switcher allocating enough resources for the specified number of instances being tracked.  
 
; Reserved (ULONG) - input : Reserved must be set to zero.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return values are:
 
Return values are:
 
* Code page switcher already initialized
* Code page switcher already initialized
* User entered too many ROMs in DEVINFO, initialization continued with the rest
* User entered too many ROMs in DEVINFO, initialization continued with the rest
* Wrong or missing font file ID
* Wrong or missing font file ID
* Code page switcher internal error
* Code page switcher internal error
* 10   Invalid printer name as input  
*10 Invalid printer name as input
* 11   Printer type input does not match that in font file  
*11 Printer type input does not match that in font file
* 12   Could not get storage for control blocks  
*12 Could not get storage for control blocks
* 14   Could not open font file during initialization  
*14 Could not open font file during initialization
* 17   Switcher reports too many system file number entries  
*17 Switcher reports too many system file number entries
* 19   I/O error reading font file control sequence section  
*19 I/O error reading font file control sequence section
* 20   I/O error reading font file header  
*20 I/O error reading font file header
* 21   I/O error reading font file font definition block  
*21 I/O error reading font file font definition block
* 22   Some fonts bad due to error in font file, initialization continued.
*22 Some fonts bad due to error in font file, initialization continued.


==Remarks==
==Remarks==
DosPFSInit is intended for use only by applications that replace the spooler as a print monitor and that do code page switching. Other applications should use printer IOCTLs to manipulate printer code page switching.
DosPFSInit is intended for use only by applications that replace the spooler as a print monitor and that do code page switching. Other applications should use printer IOCTLs to manipulate printer code page switching.


DosPFSInit is located in SPOOLCP.DLL (not DOSCALLS.LIB) and requires an import statement in the module definition file. Refer to the IBM Operating System/2 Version 1.2 Building Programs, Module Definition File Statements section for information regarding the import statement.  
DosPFSInit is located in SPOOLCP.DLL (not DOSCALLS.LIB) and requires an import statement in the module definition file. Refer to the ''IBM Operating System/2 Version 1.2 Building Programs'', Module Definition File Statements section for information regarding the import statement.


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSPFS
#define INCL_DOSPFS
Line 59: Line 42:
                             Instances, Reserved);
                             Instances, Reserved);


PUSHORT         CPHdw;        /* Hdw Font definition list */
PUSHORT CPHdw;        /* Hdw Font definition list */
PSZ             FontFileName;  /* File pathname of the font file to use */
PSZ     FontFileName;  /* File pathname of the font file to use */
PSZ             PrinterType;  /* Printer type string */
PSZ     PrinterType;  /* Printer type string */
PSZ             PrinterName;  /* Printer name string */
PSZ     PrinterName;  /* Printer name string */
USHORT           Instances;    /* Number of spool instances */
USHORT   Instances;    /* Number of spool instances */
ULONG           0;            /* Reserved */
ULONG   0;            /* Reserved */


USHORT           rc;            /* return code */
USHORT   rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosPFSInit:FAR
EXTRN  DosPFSInit:FAR
Line 84: Line 67:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos16]]

Latest revision as of 05:10, 26 January 2020

This call allows the Font Switcher to initialize code page and font switching for a specified printer.

Syntax

DosPFSInit (CPHdw, FontFileName, PrinterType, PrinterName, Instances, Reserved)

Parameters

CPHdw (PUSHORT) - input
Address of the pointer list, in the following format, that specifies the hardware code page and fonts on the printer.
0 - Number of definitions that follow. DWord 1/N - Code page number (1st Word of DWord) and Font ID (2nd Word of DWord) for each hardware font in order corresponding to the hardware code page and font selection numbers. (For example, the first code page and font ID value corresponds to the default hardware font 0, the second, to hardware font 1, the third, to hardware font 2, and so on. If the default hardware font is not known, 0 should be specified for the default code page and font).
FontFileName (PSZ) - input
Address of the pathname of the font file of the specified printer that initiates the code page and font switching.
PrinterType (PSZ) - input
Address of the printer type ID.
PrinterName (PSZ) - input
Address of the name of the printer that initiates code page and font switching.
Instances (USHORT) - input
Maximum number of different instances of use tracking code page and font switching. This value is advisory for the Font Switcher allocating enough resources for the specified number of instances being tracked.
Reserved (ULONG) - input
Reserved must be set to zero.

Return Code

rc (USHORT) - return
Return values are:
  • Code page switcher already initialized
  • User entered too many ROMs in DEVINFO, initialization continued with the rest
  • Wrong or missing font file ID
  • Code page switcher internal error
  • 10 Invalid printer name as input
  • 11 Printer type input does not match that in font file
  • 12 Could not get storage for control blocks
  • 14 Could not open font file during initialization
  • 17 Switcher reports too many system file number entries
  • 19 I/O error reading font file control sequence section
  • 20 I/O error reading font file header
  • 21 I/O error reading font file font definition block
  • 22 Some fonts bad due to error in font file, initialization continued.

Remarks

DosPFSInit is intended for use only by applications that replace the spooler as a print monitor and that do code page switching. Other applications should use printer IOCTLs to manipulate printer code page switching.

DosPFSInit is located in SPOOLCP.DLL (not DOSCALLS.LIB) and requires an import statement in the module definition file. Refer to the IBM Operating System/2 Version 1.2 Building Programs, Module Definition File Statements section for information regarding the import statement.

Bindings

C

#define INCL_DOSPFS

USHORT  rc = DosPFSInit(CPHdw, FontFileName, PrinterType, PrinterName,
                             Instances, Reserved);

PUSHORT  CPHdw;         /* Hdw Font definition list */
PSZ      FontFileName;  /* File pathname of the font file to use */
PSZ      PrinterType;   /* Printer type string */
PSZ      PrinterName;   /* Printer name string */
USHORT   Instances;     /* Number of spool instances */
ULONG    0;             /* Reserved */

USHORT   rc;            /* return code */

MASM

EXTRN  DosPFSInit:FAR
INCL_DOSPFS         EQU 1

PUSH@  WORD    CPHdw         ;Hdw Font definition list
PUSH@  ASCIIZ  FontFileName  ;File pathname of the font file to use
PUSH@  ASCIIZ  PrinterType   ;Printer type string
PUSH@  ASCIIZ  PrinterName   ;Printer name string
PUSH   WORD    Instances     ;Number of spool instances
PUSH   DWORD   0             ;Reserved (must be zero)
CALL   DosPFSInit

Returns WORD