From b5828692080d87255f5b12424cc205654f0240b2 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 8 Aug 2012 18:10:53 +0200 Subject: Added enum DEVICE_COUNT and IMAGE_COUNT, Added function device_to_long_string --- src/device.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/device.c') 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]; + +} -- cgit v1.2.3