---
name: "nutscan_add_device_to_device"
section: "3"
platform: "linux"
package: "nut"
version: "2.8.5-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/nutscan_add_device_to_device"
---

# nutscan\_add\_device\_to\_device(3)

Concatenate two devices structure.

## NAME

nutscan\_add\_device\_to\_device - Concatenate two devices structure.

## SYNOPSIS

```
        #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 *          alt_driver_names;
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

[**nutscan\_scan\_usb**(3)](/nutscan_scan_usb/3.md), [**nutscan\_scan\_xml\_http\_range**(3)](/nutscan_scan_xml_http_range/3.md), [**nutscan\_scan\_nut**(3)](/nutscan_scan_nut/3.md), [**nutscan\_scan\_avahi**(3)](/nutscan_scan_avahi/3.md), [**nutscan\_scan\_ipmi**(3)](/nutscan_scan_ipmi/3.md), [**nutscan\_scan\_snmp**(3)](/nutscan_scan_snmp/3.md), [**nutscan\_display\_ups\_conf**(3)](/nutscan_display_ups_conf/3.md), [**nutscan\_display\_parsable**(3)](/nutscan_display_parsable/3.md), [**nutscan\_new\_device**(3)](/nutscan_new_device/3.md), [**nutscan\_free\_device**(3)](/nutscan_free_device/3.md), [**nutscan\_add\_option\_to\_device**(3)](/nutscan_add_option_to_device/3.md)
