/
mms_lib_types.h
90 lines (76 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
* Copyright (C) 2013-2014 Jolla Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef JOLLA_MMS_LIB_TYPES_H
#define JOLLA_MMS_LIB_TYPES_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _WIN32
# include <io.h>
27
# include <direct.h>
28
29
30
31
#else
# include <unistd.h>
#endif
32
#include <fcntl.h>
33
34
35
36
#include <glib.h>
#include <glib-object.h>
37
38
39
40
#ifndef O_BINARY
# define O_BINARY (0)
#endif
41
42
43
44
45
#ifdef __linux__
# define HAVE_MAGIC
# define HAVE_REALPATH
#endif
46
47
48
49
50
51
52
/* Attachment information */
typedef struct mms_attachment_info {
const char* file_name; /* Full path name */
const char* content_type; /* Content type */
const char* content_id; /* Content id */
} MMSAttachmentInfo;
53
/* Types */
54
55
56
typedef struct mms_config MMSConfig;
typedef struct mms_settings MMSSettings;
typedef struct mms_settings_sim_data MMSSettingsSimData;
57
58
typedef struct mms_handler MMSHandler;
typedef struct mms_connman MMSConnMan;
59
60
61
62
63
typedef struct mms_log_module MMSLogModule;
typedef struct mms_dispatcher MMSDispatcher;
typedef struct mms_connection MMSConnection;
typedef struct mms_message MMSPdu;
typedef struct _mms_message MMSMessage;
64
typedef struct _mms_attachment MMSAttachment;
65
66
67
/* MMS content type */
#define MMS_CONTENT_TYPE "application/vnd.wap.mms-message"
68
#define SMIL_CONTENT_TYPE "application/smil"
69
70
71
/* MMS read status */
typedef enum mms_read_status {
72
73
74
MMS_READ_STATUS_INVALID = -1, /* Invalid or unknown status */
MMS_READ_STATUS_READ, /* Message has been read */
MMS_READ_STATUS_DELETED /* Message deleted without reading */
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
} MMSReadStatus;
/* Convenience macros */
#define MMS_CAST(address,type,field) ((type *)( \
(char*)(address) - \
(char*)(&((type *)0)->field)))
#endif /* JOLLA_MMS_LIB_TYPES_H */
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/