'\" t .\" Title: usb_gstrings_attach .\" Author: .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Kernel Mode Gadget API .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "USB_GSTRINGS_ATTACH" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "Kernel Mode Gadget API" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" usb_gstrings_attach \- attach gadget strings to a cdev and assign ids .SH "SYNOPSIS" .HP \w'struct\ usb_string\ *\ usb_gstrings_attach('u .BI "struct usb_string * usb_gstrings_attach(struct\ usb_composite_dev\ *\ " "cdev" ", struct\ usb_gadget_strings\ **\ " "sp" ", unsigned\ " "n_strings" ");" .SH "ARGUMENTS" .PP \fIcdev\fR .RS 4 the device whose string descriptor IDs are being allocated and attached\&. .RE .PP \fIsp\fR .RS 4 an array of usb_gadget_strings to attach\&. .RE .PP \fIn_strings\fR .RS 4 number of entries in each usb_strings array (sp[]\->strings) .RE .SH "DESCRIPTION" .PP 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 languges and should be NULL terminated\&. The \->language pointer of each struct usb_gadget_strings has to contain the same amount of entries\&. .SH "FOR INSTANCE" .PP sp[0] is en\-US, sp[1] is es\-ES\&. It is expected that the first usb_string entry of es\-ES containts the translation of the first usb_string entry of en\-US\&. Therefore both entries become the same id assign\&. .SH "AUTHOR" .PP \fBDavid Brownell\fR <\&dbrownell@users.sourceforge.net\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br