Specifications
Writing Device-Driver Tables
4.4 Building Driver Tables Using C
Table 4–2 (Cont.) DPT Initialization Macros for C
Macro name Data type of second parameter Prototype value
ini_dpt_vector pointer to vector of pointers 0
The following example shows the usage of the DPT initialization macros.
extern DPT driver$dpt; /* Declare protype DPT */
ini_dpt_name (&driver$dpt, "XXDRIVER");
ini_dpt_ucbsize (&driver$dpt, sizeof(XX_UCB));
ini_dpt_adapt (&driver$dpt, AT$_NULL);
ini_dpt_end (&driver$dpt);
4.4.1.2 DPT Functions
Each of the following functions stores a value in a DPT field and returns SS$_
NORMAL, or returns an error status if it detects an error.
int driver$ini_dpt_adapt( DPT *dpt, unsigned long value );
int driver$ini_dpt_bt_order( DPT *dpt, long value );
int driver$ini_dpt_decode( DPT *dpt, long value );
int driver$ini_dpt_defunits( DPT *dpt, unsigned short value );
int driver$ini_dpt_deliver( DPT *dpt, int ( *func )() );
int driver$ini_dpt_flags( DPT *dpt, unsigned long value );
int driver$ini_dpt_idb_crams( DPT *dpt, unsigned short value );
int driver$ini_dpt_maxunits( DPT *dpt, unsigned short value );
int driver$ini_dpt_name( DPT *dpt, char *string_ptr );
int driver$ini_dpt_struc_init( DPT *dpt, void ( *func )() );
int driver$ini_dpt_struc_reinit( DPT *dpt, void ( *func )() );
int driver$ini_dpt_ucb_crams( DPT *dpt, unsigned short value );
int driver$ini_dpt_ucbsize( DPT *dpt, unsigned short value );
int driver$ini_dpt_unload( DPT *dpt, int ( *func )() );
int driver$ini_dpt_vector( DPT *dpt, void( **func )() );
The following function signals that initialization of the DPT is complete.
int driver$ini_dpt_end( DPT *dpt );
4.4.2 Driver Dispatch Table
4.4.2.1 DDT Fields
In the following list of DDT field names, the presence of a parameter name
indicates that the driver writer may set the field with one of the functions
described below. A default value of "None" means that the current VAX MACRO
macro definition does not supply a default value for the field.
4–11










