UDI_MEI_STUBS(3udi)


Metalanguage stub generator macro

SYNOPSIS

#include <udi.h>

#define UDI_MEI_STUBS ( op_name, cb_type,

		argc, args, arg_types, arg_va_list,

		meta_ops_num, vec_idx )
 

ARGUMENTS op_name is a token specifying the name of the channel operation for which to create stub functions.

cb_type is the data type of control blocks used with this operation.

argc is the number of additional arguments to the operation.

args is a comma-separated list, enclosed in parentheses, of the names of the additional arguments.

arg_types is a comma-separated list, enclosed in parentheses, of the data types of the additional arguments.

arg_va_list is a comma-separated list, enclosed in parentheses, of the "VA codes" (see UDI_VA_ARG) for the additional arguments.

meta_ops_num is the metalanguage-defined identifier for the ops vector type to which this operation belongs. (See udi_mei_ops_vec_template_t.)

vec_idx is the index into the ops vector identified by meta_ops_num that corresponds to this operation, starting from zero. (A vec_idx of zero corresponds to the udi_channel_event_ind_op_t at the beginning of every ops vector type, and is not actually used in metalanguage libraries.)

DESCRIPTION Each invocation of UDI_MEI_STUBS creates the definition of the following three functions needed to support a metalanguage-specific channel operation:

Front-end stub:

	void op_name ( cb_type *cb 

			_UDI_ARG_LIST_##argc args );
 

Direct-call stub:

	static udi_mei_direct_stub_t op_name##_direct;
 

Back-end stub:

	static udi_mei_backend_stub_t op_name##_backend;
 

references udi_mei_ops_vec_template_t, udi_channel_event_ind, udi_mei_call, udi_mei_direct_stub_t, udi_mei_backend_stub_t, UDI_VA_ARG

examples The following examples illustrate the use of UDI_MEI_STUBS.

The udi_gio_bind_ack channel operation has three extra parameters and could be implemented using the stubs macro as follows:

UDI_MEI_STUBS(udi_gio_bind_ack, udi_gio_bind_cb_t,

		3, (device_size_lo, device_size_hi, status),

		 (udi_ubit32_t, udi_ubit32_t, udi_status_t),

		 (UDI_VA_UBIT32_T, UDI_VA_UBIT32_T,

		  UDI_VA_STATUS_T),

		UDI_GIO_CLIENT_OPS_NUM,

		UDI_GIO_BIND_ACK)
 

The udi_scsi_io_req channel operation has no extra parameters and could be implemented using the stubs macro as follows:

UDI_MEI_STUBS(udi_scsi_io_req, udi_scsi_io_cb_t,

		0, (), (), (),

		UDI_SCSI_META_ID, UDI_SCSI_HD_OPS_NUM,

		UDI_SCSI_IO_REQ)
 


UDI Core Specification Contents