/****  Preprocessor magic ****/

/* String table with entries starting at 0 and numbered upwards. */
#if !defined(LINEAR)
#error "Required macro LINEAR is missing."
#endif

/* Entry in a LINEAR table.  Default is to do nothing for it. */
#if !defined(STRING)
#define STRING
#endif

/* String table where entries have assigned numbers.  Multiple
 * entries can have the same number (the first listed entry is used
 * when looking up by number). */
#if !defined(NUMBERED)
#define NUMBERED LINEAR
#endif

/* Entry in a NUMBERED table */
#if !defined(ASSIGN)
#define ASSIGN(string, number) STRING(string)
#endif

/* Entry in a versioned NUMBERED table */
#if !defined(VASSIGN)
#define VASSIGN(version, string, number) VSTRING(version, string)
#endif

/* Just like LINEAR, but an enumerated type name##_enum is defined for
 * the entries. */
#if !defined(NAMED)
#define NAMED LINEAR
#endif

/* Entry in a NAMED table */
#if !defined(NSTRING)
#define NSTRING(string, name) STRING(string)
#endif

/* Entry in a versioned NAMED table */
#if !defined(VNSTRING)
#define VNSTRING(version,string, name) VSTRING(version,string)
#endif

NAMED(header, 
VNSTRING(MS_1_1, "Unknown",MMS_HEADER_NONE)
VNSTRING(MS_1_1, "Bcc",MMS_HEADER_BCC)
VNSTRING(MS_1_1, "Cc",MMS_HEADER_CC)
VNSTRING(MS_1_1, "X-Mms-Content-Location",MMS_HEADER_CONTENT_LOCATION)
VNSTRING(MS_1_1, "Content-Type",MMS_HEADER_CONTENT_TYPE)
VNSTRING(MS_1_1, "Date",MMS_HEADER_DATE)
VNSTRING(MS_1_1, "X-Mms-Delivery-Report",MMS_HEADER_DELIVERY_REPORT)
VNSTRING(MS_1_1, "X-Mms-Delivery-Time",MMS_HEADER_DELIVERY_TIME)
VNSTRING(MS_1_1, "X-Mms-Expiry",MMS_HEADER_EXPIRY)
VNSTRING(MS_1_1, "From",MMS_HEADER_FROM)
VNSTRING(MS_1_1, "X-Mms-Message-Class",MMS_HEADER_MESSAGE_CLASS)
VNSTRING(MS_1_1, "Message-ID",MMS_HEADER_MESSAGE_ID)
VNSTRING(MS_1_1, "X-Mms-Message-Type",MMS_HEADER_MESSAGE_TYPE)
VNSTRING(MS_1_1, "X-Mms-MMS-Version",MMS_HEADER_MMS_VERSION)
VNSTRING(MS_1_1, "X-Mms-Message-Size",MMS_HEADER_MESSAGE_SIZE)
VNSTRING(MS_1_1, "X-Mms-Priority",MMS_HEADER_PRIORITY)
VNSTRING(MS_1_1, "X-Mms-Read-Report",MMS_HEADER_READ_REPORT)
VNSTRING(MS_1_1, "X-Mms-Report-Allowed",MMS_HEADER_REPORT_ALLOWED)
VNSTRING(MS_1_1, "X-Mms-Response-Status",MMS_HEADER_RESPONSE_STATUS)
VNSTRING(MS_1_1, "X-Mms-Response-Text",MMS_HEADER_RESPONSE_TEXT)
VNSTRING(MS_1_1, "X-Mms-Sender-Visibility",MMS_HEADER_SENDER_VISIBILITY)
VNSTRING(MS_1_1, "X-Mms-Status",MMS_HEADER_STATUS)
VNSTRING(MS_1_1, "Subject",MMS_HEADER_SUBJECT)
VNSTRING(MS_1_1, "To",MMS_HEADER_TO)
VNSTRING(MS_1_1, "X-Mms-Transaction-Id",MMS_HEADER_TRANSACTION_ID)
VNSTRING(MS_1_1, "X-Mms-Retrieve-Status",MMS_HEADER_RETRIEVE_STATUS)
VNSTRING(MS_1_1, "X-Mms-Retrieve-Text",MMS_HEADER_RETRIEVE_TEXT)
VNSTRING(MS_1_1, "X-Mms-Read-Status",MMS_HEADER_READ_STATUS)
VNSTRING(MS_1_1, "X-Mms-Reply-Charging",MMS_HEADER_REPLY_CHARGING)
VNSTRING(MS_1_1, "X-Mms-Reply-Charging-Deadline",MMS_HEADER_REPLY_CHARGING_DEADLINE)
VNSTRING(MS_1_1, "X-Mms-Reply-Charging-ID",MMS_HEADER_REPLY_CHARGING_ID)
VNSTRING(MS_1_1, "X-Mms-Reply-Charging-Size",MMS_HEADER_REPLY_CHARGING_SIZE)
VNSTRING(MS_1_1, "X-Mms-Previously-Sent-By",MMS_HEADER_PREVIOUSLY_SENT_BY)
VNSTRING(MS_1_1, "X-Mms-Previously-Sent-Date",MMS_HEADER_PREVIOUSLY_SENT_DATE)

VNSTRING(MS_1_2,"X-Mms-Store", MMS_HEADER_STORE)
VNSTRING(MS_1_2,"X-Mms-MM-State", MMS_HEADER_MM_STATE)
VNSTRING(MS_1_2,"X-Mms-MM-Flags", MMS_HEADER_MM_FLAGS)
VNSTRING(MS_1_2,"X-Mms-Store-Status", MMS_HEADER_STORE_STATUS)
VNSTRING(MS_1_2,"X-Mms-Store-Status-Text", MMS_HEADER_STORE_STATUS_TEXT)
VNSTRING(MS_1_2,"X-Mms-Stored", MMS_HEADER_STORED)
VNSTRING(MS_1_2,"X-Mms-Attributes", MMS_HEADER_ATTRIBUTES)
VNSTRING(MS_1_2,"X-Mms-Totals", MMS_HEADER_TOTALS)
VNSTRING(MS_1_2,"X-Mms-Mbox-Totals", MMS_HEADER_MBOX_TOTALS)
VNSTRING(MS_1_2,"X-Mms-Quotas", MMS_HEADER_QUOTAS)
VNSTRING(MS_1_2,"X-Mms-Mbox-Quotas", MMS_HEADER_MBOX_QUOTAS)
VNSTRING(MS_1_2,"X-Mms-Message-Count", MMS_HEADER_MESSAGE_COUNT)
VNSTRING(MS_1_2,"Content", CONTENT)
VNSTRING(MS_1_2,"X-Mms-Start", MMS_HEADER_START)
VNSTRING(MS_1_2,"Additional-headers", ADDITIONAL_HEADERS)
VNSTRING(MS_1_2,"X-Mms-Distribution-Indicator", MMS_HEADER_DISTRIBUTION_INDICATOR)
VNSTRING(MS_1_2,"X-Mms-Element-Descriptor", MMS_HEADER_ELEMENT_DESCRIPTOR)
VNSTRING(MS_1_2,"X-Mms-Limit", MMS_HEADER_LIMIT)
)

