---
name: "usb_gstrings_attach"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_gstrings_attach"
---

# usb\_gstrings\_attach(9)

attach gadget strings to a cdev and assign ids

## NAME

usb\_gstrings\_attach - attach gadget strings to a cdev and assign ids

## SYNOPSIS

**struct usb\_string \* usb\_gstrings\_attach(struct usb\_composite\_dev \*** *cdev***, struct usb\_gadget\_strings \*\*** *sp***, unsigned** *n\_strings***);**

## ARGUMENTS

*cdev*

the device whose string descriptor IDs are being allocated and attached.

*sp*

an array of usb\_gadget\_strings to attach.

*n\_strings*

number of entries in each usb\_strings array (sp\[\]-\>strings)

## DESCRIPTION

This function will create a deep copy of usb\_gadget\_strings and usb\_string and attach it to the cdev. The actual string (usb\_string.s) will not be copied but only a referenced will be made. The struct usb\_gadget\_strings array may contain multiple languages and should be NULL terminated. The -\>language pointer of each struct usb\_gadget\_strings has to contain the same amount of entries. For instance: sp\[0\] is en-US, sp\[1\] is es-ES. It is expected that the first usb\_string entry of es-ES contains the translation of the first usb\_string entry of en-US. Therefore both entries become the same id assign.

## AUTHOR

**David Brownell** \<dbrownell@users.sourceforge.net\>

Author.

## COPYRIGHT
