diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-09-22 18:16:26 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-09-22 18:16:26 +0200 |
commit | 54ddeb6407e2284989964bc83f6ee2bbff987a4a (patch) | |
tree | c3248f38a438cb76e711f0bf42a8ba65966e9a06 /src/device.h | |
parent | 8167e841cecd61eb1161e3e7e12cbc12cab2719a (diff) | |
download | 0xFFFF-54ddeb6407e2284989964bc83f6ee2bbff987a4a.tar.bz2 |
device: Implement hwrevs as array of int16_t
Diffstat (limited to 'src/device.h')
-rw-r--r-- | src/device.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h index 0410494..d614d4e 100644 --- a/src/device.h +++ b/src/device.h @@ -31,8 +31,26 @@ enum device { DEVICE_COUNT, }; +/* + hwrevs - array of int16_t + - terminated by -1 + - valid numbers: 0-9999 +*/ +struct device_hwrevs { + enum device device; + int16_t * hwrevs; +}; + enum device device_from_string(const char * device); const char * device_to_string(enum device device); const char * device_to_long_string(enum device device); +int hwrevs_is_valid(const int16_t * hwrevs, int16_t hwrev); + +int16_t * hwrevs_alloc_from_string(const char * str); +char * hwrevs_alloc_to_string(const int16_t * hwrevs); + +char ** device_hwrevs_alloc_to_256bufs(const struct device_hwrevs * device_hwrevs); +struct device_hwrevs device_hwrevs_alloc_from_256buf(const char * buf, size_t size); + #endif |