2015-04-12 10:17:25 +02:00
|
|
|
#ifndef __STRLIST_H
|
|
|
|
#define __STRLIST_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @Header file for strlist functions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-05-01 20:34:50 +02:00
|
|
|
/**
|
|
|
|
*Key/String pair, used for string tables,
|
|
|
|
*to display message element names and so on...
|
|
|
|
*/
|
2015-10-18 09:49:14 +02:00
|
|
|
struct cw_strlist_elem {
|
|
|
|
/** ID, an integer value */
|
2015-04-12 10:17:25 +02:00
|
|
|
int id;
|
2015-10-18 09:49:14 +02:00
|
|
|
/** a pointer to the string */
|
2015-04-12 10:17:25 +02:00
|
|
|
const char *str;
|
|
|
|
};
|
|
|
|
|
2015-10-18 10:44:40 +02:00
|
|
|
typedef struct cw_strlist_elem* cw_strlist_t;
|
|
|
|
|
|
|
|
|
2015-05-01 20:34:50 +02:00
|
|
|
/** Stopper, indicates the last element in a strlist */
|
2015-04-12 10:17:25 +02:00
|
|
|
#define CW_STR_STOP 0xffffffff
|
|
|
|
|
|
|
|
|
2015-10-18 09:49:14 +02:00
|
|
|
extern const char *cw_strlist_get_str(struct cw_strlist_elem *s, int id);
|
|
|
|
extern int cw_strlist_get_id(struct cw_strlist_elem *s, const char *str);
|
2015-04-12 10:17:25 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|