diff options
Diffstat (limited to 'src/sms_utils.h')
-rw-r--r-- | src/sms_utils.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/sms_utils.h b/src/sms_utils.h new file mode 100644 index 0000000..01d0e1f --- /dev/null +++ b/src/sms_utils.h @@ -0,0 +1,57 @@ +#ifndef __SMS_UTILS_H +#define __SMS_UTILS_H + +#include <stdarg.h> + +#include "pdu.h" +#include "list.h" +#include "phonebook.h" + +#ifdef __SMS_UTILS_C +#define SMS_UTILS_EXTERN +#else +#define SMS_UTILS_EXTERN extern +#endif + +#define SMS_PDU_MODE 0 +#define SMS_TEXT_MODE 1 + +#define SMS_ADDR_UNSPEC 0x00 +#define SMS_ADDR_LOCAL 0x81 +#define SMS_ADDR_GLOBAL 0x91 +#define SMS_ADDR_NATIONAL 0xA1 +#define SMS_ADDR_TEXT 0xD1 +#define SMS_ADDR_CMD 0xFF + +enum { + SMS_MSG_REC_UNREAD = 0, + SMS_MSG_REC_READ = 1, + SMS_MSG_STO_UNSENT = 2, + SMS_MSG_STO_SENT = 3, + SMS_MSG_ALL = 4, +}; + +enum { + SMS_DELETE_INDEX = 0, + SMS_DELETE_READ = 1, + SMS_DELETE_READSENT = 2, + SMS_DELETE_READSTO = 3, + SMS_DELETE_ALL = 4, +}; + +int msg_status_name_to_value(const char *name); +const char *msg_status_value_to_name(int value); + +struct sms_msg { + int index; + int status; + char name[PHONEBOOK_TEXT_SIZE]; + int len; + struct pdu_info pdu; + struct list_head list; +}; + +void sms_msg_free(struct sms_msg *msg); +struct sms_msg *sms_msg_alloc(void); + +#endif /* ~__SMS_UTILS_H */ |