Delta Chat Core C-API
mrparam.h
1 /*******************************************************************************
2  *
3  * Delta Chat Core
4  * Copyright (C) 2017 Björn Petersen
5  * Contact: r10s@b44t.com, http://b44t.com
6  *
7  * This program is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later
10  * version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see http://www.gnu.org/licenses/ .
19  *
20  ******************************************************************************/
21 
22 
23 #ifndef __MRPARAM_H__
24 #define __MRPARAM_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
44 typedef struct mrparam_t
45 {
47  char* m_packed;
48 } mrparam_t;
49 
50 
51 #define MRP_FILE 'f' /* for msgs */
52 #define MRP_WIDTH 'w' /* for msgs */
53 #define MRP_HEIGHT 'h' /* for msgs */
54 #define MRP_DURATION 'd' /* for msgs */
55 #define MRP_MIMETYPE 'm' /* for msgs */
56 #define MRP_AUTHORNAME 'N' /* for msgs: name of author or artist */
57 #define MRP_TRACKNAME 'n' /* for msgs: name of author or artist */
58 #define MRP_GUARANTEE_E2EE 'c' /* for msgs: 'c'rypted in original/guarantee E2EE or the message is not send */
59 #define MRP_ERRONEOUS_E2EE 'e' /* for msgs: decrypted with validation errors or without mutual set, if neither 'c' nor 'e' are preset, the messages is only transport encrypted */
60 #define MRP_WANTS_MDN 'r' /* for msgs: an incoming message which requestes a MDN (aka read receipt) */
61 #define MRP_FORWARDED 'a' /* for msgs */
62 #define MRP_SYSTEM_CMD 'S' /* for msgs */
63 #define MRP_SYSTEM_CMD_PARAM 'E' /* for msgs */
64 
65 #define MRP_SERVER_FOLDER 'Z' /* for jobs */
66 #define MRP_SERVER_UID 'z' /* for jobs */
67 #define MRP_TIMES 't' /* for jobs: times a job was tried */
68 #define MRP_TIMES_INCREATION 'T' /* for jobs: times a job was tried, used for increation */
69 
70 #define MRP_REFERENCES 'R' /* for groups and chats: References-header last used for a chat */
71 #define MRP_UNPROMOTED 'U' /* for groups */
72 #define MRP_PROFILE_IMAGE 'i' /* for groups and contacts */
73 #define MRP_DEL_AFTER_SEND 'P' /* for groups and msgs: physically delete group after message sending if msg-value matches group-value */
74 #define MRP_SELFTALK 'K' /* for chats */
75 
76 
77 /* user functions */
78 int mrparam_exists (mrparam_t*, int key);
79 char* mrparam_get (mrparam_t*, int key, const char* def); /* the value may be an empty string, "def" is returned only if the value unset. The result must be free()'d in any case. */
80 int32_t mrparam_get_int (mrparam_t*, int key, int32_t def);
81 void mrparam_set (mrparam_t*, int key, const char* value);
82 void mrparam_set_int (mrparam_t*, int key, int32_t value);
83 
84 /* library-private */
85 mrparam_t* mrparam_new ();
86 void mrparam_empty (mrparam_t*);
87 void mrparam_unref (mrparam_t*);
88 void mrparam_set_packed (mrparam_t*, const char*);
89 
90 
91 
92 
93 #ifdef __cplusplus
94 } /* /extern "C" */
95 #endif
96 #endif /* __MRPARAM_H__ */