DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

UDI_HANDLE_ID(3udi)


Get identification value for specified handle

SYNOPSIS

#include <udi.h>

#define UDI_HANDLE_ID(handle, handle_type)
 

ARGUMENTS handle is the handle for which an ID value is to be obtained.

handle_type is the type specification for that handle.

DESCRIPTION For tracing, logging, and debugging purposes it is often useful to be able to identify and differentiate between handles that are passed to the driver. Handles themselves are opaque structures that the driver has no information about. To obtain an ID value that can be used in tracing, logging, or debugging output, the UDI_HANDLE_ID macro should be used.

The ID value will be unique with respect to all other handle IDs for the same handle_type in the same region. Subsequent uses of UDI_HANDLE_ID for the same handle value will produce the same ID value.

This macro is useful in conjunction with udi_snprintf.

RETURN VALUES This macro returns a (void *) value that can be formatted using the %p format code for udi_snprintf calls.

EXAMPLES udi_snprintf("Got channel handle %p\n",
UDI_HANDLE_ID(chan, udi_channel_t));

REFERENCES udi_snprintf, udi_trace_write, udi_log_write


UDI Core Specification Contents