g13 tux logo   g13

name.h File Reference

#include <g13/udev.h>
Include dependency graph for name.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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.

Function Documentation

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.

Returns:
pointer to character string driver name; NULL on failure

The 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.

Returns:
0 on success; on failure returns -1 and sets errno
Parameters:
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().


Generated on Wed Mar 24 10:13:19 2010 for g13 by doxygen 1.6.1