Use udev to get the manufacturer name if possible (thanks gdb!)

This commit is contained in:
Sam Lantinga
2025-12-21 08:40:21 -08:00
parent 1d51671cbe
commit 4984eb8c16
4 changed files with 46 additions and 0 deletions

View File

@@ -109,6 +109,12 @@ static bool SDL_UDEV_load_syms(void)
SDL_UDEV_SYM(udev_unref);
SDL_UDEV_SYM(udev_device_new_from_devnum);
SDL_UDEV_SYM(udev_device_get_devnum);
SDL_UDEV_SYM(udev_hwdb_new);
SDL_UDEV_SYM(udev_hwdb_unref);
SDL_UDEV_SYM(udev_hwdb_get_properties_list_entry);
SDL_UDEV_SYM(udev_list_entry_get_value);
#undef SDL_UDEV_SYM
return true;

View File

@@ -83,6 +83,12 @@ typedef struct SDL_UDEV_Symbols
void (*udev_unref)(struct udev *);
struct udev_device *(*udev_device_new_from_devnum)(struct udev *udev, char type, dev_t devnum);
dev_t (*udev_device_get_devnum)(struct udev_device *udev_device);
struct udev_hwdb *(*udev_hwdb_new)(struct udev *udev);
struct udev_hwdb *(*udev_hwdb_unref)(struct udev_hwdb *hwdb);
struct udev_list_entry *(*udev_hwdb_get_properties_list_entry)(struct udev_hwdb *hwdb, const char *modalias, unsigned flags);
const char *(*udev_list_entry_get_value)(struct udev_list_entry *list_entry);
} SDL_UDEV_Symbols;
typedef struct SDL_UDEV_PrivateData