dio_h

/*
**  	Copyright 1991-2018, Fermi Research Alliance, LLC.  All rights reserved.
*/
/******************************************************************************/
/* dio.h
*	This file contains shared data definitions for the DIO modules
*
*	B S Hendricks, R Joshel	
*/
/******************************************************************************/

#ifndef DIODEFS
#define	DIODEFS

#include "cns_data_structs.h"

#ifndef NULL
    #define NULL 0
#endif

#define	DIO_RESIZABLE_HASH_TABLES	TRUE	/* allow resizable hash tables */
#define	NUM_BUCKETS 	128		/* default number of buckets in hash table */
#define	DFLT_DATA_LEN	4		/* default data length */
#define	ALRM_BLK_LEN	20		/* length of an alarm block */

#define	HASHER(id) (id & 0x7F)			/* hashing function */

#define	GET_LIM_TYPE(x) (((x) >> 8) & 3)	/* extract alarm limit type */
#define	GET_LIM_LEN(x) (((x) >> 5) & 3)		/* extract alarm limit length */
#define	IS_EVENT_ALARM(x) (((x) >> 13) & 1)	/* is this an event alarm? */

#define	STATS_RESET	-1		/* resets stats buffers */
#define	TOGGLE_LOG 	-2		/* toggle error logging */
#define	SETTING_ENABLE	-3		/* enable settings */
#define	SETTING_DISABLE -4		/* disable setting */
#define	DELETE_CACHE	-5		/* call dio_delete_cache */

#define	BAD_DI_MASK	0xFF000000	/* test for invalid device index */

typedef unsigned int pidi;		/* device/property code */

struct LIST_MEMBER			/* list member structure */
    {
    pidi	key;
    unsigned short	rinx;
    unsigned short	seqnum;
    int		len;
    int		minlen;
    unsigned int	maxlen;
    int		offset;
    } __attribute__((packed));

struct LIST_NODE			/* list entry structure */
    {
    struct LIST_NODE	*next;
    unsigned int	listid;
    int		ndev;
    int		use_ftd;
    short	ftd;
    DATA_EVENT_DATA	data_event;
    unsigned int	raw_data_length;
    struct LIST_MEMBER	*dev_list;
    int		is_gets32_access;
    } __attribute__((packed));

struct SLIST_MEMBER			/* set list member structure */
    {
    pidi	key;
    unsigned short	rinx;
    short	len;
    short	minlen;
    unsigned int	maxlen;
    short	offset;
    } __attribute__((packed));

struct SLIST_NODE			/* set list entry structure */
    {
    struct SLIST_NODE	*next;
    unsigned int	listid;
    int		ndev;
    unsigned int	raw_data_length;
    struct SLIST_MEMBER	*dev_list;
    } __attribute__((packed));

struct DB_NODE				/* node in list of PDBs */
    {
    struct DB_NODE	*dbn_next;	/* next node in list */
    pidi	dbn_key;		/* node key */
    short	dbn_dbmerr;		/* error return from DBM */
    char	*dbn_pdb;		/* pointer to PDB data */
    } __attribute__((packed));