LINEAR(reports,
STRING("Yes")
STRING("No")
)

NAMED(message_type,
VNSTRING(MS_1_1,"m-send-req", MMS_MSGTYPE_SEND_REQ)
VNSTRING(MS_1_1,"m-send-conf", MMS_MSGTYPE_SEND_CONF)
VNSTRING(MS_1_1,"m-notification-ind", MMS_MSGTYPE_NOTIFICATION_IND)
VNSTRING(MS_1_1,"m-notifyresp-ind", MMS_MSGTYPE_NOTIFYRESP)
VNSTRING(MS_1_1,"m-retrieve-conf", MMS_MSGTYPE_RETRIEVE_CONF)
VNSTRING(MS_1_1,"m-acknowledge-ind", MMS_MSGTYPE_ACKNOWLEDGE_IND)
VNSTRING(MS_1_1,"m-delivery-ind", MMS_MSGTYPE_DELIVERY_IND)
VNSTRING(MS_1_1,"m-read-rec-ind", MMS_MSGTYPE_READ_REC_IND)
VNSTRING(MS_1_1,"m-read-orig-ind", MMS_MSGTYPE_READ_ORIG_IND)
VNSTRING(MS_1_1,"m-forward-req", MMS_MSGTYPE_FORWARD_REQ)
VNSTRING(MS_1_1,"m-forward-conf", MMS_MSGTYPE_FORWARD_CONF)

VNSTRING(MS_1_2,"m-mbox-store-req",MMS_MSGTYPE_MBOX_STORE_REQ)
VNSTRING(MS_1_2,"m-mbox-store-conf",MMS_MSGTYPE_MBOX_STORE_CONF)
VNSTRING(MS_1_2,"m-mbox-view-req",MMS_MSGTYPE_MBOX_VIEW_REQ)
VNSTRING(MS_1_2,"m-mbox-view-conf",MMS_MSGTYPE_MBOX_VIEW_CONF)
VNSTRING(MS_1_2,"m-mbox-upload-req",MMS_MSGTYPE_MBOX_UPLOAD_REQ)
VNSTRING(MS_1_2,"m-mbox-upload-conf",MMS_MSGTYPE_MBOX_UPLOAD_CONF)
VNSTRING(MS_1_2,"m-mbox-delete-req",MMS_MSGTYPE_MBOX_DELETE_REQ)
VNSTRING(MS_1_2,"m-mbox-delete-conf",MMS_MSGTYPE_MBOX_DELETE_CONF)
VNSTRING(MS_1_2,"m-mbox-descr",MMS_MSGTYPE_MBOX_DESCR)
)

