#include "name.h"
#include <stdlib.h>
#include <sysfs/libsysfs.h>
Functions | |
char * | g13_device_get_name (g13_device *device) |
Get the driver name for the device. | |
void | g13_device_free_name (char *name) |
Frees a name string allocated by g13_device_get_name() . | |
int | g13_device_set_name (g13_device *device, const char *name, size_t name_len) |
Sets the mnemonic name for a device. |
void g13_device_free_name | ( | char * | name | ) |
Frees a name string allocated by g13_device_get_name()
.
Referenced by g13_device_get_state(), g13_device_new_from_name(), and G13::Device::name().
char* g13_device_get_name | ( | g13_device * | device | ) |
Get the driver name for the device.
NULL
on failureThe returned pointer must be freed using g13_device_free_name()
This name is stored only in the driver and not in the device, but can be used to recognize devices mnemonically.
References g13_device_get_syspath().
Referenced by g13_device_get_state(), g13_device_new_from_name(), and G13::Device::name().
int g13_device_set_name | ( | g13_device * | device, | |
const char * | name, | |||
size_t | name_len | |||
) |
Sets the mnemonic name for a device.
0
on success; on failure returns -1
and sets errno
name | The new mnemonic name of the device | |
name_len | The length of the name array |
This sets a mnemonic name for a device in the device driver. The name has a limit of 100 characters. If more than 100 characters are provided only the first 100 will be used.
References g13_device_get_syspath().
Referenced by g13_device_set_state(), and G13::Device::set_name().