typedef struct DIO_STATS_INFO			/* DIO statistics info */
    {
    unsigned int	logit_state;		/* logging state */
    unsigned int	setting_state;		/* setting flag state */
    unsigned int	dbm_tmo;		/* dbm timeout */
    unsigned int	dpm_read_tmo;		/* dpget timeout */
    unsigned int	dpm_set_tmo;		/* dpset timeout */
    unsigned int	read_dev_single;	/* # of single retrieval devices */
    unsigned int	read_dev_list;		/* # of retrieval devices in lists */
    unsigned int	set_dev_single;		/* # of single setting devices */
    unsigned int	set_dev_list;		/* # of setting devices in lists */
    unsigned int	read_snap_list;		/* # of snapshot devices being read */
    unsigned int	num_read_list;		/* # of retrieval lists */
    unsigned int	num_set_list;		/* # of setting lists */
    unsigned int	td_num_list;		/* # of TD lists */
    unsigned int	num_snap_list;		/* # of snapshot lists */
    unsigned int	num_pdb_entries;	/* # of PDB entries in DBPOOL */
    unsigned int	num_info_entries;	/* # of entries in INFOPOOL */
    unsigned int	ftd_event;		/* count of devices read on event */
    unsigned int	ftd_event_plus_delay;	/* count of devices read on an event plus a delay */
    unsigned int	ftd_freq;		/* count of (all but 1 Hz and 15 Hz) */
    unsigned int	ftd_1hz;		/* count of devices read at 1 Hz */
    unsigned int	ftd_15hz;		/* count of devices read at 15 Hz */
    unsigned int	ftd_20hz;		/* count of devices read at 20 Hz */
    unsigned int	ftd_default;		/* count of devices using default FTD */
    unsigned int	ftd_noshot;		/* count of devices using no shot FTD */
    unsigned int	ftd_state;		/* count of devices read on a state event */
    unsigned int	dynamic_memory;		/* # of bytes of dynamic memory */
    unsigned int	out_of_memory;		/* out of dynamic memory flag */
    unsigned int	free_errors;		/* # of memory free errors */
    unsigned int	acnet_errors;		/* ACNET generated errors */
    unsigned int	dio_errors;		/* DIO generated errors */
    unsigned int	dbm_errors;		/* DBM generated errors */
    unsigned int	dpm_errors;		/* DPM generated errors */
    unsigned int	dbm_timeouts;		/* # of database timeouts */
    unsigned int	dpm_pendings;		/* # of DPM pendings */
    unsigned int	dpm_utimes;		/* # of DPM ACNET_UTIME errors */
    unsigned int	misc_errors;		/* # of errors */
    unsigned int	last_error;		/* last error detected */
    unsigned int	ftd_one_shot;		/* count of one shot reads */
    unsigned int	dbprocs;		/* # of DBPROC calls */
    unsigned int	dpprocs;		/* # of DPPROC calls */
    unsigned int	bld_get;		/* # of calls to */
    unsigned int	bld_get_raw;		/* # of calls to */
    unsigned int	bld_set;		/* # of calls to */
    unsigned int	bld_set_raw;		/* # of calls to */
    unsigned int	can_get;		/* # of calls to */
    unsigned int	can_get_lst;		/* # of calls to */
    unsigned int	can_set;		/* # of calls to */
    unsigned int	can_set_lst;		/* # of calls to */
    unsigned int	get_dev;		/* # of calls to */
    unsigned int	get_lst;		/* # of calls to */
    unsigned int	get_lst_raw;		/* # of calls to */
    unsigned int	get_raw;		/* # of calls to */
    unsigned int	set_dev;		/* # of calls to */
    unsigned int	set_lst;		/* # of calls to */
    unsigned int	set_lst_raw;		/* # of calls to */
    unsigned int	set_raw;		/* # of calls to */
    unsigned int	mng_dbpool;		/* # of calls to */
    unsigned int	mng_infopool;		/* # of calls to */
    unsigned int	total_dbproc_time;	/* total time spent in DBPROCs in 15 Hz ticks */
    unsigned int	longest_dbproc;		/* longest DBPROC in 15 Hz ticks */
    unsigned int	total_dpproc_time;	/* total time spent in DPPROCs in 15 Hz ticks */
    unsigned int	longest_dpproc;		/* longest DPPROC in 15 Hz ticks */
    unsigned int	ret_count;		/* # of returned statistics messages */
    unsigned int	td_build;		/* # of calls to */
    unsigned int	td_read;		/* # of calls to */
    unsigned int	td_set;			/* # of calls to */
    unsigned int	td_cancel;		/* # of calls to */
    unsigned int	td_read_one;		/* # of calls to */
    unsigned int	td_set_one;		/* # of calls to */
    unsigned int	alarm_dnom;		/* # of calls to */
    unsigned int	alarm_dnom_lst;		/* # of calls to */
    unsigned int	alarm_events;		/* # of calls to */
    unsigned int	alarm_events_lst;	/* # of calls to */
    unsigned int	alarm_limits;		/* # of calls to */
    unsigned int	alarm_lim_lst;		/* # of calls to */
    unsigned int	alarm_tries;		/* # of calls to */
    unsigned int	alarm_tries_lst;	/* # of calls to */
    unsigned int	bld_alrm_lst;		/* # of calls to */
    unsigned int	cancel_alarm;		/* # of calls to */
    unsigned int	cancel_alarm_lst;	/* # of calls to */
    unsigned int	disable;		/* # of calls to */
    unsigned int	dis_lst;		/* # of calls to */
    unsigned int	disable_abort;		/* # of calls to */
    unsigned int	dis_abt_lst;		/* # of calls to */
    unsigned int	enable;			/* # of calls to */
    unsigned int	ena_lst;		/* # of calls to */
    unsigned int	enable_abort;		/* # of calls to */
    unsigned int	ena_abt_lst;		/* # of calls to */
    unsigned int	is_abort;		/* # of calls to */
    unsigned int	is_abt_lst;		/* # of calls to */
    unsigned int	is_abrt_inh;		/* # of calls to */
    unsigned int	is_abtinh_lst;		/* # of calls to */
    unsigned int	is_broken;		/* # of calls to */
    unsigned int	is_broken_lst;		/* # of calls to */
    unsigned int	is_bypas;		/* # of calls to */
    unsigned int	is_byp_lst;		/* # of calls to */
    unsigned int	is_good;		/* # of calls to */
    unsigned int	is_good_lst;		/* # of calls to */
    unsigned int	salarm_dnom;		/* # of calls to */
    unsigned int	salarm_dnom_lst;	/* # of calls to */
    unsigned int	salarm_lim;		/* # of calls to */
    unsigned int	salarm_lim_lst;		/* # of calls to */
    unsigned int	set_abort_inh_lst;	/* # of calls to */
    unsigned int	set_bypass_lst;		/* # of calls to */
    unsigned int	get_alarm;		/* # of calls to */
    unsigned int	get_alrm_lst;		/* # of calls to */
    unsigned int	cntrl_dev;		/* # of calls to */
    unsigned int	cntrl_lst;		/* # of calls to */
    unsigned int	negative;		/* # of calls to */
    unsigned int	neg_lst;		/* # of calls to */
    unsigned int	off;			/* # of calls to */
    unsigned int	off_lst;		/* # of calls to */
    unsigned int	on;			/* # of calls to */
    unsigned int	on_lst;			/* # of calls to */
    unsigned int	positive;		/* # of calls to */
    unsigned int	pos_lst;		/* # of calls to */
    unsigned int	reset;			/* # of calls to */
    unsigned int	rst_lst;		/* # of calls to */
    unsigned int	disable_settings;	/* # of calls to */
    unsigned int	enable_settings;	/* # of calls to */
    unsigned int	is_setting_enabled;	/* # of calls to */
    unsigned int	change_ftd;		/* # of calls to */
    unsigned int	change_ftd_lst;		/* # of calls to */
    unsigned int	get_retry;		/* # of calls to */
    unsigned int	insert_reqlst;		/* # of calls to */
    unsigned int	list_info;		/* # of calls to */
    unsigned int	slist_info;		/* # of calls to */
    unsigned int	device_index;		/* # of calls to */
    unsigned int	scaling;		/* # of calls to */
    unsigned int	scaling_text;		/* # of calls to */
    unsigned int	is_display_dec;		/* # of calls to */
    unsigned int	is_display_short;	/* # of calls to */
    unsigned int	scaling_len;		/* # of calls to */
    unsigned int	delete_pdb;		/* # of calls to */
    unsigned int	delete_pdb_lst;		/* # of calls to */
    unsigned int	pdb_sts;		/* # of calls to */
    unsigned int	pdb_ctl;		/* # of calls to */
    unsigned int	insert_pdb_lst;		/* # of calls to */
    unsigned int	event_control;		/* # of calls to */
    unsigned int	get_timer_ref;		/* # of calls to */
    unsigned int	set_timer_ref;		/* # of calls to */
    unsigned int	set_for_read;		/* # of calls to */
    unsigned int	is_step_motor;		/* # of calls to */
    unsigned int	set_step_motor;		/* # of calls to */
    unsigned int	move_step_motor;	/* # of calls to */
    unsigned int	sts_txt;		/* # of calls to */
    unsigned int	status;			/* # of calls to */
    unsigned int	is_on;			/* # of calls to */
    unsigned int	is_ready;		/* # of calls to */
    unsigned int	is_remote;		/* # of calls to */
    unsigned int	is_positive;		/* # of calls to */
    unsigned int	sts_txt_lst;		/* # of calls to */
    unsigned int	sts_lst;		/* # of calls to */
    unsigned int	is_on_lst;		/* # of calls to */
    unsigned int	is_rdy_lst;		/* # of calls to */
    unsigned int	is_rem_lst;		/* # of calls to */
    unsigned int	is_pos_lst;		/* # of calls to */
    unsigned int	analog_alarm_text;	/* # of calls to */
    unsigned int	data_len;		/* # of calls to */
    unsigned int	default_ftd;		/* # of calls to */
    unsigned int	dev_emc;		/* # of calls to */
    unsigned int	dev_name;		/* # of calls to */
    unsigned int	dev_node;		/* # of calls to */
    unsigned int	dev_ssdn;		/* # of calls to */
    unsigned int	dev_text;		/* # of calls to */
    unsigned int	dev_type;		/* # of calls to */
    unsigned int	digital_alarm_text;	/* # of calls to */
    unsigned int	dpreq_info;		/* # of calls to */
    unsigned int	ext_text;		/* # of calls to */
    unsigned int	family;			/* # of calls to */
    unsigned int	family_info;		/* # of calls to */
    unsigned int	is_family;		/* # of calls to */
    unsigned int	query_tuner;		/* # of calls to */
    unsigned int	rem_info;		/* # of calls to */
    unsigned int	save_info;		/* # of calls to */
    unsigned int	siblings;		/* # of calls to */
    unsigned int	tuner;			/* # of calls to */
    unsigned int	build_snapshot_list;	/* # of calls to */
    unsigned int	cancel_snapshot_list;	/* # of calls to */
    unsigned int	get_snapshot_list;	/* # of calls to */
    unsigned int	rearm_snapshot_list;	/* # of calls to */
    unsigned int	get_pdb;		/* # of calls to */
/* the following are new items */
    unsigned int	alarm_flags;		/* # of calls to */
    unsigned int	alarm_flags_list;	/* # of calls to */
    unsigned int	build_alarm_list;	/* # of calls to */
    unsigned int	get_array_device;	/* # of calls to */
    unsigned int	set_array_device;	/* # of calls to */
    unsigned int	cancel_get_array;	/* # of calls to */
    unsigned int	cancel_set_array;	/* # of calls to */
    unsigned int	get_oneshot_ftd;	/* # of calls to */
    unsigned int	dbquery;		/* # of calls to */
    unsigned int	delete_all_info;	/* # of calls to */
    unsigned int	desired_alarm_limit_type;	/* # of calls to */
    unsigned int	device_location;	/* # of calls to */
    unsigned int	device_ssdr;		/* # of calls to */
    unsigned int	emc_type;		/* # of calls to */
    unsigned int	get_db_alarm;		/* # of calls to */
    unsigned int	get_last_setting;	/* # of calls to */
    unsigned int	get_last_setting_raw;	/* # of calls to */
    unsigned int	get_properties;		/* # of calls to */
    unsigned int	has_property;		/* # of calls to */
    unsigned int	has_property_list;	/* # of calls to */
    unsigned int	madc_location;		/* # of calls to */
    unsigned int	node;			/* # of calls to */
    unsigned int	protection_mask;	/* # of calls to */
    unsigned int	restore_last_setting;	/* # of calls to */
    unsigned int	set_alarm_flags;	/* # of calls to */
    unsigned int	set_broken;		/* # of calls to */
    unsigned int	virtual_machine_info;	/* # of calls to */
    unsigned int	db_retriever;		/* # of calls to */
    unsigned int	delete_all_emc_info;	/* # of calls to */
    unsigned int	delete_all_name_info;	/* # of calls to */
    unsigned int	delete_cache;		/* # of calls to */
    unsigned int	delete_name_info;	/* # of calls to */
    unsigned int	delete_pdb_all;		/* # of calls to */
    unsigned int	emc_to_device_index;	/* # of calls to */
    unsigned int	event_control_list;	/* # of calls to */
    unsigned int	find_name;		/* # of calls to */
    unsigned int	dio_frig_houses;	/* # of calls to */
    unsigned int	parse_long_device_name;	/* # of calls to */
    unsigned int	dio_clear_redirection_slot;	/* # of calls to */
    unsigned int	display_attributes;	/* # of calls to */
    unsigned int	dio_enable_error_logging;	/* # of calls to */
    unsigned int	extrema;		/* # of calls to */
    unsigned int	dio_log_error;		/* # of calls to */
    unsigned int	raw_data_type;		/* # of calls to */
    unsigned int	raw_to_scaled_data;	/* # of calls to */
    unsigned int	raw_to_status;		/* # of calls to */
    unsigned int	raw_to_status_text;	/* # of calls to */
    unsigned int	scaled_to_raw_data;	/* # of calls to */
    unsigned int	dio_set_redirection_slot;	/* # of calls to */
    unsigned int	dio_simulate;		/* # of calls to */
    unsigned int	is_controlled_set_list;	/* # of calls to */
    unsigned int	can_snapshot;		/* # of calls to */
    unsigned int	can_trigger_snapshot;	/* # of calls to */
    unsigned int	td_query;		/* # of calls to */
    unsigned int	get_status_array_device;	/* # of calls to */
    unsigned int	build_get_array_list;	/* # of calls to */
    unsigned int	wildcard_build;		/* # of calls to */
    unsigned int	wildcard_read;		/* # of calls to */
    unsigned int	wildcard_cancel;	/* # of calls to */
    unsigned int	mio_cancel;		/* # of calls to */
    unsigned int	mio_control;		/* # of calls to */
    unsigned int	mio_control_list;	/* # of calls to */
    unsigned int	mio_read;		/* # of calls to */
    unsigned int	mio_read_list;		/* # of calls to */
    unsigned int	mio_select_pool;	/* # of calls to */
    unsigned int	mio_set;		/* # of calls to */
    unsigned int	mio_set_list;		/* # of calls to */
    int		last_device_read;
    short	last_property_read;
    short	last_read_status;
    int		last_device_set;
    short	last_property_set;
    short	last_set_status;
    int		last_error_read_device;
    short	last_error_read_property;
    short	last_error_read;
    int		last_error_set_device;
    short	last_error_set_property;
    short	last_error_set;
    unsigned int	num_di_entries;		/* # of DIs in pool */
    unsigned int	num_settings;		/* number of settings attempted */
    unsigned int	num_setting_errors;	/* number of setting errors */
    unsigned int	dio_simulate_query;	/* # of calls to */
    unsigned int	mio_fill_status;	/* # of calls to */
    unsigned int	mio_pool_address;	/* # of calls to */
    unsigned int	mio_time_set;		/* # of calls to */
    unsigned int	dio_delete_requests;	/* # of calls to */
    unsigned int	dio_device_state;	/* # of calls to */
    unsigned int	dio_flush;		/* # of calls to */
    unsigned int	read_packeted_data;	/* # of calls to */
    unsigned int	read_packeted_device;	/* # of calls to */
/* following items were added on 10/29/97 */
    unsigned int	hash_table_size;	/* size of cache hash table */
    unsigned int	dio_array_device_negative;	/* # of calls to */
    unsigned int	dio_array_device_off;	/* # of calls to */
    unsigned int	dio_array_device_on;	/* # of calls to */
    unsigned int	dio_array_device_positive;	/* # of calls to */
    unsigned int	dio_array_device_reset;	/* # of calls to */
    unsigned int	dio_device_type;	/* # of calls to */
    unsigned int	dio_extract_alarm_info;	/* # of calls to */
    unsigned int	dio_madc_number;	/* # of calls to */
    unsigned int	dio_primary_to_scaled_data;	/* # of calls to */
    unsigned int	dio_raw_to_value_text;	/* # of calls to */
    unsigned int	dio_scaled_to_value_text;	/* # of calls to */
    unsigned int	dio_set_hash_table_size;	/* # of calls to */
    unsigned int	dio_value_text;		/* # of calls to */
    unsigned int	mng_dipool;		/* # of calls to */
    unsigned int	mng_emcpool;		/* # of calls to */
    unsigned int	mng_infopool_2;		/* # of calls to */
/* following items were added on 10/3/00 */
    unsigned int	num_oneshot_reads;
    int		last_oneshot_device;
    short	last_oneshot_property;
    unsigned int	cache_property_info;	/* # of calls to */
    unsigned int	cache_scaling_info;	/* # of calls to */
    unsigned int	can_ftp;		/* # of calls to */
    unsigned int	can_set_device;		/* # of calls to */
    unsigned int	check_read_request_size;	/* # of calls to */
    unsigned int	check_set_request_size;	/* # of calls to */
    unsigned int	extrema_pdb;		/* # of calls to */
    unsigned int	get_directed_list;	/* # of calls to */
    unsigned int	get_directed_list_raw;	/* # of calls to */
    unsigned int	get_retry_directed;	/* # of calls to */
    unsigned int	dio_has_setting_record;	/* # of calls to */
    unsigned int	is_controlled_set;	/* # of calls to */
    unsigned int	is_ramping;		/* # of calls to */
    unsigned int	is_ramping_list;	/* # of calls to */
    unsigned int	mio_read_directed;	/* # of calls to */
    unsigned int	mio_read_directed_list;	/* # of calls to */
    unsigned int	raw_to_scaled_custom;	/* # of calls to */
    unsigned int	scaling_length_list;	/* # of calls to */
    unsigned int	set_dc_mode;		/* # of calls to */
    unsigned int	set_dc_mode_list;	/* # of calls to */
    unsigned int	set_ramp_mode;		/* # of calls to */
    unsigned int	set_ramp_mode_list;	/* # of calls to */
    unsigned int	ssdn_to_device_type;	/* # of calls to */
    unsigned int	ssdn_to_location;	/* # of calls to */
    unsigned int	units_text;	/* # of calls to */
/* following items were added on 7/21/15 */
    unsigned int	num_fermi_name_entries;	/* number of Fermi name pool entries */
    unsigned int	num_full_name_entries;	/* number of full name pool entries */
    unsigned int	num_old_name_entries;	/* number of old name pool entries */
    unsigned int	actual_alarm_list_id;	/* # of calls to */
    unsigned int	add_timer_events;	/* # of calls to */
    unsigned int	alarm_acknowledge_mask;	/* # of calls to */
    unsigned int	alarm_ancestors;	/* # of calls to */
    unsigned int	alarm_ftd;		/* # of calls to */
    unsigned int	alarm_group_info;	/* # of calls to */
    unsigned int	alarm_list_id;		/* # of calls to */
    unsigned int	alarms_monitored_by_user;	/* # of calls to */
    unsigned int	analog_alarm_handling;	/* # of calls to */
    unsigned int	analog_alarm_url;	/* # of calls to */
    unsigned int	are_settings_enabled;	/* # of calls to */
    unsigned int	broken_info;		/* # of calls to */
    unsigned int	build_ftp_list;		/* # of calls to */
    unsigned int	cache_device_aux_table;	/* # of calls to */
    unsigned int	cache_device_flags_table;	/* # of calls to */
    unsigned int	cache_device_property_table_info;	/* # of calls to */
    unsigned int	cache_device_scaling_table;	/* # of calls to */
    unsigned int	cache_device_table;	/* # of calls to */
    unsigned int	cache_device_table_info;	/* # of calls to */
    unsigned int	cache_digital_control_table;	/* # of calls to */
    unsigned int	cache_family_table;	/* # of calls to */
    unsigned int	cache_pdb_table;	/* # of calls to */
    unsigned int	cache_property_table;	/* # of calls to */
    unsigned int	cache_read_set_enum_table;	/* # of calls to */
    unsigned int	calculate_extrema;	/* # of calls to */
    unsigned int	calculate_raw_value;	/* # of calls to */
    unsigned int	can_read_using_ftp;	/* # of calls to */
    unsigned int	can_read_using_snapshot;	/* # of calls to */
    unsigned int	cancel_ftp_list;	/* # of calls to */
    unsigned int	console_can_acknowledge_alarm;	/* # of calls to */
    unsigned int	console_can_display_alarm;	/* # of calls to */
    unsigned int	controlling_device;	/* # of calls to */
    unsigned int	current_alarm_text;	/* # of calls to */
    unsigned int	current_xmlrpc_access;	/* # of calls to */
    unsigned int	current_xmlrpc_client_devices;	/* # of calls to */
    unsigned int	current_xmlrpc_client_nodes;	/* # of calls to */
    unsigned int	data_length;		/* # of calls to */
    unsigned int	data_length_ext;	/* # of calls to */
    unsigned int	data_num_elements;	/* # of calls to */
    unsigned int	data_type_info;		/* # of calls to */
    unsigned int	database_mask_to_property;	/* # of calls to */
    unsigned int	database_property_to_mask;	/* # of calls to */
    unsigned int	dbquery_alloc;		/* # of calls to */
    unsigned int	default_data_event;	/* # of calls to */
    unsigned int	delete_all_fermi_name_info;	/* # of calls to */
    unsigned int	delete_ftp_class_info;	/* # of calls to */
    unsigned int	delete_snapshot_class_info;	/* # of calls to */
    unsigned int	department_info;	/* # of calls to */
    unsigned int	device_expression;	/* # of calls to */
    unsigned int	device_fermi_name_to_key;	/* # of calls to */
    unsigned int	device_has_expression;	/* # of calls to */
    unsigned int	device_help_url;	/* # of calls to */
    unsigned int	device_location_string;	/* # of calls to */
    unsigned int	device_name_to_fermi_name;	/* # of calls to */
    unsigned int	device_setting_is_enabled;	/* # of calls to */
    unsigned int	device_string_element_length;	/* # of calls to */
    unsigned int	digital_alarm_handling;	/* # of calls to */
    unsigned int	dio_digital_control;	/* # of calls to */
    unsigned int	digital_control_info;	/* # of calls to */
    unsigned int	dio_digital_control_list;	/* # of calls to */
    unsigned int	dio_digital_control_text_to_value;	/* # of calls to */
    unsigned int	dio_digital_control_text_to_value_list;	/* # of calls to */
    unsigned int	disable_cache_missing_db_values;	/* # of calls to */
    unsigned int	disable_obsolete_dev_info;	/* # of calls to */
    unsigned int	disable_on_event_retries;	/* # of calls to */
    unsigned int	display_conversion_info;	/* # of calls to */
    unsigned int	display_conversion_type;	/* # of calls to */
    unsigned int	display_length;		/* # of calls to */
    unsigned int	download_info;		/* # of calls to */
    unsigned int	download_properties;	/* # of calls to */
    unsigned int	duplicate_ssdn_properties;	/* # of calls to */
    unsigned int	edit_comment_info;	/* # of calls to */
    unsigned int	enable_cache_missing_db_values;	/* # of calls to */
    unsigned int	enable_obsolete_dev_info;	/* # of calls to */
    unsigned int	enable_on_event_retries;	/* # of calls to */
    unsigned int	enum_value_info;	/* # of calls to */
    unsigned int	enum_value_text_to_raw_data;	/* # of calls to */
    unsigned int	expand_family;		/* # of calls to */
    unsigned int	extract_read_list_status;	/* # of calls to */
    unsigned int	extract_set_list_status;	/* # of calls to */
    unsigned int	extrema_pdb_ext;	/* # of calls to */
    unsigned int	foreign_device_info;	/* # of calls to */
    unsigned int	ftp_class_info;		/* # of calls to */
    unsigned int	get_array_device_double;	/* # of calls to */
    unsigned int	get_control_value;	/* # of calls to */
    unsigned int	get_device;		/* # of calls to */
    unsigned int	get_device_list;	/* # of calls to */
    unsigned int	get_ftp_class;		/* # of calls to */
    unsigned int	get_ftp_list;		/* # of calls to */
    unsigned int	get_raw_ftp_list;	/* # of calls to */
    unsigned int	get_historic_scaling;	/* # of calls to */
    unsigned int	dio_get_raw_device_knob_info;	/* # of calls to */
    unsigned int	get_raw_reading_func;	/* # of calls to */
    unsigned int	get_raw_setting_func;	/* # of calls to */
    unsigned int	get_raw_snapshot_list;	/* # of calls to */
    unsigned int	get_recent_setting_info;	/* # of calls to */
    unsigned int	get_snapshot_class;	/* # of calls to */
    unsigned int	get_status_ftp_list;	/* # of calls to */
    unsigned int	has_enum_value_info;	/* # of calls to */
    unsigned int	has_scaling_info;	/* # of calls to */
    unsigned int	has_scaling_info_list;	/* # of calls to */
    unsigned int	historic_data_length;	/* # of calls to */
    unsigned int	historic_raw_data_type;	/* # of calls to */
    unsigned int	is_bypassed_db;		/* # of calls to */
    unsigned int	is_caching_missing_db_values;	/* # of calls to */
    unsigned int	is_enumerated_property;	/* # of calls to */
    unsigned int	is_family_list;		/* # of calls to */
    unsigned int	is_float_raw_data;	/* # of calls to */
    unsigned int	is_obsolete_info_enabled;	/* # of calls to */
    unsigned int	is_old_name;		/* # of calls to */
    unsigned int	is_on_event_retry_enabled;	/* # of calls to */
    unsigned int	is_primary_scalable_property;	/* # of calls to */
    unsigned int	is_snoozed_alarm;	/* # of calls to */
    unsigned int	is_string_property;	/* # of calls to */
    unsigned int	is_string_transform;	/* # of calls to */
    unsigned int	longest_analog_alarm_url;	/* # of calls to */
    unsigned int	longest_default_data_event;	/* # of calls to */
    unsigned int	longest_department_name;	/* # of calls to */
    unsigned int	longest_device_broken_comment;	/* # of calls to */
    unsigned int	longest_device_full_name;	/* # of calls to */
    unsigned int	longest_device_full_text;	/* # of calls to */
    unsigned int	longest_device_help_url;	/* # of calls to */
    unsigned int	longest_device_obsolete_comment;	/* # of calls to */
    unsigned int	longest_foreign_device_name;	/* # of calls to */
    unsigned int	longest_location_string;	/* # of calls to */
    unsigned int	longest_structure_name;	/* # of calls to */
    unsigned int	maintainer_info;	/* # of calls to */
    unsigned int	dio_manage_extended_pdbs;	/* # of calls to */
    unsigned int	dio_manage_front_end_pdbs;	/* # of calls to */
    unsigned int	dio_manage_pdbs;	/* # of calls to */
    unsigned int	node_alarm_limit_type;	/* # of calls to */
    unsigned int	dio_node_default_alarm_list;	/* # of calls to */
    unsigned int	dio_node_default_alarm_list_list;	/* # of calls to */
    unsigned int	obsolete_info;		/* # of calls to */
    unsigned int	oldest_setting_log_entry_date;	/* # of calls to */
    unsigned int	parse_generic_long_device_name;	/* # of calls to */
    unsigned int	pdb_to_display_conversion_info;	/* # of calls to */
    unsigned int	pdb_to_scaling_info;	/* # of calls to */
    unsigned int	previous_name;		/* # of calls to */
    unsigned int	primary_to_scaled_custom;	/* # of calls to */
    unsigned int	property_flags;		/* # of calls to */
    unsigned int	raw_element_length;	/* # of calls to */
    unsigned int	raw_to_control_text;	/* # of calls to */
    unsigned int	raw_to_enum_value_text;	/* # of calls to */
    unsigned int	dio_raw_to_value_text_custom;	/* # of calls to */
    unsigned int	read_db_timeout;	/* # of calls to */
    unsigned int	read_last_setting;	/* # of calls to */
    unsigned int	read_list_length;	/* # of calls to */
    unsigned int	read_list_single_entry_info;	/* # of calls to */
    unsigned int	remove_raw_reading_func;	/* # of calls to */
    unsigned int	remove_raw_setting_func;	/* # of calls to */
    unsigned int	remove_timer_events;	/* # of calls to */
    unsigned int	request_info;		/* # of calls to */
    unsigned int	scaled_to_raw_custom;	/* # of calls to */
    unsigned int	scaling_constants;	/* # of calls to */
    unsigned int	scaling_transforms;	/* # of calls to */
    unsigned int	set_alarm;		/* # of calls to */
    unsigned int	set_alarm_flags_list;	/* # of calls to */
    unsigned int	set_alarm_ftd;		/* # of calls to */
    unsigned int	set_alarm_tries;	/* # of calls to */
    unsigned int	set_array_device_double;	/* # of calls to */
    unsigned int	set_device;		/* # of calls to */
    unsigned int	set_device_list;	/* # of calls to */
    unsigned int	set_list_length;	/* # of calls to */
    unsigned int	set_list_single_entry_info;	/* # of calls to */
    unsigned int	set_raw_by_user_addressing;	/* # of calls to */
    unsigned int	set_step_motor_steps;	/* # of calls to */
    unsigned int	dio_set_value_text;	/* # of calls to */
    unsigned int	snapshot_class_info;	/* # of calls to */
    unsigned int	snooze_alarm;		/* # of calls to */
    unsigned int	snoozed_alarm_info;	/* # of calls to */
    unsigned int	snoozed_alarms;		/* # of calls to */
    unsigned int	spec_to_drf_string;	/* # of calls to */
    unsigned int	specify_raw_reading_func;	/* # of calls to */
    unsigned int	specify_raw_setting_func;	/* # of calls to */
    unsigned int	ssdn_to_duplicate_ssdn_properties;	/* # of calls to */
    unsigned int	ssdn_to_snapshot_class;	/* # of calls to */
    unsigned int	dio_status_attr_to_bit_info;	/* # of calls to */
    unsigned int	step_motor_is_moving;	/* # of calls to */
    unsigned int	structure_name;		/* # of calls to */
    unsigned int	unsnooze_alarm;		/* # of calls to */
    unsigned int	users_monitoring_alarm;	/* # of calls to */
    unsigned int	dio_value_text_to_raw_data;	/* # of calls to */
    unsigned int	was_controlled;		/* # of calls to */
    unsigned int	was_set;		/* # of calls to */
    unsigned int	mng_fermi_name_pool;	/* # of calls to */
    unsigned int	mng_full_name_pool;	/* # of calls to */
    unsigned int	mng_old_name_pool;	/* # of calls to */
/* following items were added on 10/5/15 */
    unsigned int	device_area;		/* # of calls to */
    unsigned int	device_machine;		/* # of calls to */
    unsigned int	documentation_info;	/* # of calls to */
    unsigned int	enum_value_shared_devices;	/* # of calls to */
    unsigned int	historic_device_addressing;	/* # of calls to */
    unsigned int	is_enum_value_info_shared;	/* # of calls to */
    unsigned int	longest_area_name;	/* # of calls to */
    unsigned int	longest_device_document_comment;	/* # of calls to */
    unsigned int	longest_device_edit_comment;	/* # of calls to */
    unsigned int	longest_machine_name;	/* # of calls to */
    unsigned int	validate_device_name;	/* # of calls to */
    unsigned int	mng_infopool_3;		/* # of calls to */
/* following items were added on 10/8/15 */
    unsigned int	device_location_info;	/* # of calls to */
/* following items were added on 3/29/16 */
    int			terse_name_length;	/* terse name length */
    unsigned int	dio_addressing_mode;	/* # of calls to */
    unsigned int	dio_db_extrema;		/* # of calls to */
    unsigned int	dio_device_madc_location;	/* # of calls to */
    unsigned int	dio_ftp_default_freq;	/* # of calls to */
    unsigned int	dio_get_extended_pdb;	/* # of calls to */
    unsigned int	dio_get_terse_name_length;	/* # of calls to */
    unsigned int	dio_madc_clock_events;	/* # of calls to */
    unsigned int	dio_madc_list_info;	/* # of calls to */
    unsigned int	dio_madc_num_available_clock_levels;	/* # of calls to */
    unsigned int	dio_madc_num_available_lists;	/* # of calls to */
    unsigned int	dio_madc_num_available_plot_channels;	/* # of calls to */
    unsigned int	dio_madc_plot_channel_info;	/* # of calls to */
    unsigned int	dio_scaled_to_primary_data;	/* # of calls to */
    unsigned int	dio_set_terse_name_length;	/* # of calls to */
    unsigned int	dio_snapshot_default_freq;	/* # of calls to */
/* following items were added on 5/13/16 */
    unsigned int	dio_get_timer_pulse_width_device;	/* # of calls to */
    unsigned int	dio_get_timer_reference_device;	/* # of calls to */
    unsigned int	dio_is_event_enabled;	/* # of calls to */
    unsigned int	dio_is_possible_device_name;	/* # of calls to */
    unsigned int	dio_is_timer_device;	/* # of calls to */
    unsigned int	dio_is_timer_pulse_width_device;	/* # of calls to */
    unsigned int	dio_is_timer_reference;	/* # of calls to */
    unsigned int	dio_madc_num_channels;	/* # of calls to */
    unsigned int	td_extract_list_status; /* # of calls to */
/* following items were added on 9/26/16 */
    unsigned int	num_old_full_name_entries;	/* number of old full name pool entries */
    unsigned int	dio_calculate_step_motor_steps;	/* # of calls to */
    unsigned int	dio_historic_device_name;	/* # of calls to */
    unsigned int	dio_length_offset_spec_to_drf_string;	/* # of calls to */
    unsigned int	mng_old_full_name_pool;		/* # of calls to */
/* following items were added on 10/16/17 */
    unsigned int	dio_build_timer_reference_list;	/* # of calls to */
    unsigned int	dio_cancel_timer_reference_list;	/* # of calls to */
    unsigned int	dio_control_scaling_length;	/* # of calls to */
    unsigned int	dio_find_status_scaling_attr_id;	/* # of calls to */
    unsigned int	dio_find_status_scaling_attribute;	/* # of calls to */
    unsigned int	dio_find_status_scaling_by_attr_id;	/* # of calls to */
    unsigned int	dio_find_status_scaling_by_mask;	/* # of calls to */
    unsigned int	dio_find_status_scaling_by_state;	/* # of calls to */
    unsigned int	dio_full_name_to_terse_name;	/* # of calls to */
    unsigned int	dio_get_read_list_devices;	/* # of calls to */
    unsigned int	dio_get_set_list_devices;	/* # of calls to */
    unsigned int	dio_get_timer_reference_list;	/* # of calls to */
    unsigned int	dio_has_classic_control_attribute;	/* # of calls to */
    unsigned int	dio_has_classic_status_attribute;	/* # of calls to */
    unsigned int	dio_is_camac_device;		/* # of calls to */
    unsigned int	dio_is_destructive_read;	/* # of calls to */
    unsigned int	dio_is_knobable;		/* # of calls to */
    unsigned int	dio_is_status_attribute_state_value;	/* # of calls to */
    unsigned int	dio_is_status_attribute_value;	/* # of calls to */
    unsigned int	dio_is_status_attribute_value_by_id;	/* # of calls to */
    unsigned int	dio_is_status_attribute_value_list;	/* # of calls to */
    unsigned int	dio_raw_to_status_attribute_value_by_id;	/* # of calls to */
    unsigned int	dio_raw_to_status_extended;	/* # of calls to */
    unsigned int	dio_raw_to_status_state_value_by_id;	/* # of calls to */
    unsigned int	dio_raw_to_status_text_extended;	/* # of calls to */
    unsigned int	dio_remove_all_timer_events;	/* # of calls to */
    unsigned int	dio_scaling_info_to_extended_pdb;	/* # of calls to */
    unsigned int	dio_scaling_info_to_pdb;	/* # of calls to */
    unsigned int	dio_status_scaling_attributes;	/* # of calls to */
    unsigned int	dio_status_scaling_info;	/* # of calls to */
    unsigned int	dio_status_scaling_length;	/* # of calls to */
    unsigned int	dio_terse_name_to_full_name;	/* # of calls to */
/* following items were added on 5/1/18 */
    unsigned int	dio_alarm_group_members;	/* # of calls to */
    unsigned int	dio_bit_mask_to_status;		/* # of calls to */
    unsigned int	dio_bit_mask_to_status_text;	/* # of calls to */
    unsigned int	dio_build_get_array_list_raw;	/* # of calls to */
    unsigned int	dio_build_read_array_device_list;	/* # of calls to */
    unsigned int	dio_build_read_array_device_list_raw;	/* # of calls to */
    unsigned int	dio_build_read_device_list;	/* # of calls to */
    unsigned int	dio_build_read_device_list_raw;	/* # of calls to */
    unsigned int	dio_build_set_array_list;	/* # of calls to */
    unsigned int	dio_build_set_array_list_raw;	/* # of calls to */
    unsigned int	dio_cancel_array_device_reading;	/* # of calls to */
    unsigned int	dio_cancel_device_reading;	/* # of calls to */
    unsigned int	dio_cancel_device_reading_list;	/* # of calls to */
    unsigned int	dio_has_analog_alarm_text;	/* # of calls to */
    unsigned int	dio_has_digital_alarm_text;	/* # of calls to */
    unsigned int	dio_has_ext_text;		/* # of calls to */
    unsigned int	dio_has_foreign_device_info;	/* # of calls to */
    unsigned int	dio_insert_request_list;	/* # of calls to */
    unsigned int	dio_read_array_device;		/* # of calls to */
    unsigned int	dio_read_array_device_raw;	/* # of calls to */
    unsigned int	dio_read_device;		/* # of calls to */
    unsigned int	dio_read_device_list;		/* # of calls to */
    unsigned int	dio_read_device_list_raw;	/* # of calls to */
    unsigned int	dio_read_device_raw;		/* # of calls to */
    unsigned int	dio_read_value_text;		/* # of calls to */
    unsigned int	dio_set_device_primary;		/* # of calls to */
    unsigned int	dio_status_attr_bit_mask;	/* # of calls to */
    unsigned int	dio_timer_max_events;		/* # of calls to */
    } __attribute__((packed)) DIO_STATS_INFO;

