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
|
|
|
/**
|
2018-03-17 19:32:44 +01:00
|
|
|
* Key/String pair, used for string tables,
|
|
|
|
* to display message element names, help texts
|
|
|
|
* and so on...
|
2015-05-01 20:34:50 +02:00
|
|
|
*/
|
2018-03-17 19:32:44 +01:00
|
|
|
struct cw_StrListElem {
|
|
|
|
int id; /**< ID, an integer value */
|
|
|
|
const char *str; /**< a pointer to the string */
|
|
|
|
const char *descr; /**< Description */
|
2015-04-12 10:17:25 +02:00
|
|
|
};
|
|
|
|
|
2018-03-17 19:32:44 +01:00
|
|
|
typedef struct cw_StrListElem* cw_StrList_t;
|
2015-10-18 10:44:40 +02:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2018-03-17 19:32:44 +01:00
|
|
|
extern const char *cw_strlist_get_str(struct cw_StrListElem *s, int id);
|
|
|
|
extern int cw_strlist_get_id(struct cw_StrListElem *s, const char *str);
|
2015-04-12 10:17:25 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|