libudev-hwdb.c revision 4afd3348c7506dd1d36305b7bcb9feb8952b9d6b
/***
This file is part of systemd.
Copyright Tom Gundersen <teg@jklm.no>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "sd-hwdb.h"
#include "alloc-util.h"
#include "hwdb-util.h"
#include "libudev-private.h"
/**
* SECTION:libudev-hwdb
* @short_description: retrieve properties from the hardware database
*
* Libudev hardware database interface.
*/
/**
* udev_hwdb:
*
* Opaque object representing the hardware database.
*/
struct udev_hwdb {
int refcount;
struct udev_list properties_list;
};
/**
* udev_hwdb_new:
* @udev: udev library context
*
* Create a hardware database context to query properties for devices.
*
* Returns: a hwdb context.
**/
int r;
r = sd_hwdb_new(&hwdb_internal);
if (r < 0)
return NULL;
if (!hwdb)
return NULL;
return hwdb;
}
/**
* udev_hwdb_ref:
* @hwdb: context
*
* Take a reference of a hwdb context.
*
* Returns: the passed enumeration context
**/
if (!hwdb)
return NULL;
return hwdb;
}
/**
* udev_hwdb_unref:
* @hwdb: context
*
* Drop a reference of a hwdb context. If the refcount reaches zero,
* all resources of the hwdb context will be released.
*
* Returns: #NULL
**/
if (!hwdb)
return NULL;
return NULL;
return NULL;
}
/**
* udev_hwdb_get_properties_list_entry:
* @hwdb: context
* @modalias: modalias string
* @flags: (unused)
*
* Lookup a matching device in the hardware database. The lookup key is a
* modalias string, whose formats are defined for the Linux kernel modules.
* Examples are: pci:v00008086d00001C2D*, usb:v04F2pB221*. The first entry
* of a list of retrieved properties is returned.
*
* Returns: a udev_list_entry.
*/
_public_ struct udev_list_entry *udev_hwdb_get_properties_list_entry(struct udev_hwdb *hwdb, const char *modalias, unsigned int flags) {
return NULL;
}
return NULL;
}
}
}