NAME

nutscan_add_device_to_device - Concatenate two devices structure.

SYNOPSIS

Note
Two NUT websites

This version of the page reflects NUT release v2.8.0 with codebase commited ff16dabca at 2022-04-04T11:04:28+00:00

Options, features and capabilities in current development (and future releases) are detailed on the main site and may differ from ones described here.

#include <nut-scan.h>
nutscan_device_t * nutscan_add_device_to_device(
      nutscan_device_t * first,
      nutscan_device_t * second);

DESCRIPTION

The nutscan_device_t contains the following variables:

nutscan_device_type_t   type;
char *          driver;
char *          port;
nutscan_options_t       opt;
struct nutscan_device * prev;
struct nutscan_device * next;

This is a double linked list of device. Each device is described by its type, its driver name, its port and any number of optional data.

The nutscan_add_device_to_device() concatenates first and second devices to a unique device. No new device is created, the two linked lists are simply linked to each other. So first and second devices are likely to be modified by this function.

RETURN VALUE

The nutscan_add_device_to_device() functions returns a pointer to a device containing both passed devices. Note that it’s not a new device, so it is either first or second which is returned.

NOTES

Technically, the function is currently defined in nutscan-device.h file.

SEE ALSO