diff options
author | Burt P <pburt0@gmail.com> | 2018-03-20 17:43:30 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-04-24 07:46:11 -0700 |
commit | 60b9f3360930296c0f3e8b04672b8bf7468bedcb (patch) | |
tree | a5cef754a3a501c608c00a9732f054288d6932c0 /includes/vendor.h | |
parent | f4e3b832e11783d88fd4da9446dae3f5b0803acd (diff) |
vendor.c: try and reduce the likelihood of false matches
* Rename struct members to be less ambiguous
* Sort the list by length of match_string, longest first,
so better matches match first
* Add flag to force case-sensitive matching so that two or
three-letter names don't match names that happen to have
those letters in them
Also, added ASUS and fixes #241.
(https://github.com/lpereira/hardinfo/issues/241)
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'includes/vendor.h')
-rw-r--r-- | includes/vendor.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/vendor.h b/includes/vendor.h index 778e2ea3..21d52562 100644 --- a/includes/vendor.h +++ b/includes/vendor.h @@ -21,13 +21,14 @@ typedef struct _Vendor Vendor; struct _Vendor { - char *id; + char *match_string; + int match_case; /* 0 = ignore case, 1 = match case*/ char *name; char *url; }; void vendor_init(void); -const gchar *vendor_get_name(const gchar *id); -const gchar *vendor_get_url(const gchar *id); +const gchar *vendor_get_name(const gchar *id_str); +const gchar *vendor_get_url(const gchar *id_str); #endif /* __VENDOR_H__ */ |