diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-08-08 18:10:53 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-08-08 18:10:53 +0200 |
commit | b5828692080d87255f5b12424cc205654f0240b2 (patch) | |
tree | 27af833aaad9d9d675247d8c35bb8c1549e8fc64 /src/device.c | |
parent | dd2c6b7f18fc4a26c950e09c47af76eeb894cd68 (diff) | |
download | 0xFFFF-b5828692080d87255f5b12424cc205654f0240b2.tar.bz2 |
Added enum DEVICE_COUNT and IMAGE_COUNT, Added function device_to_long_string
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c index 20b491e..bc319c6 100644 --- a/src/device.c +++ b/src/device.c @@ -48,9 +48,26 @@ enum device device_from_string(const char * device) { const char * device_to_string(enum device device) { - if ( device > sizeof(devices) ) + if ( device > sizeof(devices)/sizeof(devices[0]) ) return NULL; return devices[device]; } + +static const char * long_devices[] = { + [DEVICE_SU_18] = "Nokia 770", + [DEVICE_RX_34] = "Nokia N800", + [DEVICE_RX_44] = "Nokia N810", + [DEVICE_RX_48] = "Nokia N810 Wimax", + [DEVICE_RX_51] = "Nokia N900", +}; + +const char * device_to_long_string(enum device device) { + + if ( device > sizeof(long_devices)/sizeof(long_devices[0]) ) + return NULL; + + return long_devices[device]; + +} |