LINEAR(message_class,
STRING("Personal")
STRING("Advertisement")
STRING("Informational")
STRING("Auto")
)


NUMBERED(response_status,
ASSIGN("Ok",128)
ASSIGN("Error-unspecified",129) 
ASSIGN("Error-service-denied",130) 
ASSIGN("Error-message-format-corrupt",131) 
ASSIGN("Error-sending-address-unresolved",132) 
ASSIGN("Error-message-not-found",133) 
ASSIGN("Error-network-problem",134) 
ASSIGN("Error-content-not-accepted",135) 
ASSIGN("Error-unsupported-message",136)
ASSIGN("Error-transient-failure",192)
ASSIGN("Error-transient-sending-address-unresolved",193)
ASSIGN("Error-transient-message-not-found",194)
ASSIGN("Error-transient-network-problem",195)
ASSIGN("Error-permanent-failure",224)
ASSIGN("Error-permanent-service-denied",225)
ASSIGN("Error-permanent-message-format-corrupt",226)
ASSIGN("Error-permanent-sending-address-unresolved",227)
ASSIGN("Error-permanent-message-not-found",228)
ASSIGN("Error-permanent-content-not-accepted",229)
ASSIGN("Error-permanent-reply-charging-limitations-not-met",230)
ASSIGN("Error-permanent-reply-charging-request-not-accepted",231)
ASSIGN("Error-permanent-reply-charging-forwarding-denied",232)
ASSIGN("Error-permanent-reply-charging-not-supported",233)
)

NUMBERED(retrieve_status, 
ASSIGN("Ok",128)
ASSIGN("Error-transient-failure",192)
ASSIGN("Error-transient-message-not-found",193)
ASSIGN("Error-transient-network-problem",194)
ASSIGN("Error-permanent-failure",224)
ASSIGN("Error-permanent-service-denied",225)
ASSIGN("Error-permanent-message-not-found",226)
ASSIGN("Error-permanent-content-unsupported",227)
)

			 
LINEAR(priority,
STRING("Low")
STRING("Normal")
STRING("High")
)

LINEAR(read_status,
STRING("Read")
STRING("Deleted without being read")
)

LINEAR(visibility,
STRING("Hide")
STRING("Show")
)

LINEAR(reply_charging,
STRING("Requested")
STRING("Requested text only")
STRING("Accepted")
STRING("Accepted text only")
)

LINEAR(status,
STRING("Expired")
STRING("Retrieved")
STRING("Rejected")
STRING("Deferred")
STRING("Unrecognised")
STRING("Indeterminate")
STRING("Forwarded")
)


LINEAR(mm_state,
STRING("Draft")
STRING("Sent")
STRING("New")
STRING("Retrieved")
STRING("Forwarded")
)

NUMBERED(store_status, 
ASSIGN("Success",128)
ASSIGN("Error-transient-failure",192)
ASSIGN("Error-transient-network-problem",193)
ASSIGN("Error-permanent-failure",224)
ASSIGN("Error-permanent-service-denied",225)
ASSIGN("Error-permanent-message-format-corrupt",226)
ASSIGN("Error-permanent-message-not-found",227)
ASSIGN("Error-permanent-mmbox-full",228)
)

NUMBERED(descriptor_params,
ASSIGN("type", 130)
)

#undef LINEAR
#undef STRING
#undef VSTRING
#undef NUMBERED
#undef ASSIGN
#undef VASSIGN
#undef NAMED
#undef NSTRING
#undef VNSTRING