/******************************************************************************/

#ifndef EXCLUDE_DIO_GLOBALS

extern      char    dio_first_time;     /* intialize flag */
extern      char    dio_logit;      /* error log flag */
extern      int dio_settings_enabled;   /* setting enable flag */
extern      int dio_read_to;        /* DPREQ timeout */
extern      short   dio_set_to;     /* DPSRPY timeout */
extern      short   dio_dbm_to;     /* DBPROC timeout */
extern      short   dio_one_shot;       /* DIO one shot FTD */
extern      DIO_STATS_INFO  *dio_stats; /* DIO statistics structure */
extern      int dio_notify_stale;   /* stale data notify flag */
extern      short   dio_use_mio;        /* MIO in use */
extern      short   dio_mio_set_read;   /* MIO: PRSET map to PRREAD */

#endif
/******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

    void dio_getset_init(void);
    struct LIST_MEMBER *dio_list_info(int list_id, int *num_devices,
				      int *raw_length=(int *) NULL,
				      short *ftd=(short *) NULL,
				      int *use_ftd=(int *) NULL,
				      DATA_EVENT_DATA *data_event=(DATA_EVENT_DATA *) NULL);
    struct SLIST_MEMBER *dio_slist_info(int list_id, int *num_devices, int *rawlen=(int *)NULL);
/* int td_parser(struct TABLE_NODE *table_data, int num_devices,
         int *device_indices, short *table_numbers, short *table_types,
         short *start_slots, short *num_slots, short *slot_uses,
         int scale_it, short *errors); */

#ifdef __cplusplus
}
#endif

#endif