This file is indexed.

/usr/include/evolution-data-server/camel/camel-db.h is in libcamel1.2-dev 3.28.1-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
/*
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 * This library is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation.
 *
 * This library 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 Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Sankar P <psankar@novell.com>
 *          Srinivasa Ragavan <sragavan@novell.com>
 */

#if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
#error "Only <camel/camel.h> can be included directly."
#endif

#ifndef CAMEL_DB_H
#define CAMEL_DB_H

#include <glib.h>
#include <glib-object.h>

/* Standard GObject macros */
#define CAMEL_TYPE_DB \
	(camel_db_get_type ())
#define CAMEL_DB(obj) \
	(G_TYPE_CHECK_INSTANCE_CAST \
	((obj), CAMEL_TYPE_DB, CamelDB))
#define CAMEL_DB_CLASS(cls) \
	(G_TYPE_CHECK_CLASS_CAST \
	((cls), CAMEL_TYPE_DB, CamelDBClass))
#define CAMEL_IS_DB(obj) \
	(G_TYPE_CHECK_INSTANCE_TYPE \
	((obj), CAMEL_TYPE_DB))
#define CAMEL_IS_DB_CLASS(obj) \
	(G_TYPE_CHECK_CLASS_TYPE \
	((cls), CAMEL_TYPE_DB))
#define CAMEL_DB_GET_CLASS(obj) \
	(G_TYPE_INSTANCE_GET_CLASS \
	((obj), CAMEL_TYPE_DB, CamelDBClass))

G_BEGIN_DECLS

typedef struct _CamelDB CamelDB;
typedef struct _CamelDBClass CamelDBClass;
typedef struct _CamelDBPrivate CamelDBPrivate;

/**
 * CamelDB:
 *
 * Since: 2.24
 **/
struct _CamelDB {
	/*< private >*/
	GObject parent;
	CamelDBPrivate *priv;
};

struct _CamelDBClass {
	/*< private >*/
	GObjectClass parent_class;

	/* Padding for future expansion */
	gpointer reserved[20];
};

/**
 * CamelDBCollate:
 * @enc: a used encoding (SQLITE_UTF8)
 * @length1: length of the @data1
 * @data1: the first value, of lenth @length1
 * @length2: length of the @data2
 * @data2: the second value, of lenth @length2
 *
 * A collation callback function.
 *
 * Returns: less than zero, zero, or greater than zero value, the same as for example strcmp() does.
 *
 * Since: 2.24
 **/
typedef gint (* CamelDBCollate)(gpointer enc, gint length1, gconstpointer data1, gint length2, gconstpointer data2);

/**
 * CAMEL_DB_FILE:
 *
 * Since: 2.24
 **/
#define CAMEL_DB_FILE "folders.db"

/* Hopefully no one will create a folder named EVO_IN_meM_hAnDlE */

/**
 * CAMEL_DB_IN_MEMORY_TABLE:
 *
 * Since: 2.26
 **/
#define CAMEL_DB_IN_MEMORY_TABLE "EVO_IN_meM_hAnDlE.temp"

/**
 * CAMEL_DB_IN_MEMORY_DB:
 *
 * Since: 2.26
 **/
#define CAMEL_DB_IN_MEMORY_DB "EVO_IN_meM_hAnDlE"

/**
 * CAMEL_DB_IN_MEMORY_TABLE_LIMIT:
 *
 * Since: 2.26
 **/
#define CAMEL_DB_IN_MEMORY_TABLE_LIMIT 100000


/**
 * CAMEL_DB_FREE_CACHE_SIZE:
 *
 * Since: 2.24
 **/
#define CAMEL_DB_FREE_CACHE_SIZE 2 * 1024 * 1024

/**
 * CAMEL_DB_SLEEP_INTERVAL:
 *
 * Since: 2.24
 **/
#define CAMEL_DB_SLEEP_INTERVAL 1*10*10

/**
 * CamelMIRecord:
 * @uid: Message UID
 * @flags: Camel Message info flags
 * @msg_type: unused
 * @dirty: whether the message info requires upload to the server; it corresponds to #CAMEL_MESSAGE_FOLDER_FLAGGED
 * @read: boolean read status
 * @deleted: boolean deleted status
 * @replied: boolean replied status
 * @important: boolean important status
 * @junk: boolean junk status
 * @attachment: boolean attachment status
 * @size: size of the mail
 * @dsent: date sent
 * @dreceived: date received
 * @subject: subject of the mail
 * @from: sender
 * @to: recipient
 * @cc: CC members
 * @mlist: message list headers
 * @followup_flag: followup flag / also can be queried to see for followup or not
 * @followup_completed_on: completed date, can be used to see if completed
 * @followup_due_by: to see the due by date
 * @part: part / references / thread id
 * @labels: labels of mails also called as userflags
 * @usertags: composite string of user tags
 * @cinfo: content info string - composite string
 * @bdata: provider specific data
 *
 * The extensive DB format, supporting basic searching and sorting.
 *
 * Since: 2.24
 **/
typedef struct _CamelMIRecord {
	gchar *uid;
	guint32 flags;
	guint32 msg_type;
	guint32 dirty;
	gboolean read;
	gboolean deleted;
	gboolean replied;
	gboolean important;
	gboolean junk;
	gboolean attachment;
	guint32 size;
	gint64 dsent; /* time_t */
	gint64 dreceived; /* time_t */
	gchar *subject;
	gchar *from;
	gchar *to;
	gchar *cc;
	gchar *mlist;
	gchar *followup_flag;
	gchar *followup_completed_on;
	gchar *followup_due_by;
	gchar *part;
	gchar *labels;
	gchar *usertags;
	gchar *cinfo;
	gchar *bdata;
} CamelMIRecord;

/**
 * CamelFIRecord:
 * @folder_name: name of the folder
 * @version: version of the saved information
 * @flags: folder flags
 * @nextuid: next free uid
 * @timestamp: timestamp of the summary
 * @saved_count: count of all messages
 * @unread_count: count of unread messages
 * @deleted_count: count of deleted messages
 * @junk_count: count of junk messages
 * @visible_count: count of visible (not deleted and not junk) messages
 * @jnd_count: count of junk and not deleted messages
 * @bdata: custom data of the #CamelFolderSummary descendants
 *
 * Values to store/load for single folder's #CamelFolderSummary structure.
 *
 * Since: 2.24
 **/
typedef struct _CamelFIRecord {
	gchar *folder_name;
	guint32 version;
	guint32 flags;
	guint32 nextuid;
	gint64 timestamp;
	guint32 saved_count;
	guint32 unread_count;
	guint32 deleted_count;
	guint32 junk_count;
	guint32 visible_count;
	guint32 jnd_count;  /* Junked not deleted */
	gchar *bdata;
} CamelFIRecord;

/**
 * CamelDBKnownColumnNames:
 * @CAMEL_DB_COLUMN_UNKNOWN: unknown column name
 * @CAMEL_DB_COLUMN_ATTACHMENT: attachment
 * @CAMEL_DB_COLUMN_BDATA: bdata
 * @CAMEL_DB_COLUMN_CINFO: cinfo
 * @CAMEL_DB_COLUMN_DELETED: deleted
 * @CAMEL_DB_COLUMN_DELETED_COUNT: deleted_count
 * @CAMEL_DB_COLUMN_DRECEIVED: dreceived
 * @CAMEL_DB_COLUMN_DSENT: dsent
 * @CAMEL_DB_COLUMN_FLAGS: flags
 * @CAMEL_DB_COLUMN_FOLDER_NAME: folder_name
 * @CAMEL_DB_COLUMN_FOLLOWUP_COMPLETED_ON: followup_completed_on
 * @CAMEL_DB_COLUMN_FOLLOWUP_DUE_BY: followup_due_by
 * @CAMEL_DB_COLUMN_FOLLOWUP_FLAG: followup_flag
 * @CAMEL_DB_COLUMN_IMPORTANT: important
 * @CAMEL_DB_COLUMN_JND_COUNT: jnd_count
 * @CAMEL_DB_COLUMN_JUNK: junk
 * @CAMEL_DB_COLUMN_JUNK_COUNT: junk_count
 * @CAMEL_DB_COLUMN_LABELS: labels
 * @CAMEL_DB_COLUMN_MAIL_CC: mail_cc
 * @CAMEL_DB_COLUMN_MAIL_FROM: mail_from
 * @CAMEL_DB_COLUMN_MAIL_TO: mail_to
 * @CAMEL_DB_COLUMN_MLIST: mlist
 * @CAMEL_DB_COLUMN_NEXTUID: nextuid
 * @CAMEL_DB_COLUMN_PART: part
 * @CAMEL_DB_COLUMN_READ: read
 * @CAMEL_DB_COLUMN_REPLIED: replied
 * @CAMEL_DB_COLUMN_SAVED_COUNT: saved_count
 * @CAMEL_DB_COLUMN_SIZE: size
 * @CAMEL_DB_COLUMN_SUBJECT: subject
 * @CAMEL_DB_COLUMN_TIME: time
 * @CAMEL_DB_COLUMN_UID: uid
 * @CAMEL_DB_COLUMN_UNREAD_COUNT: unread_count
 * @CAMEL_DB_COLUMN_USERTAGS: usertags
 * @CAMEL_DB_COLUMN_VERSION: version
 * @CAMEL_DB_COLUMN_VISIBLE_COUNT: visible_count
 * @CAMEL_DB_COLUMN_VUID: vuid
 *
 * An enum of all the known columns, which can be used for a quick column lookups.
 *
 * Since: 3.4
 **/
typedef enum {
	CAMEL_DB_COLUMN_UNKNOWN = -1,
	CAMEL_DB_COLUMN_ATTACHMENT,
	CAMEL_DB_COLUMN_BDATA,
	CAMEL_DB_COLUMN_CINFO,
	CAMEL_DB_COLUMN_DELETED,
	CAMEL_DB_COLUMN_DELETED_COUNT,
	CAMEL_DB_COLUMN_DRECEIVED,
	CAMEL_DB_COLUMN_DSENT,
	CAMEL_DB_COLUMN_FLAGS,
	CAMEL_DB_COLUMN_FOLDER_NAME,
	CAMEL_DB_COLUMN_FOLLOWUP_COMPLETED_ON,
	CAMEL_DB_COLUMN_FOLLOWUP_DUE_BY,
	CAMEL_DB_COLUMN_FOLLOWUP_FLAG,
	CAMEL_DB_COLUMN_IMPORTANT,
	CAMEL_DB_COLUMN_JND_COUNT,
	CAMEL_DB_COLUMN_JUNK,
	CAMEL_DB_COLUMN_JUNK_COUNT,
	CAMEL_DB_COLUMN_LABELS,
	CAMEL_DB_COLUMN_MAIL_CC,
	CAMEL_DB_COLUMN_MAIL_FROM,
	CAMEL_DB_COLUMN_MAIL_TO,
	CAMEL_DB_COLUMN_MLIST,
	CAMEL_DB_COLUMN_NEXTUID,
	CAMEL_DB_COLUMN_PART,
	CAMEL_DB_COLUMN_READ,
	CAMEL_DB_COLUMN_REPLIED,
	CAMEL_DB_COLUMN_SAVED_COUNT,
	CAMEL_DB_COLUMN_SIZE,
	CAMEL_DB_COLUMN_SUBJECT,
	CAMEL_DB_COLUMN_TIME,
	CAMEL_DB_COLUMN_UID,
	CAMEL_DB_COLUMN_UNREAD_COUNT,
	CAMEL_DB_COLUMN_USERTAGS,
	CAMEL_DB_COLUMN_VERSION,
	CAMEL_DB_COLUMN_VISIBLE_COUNT,
	CAMEL_DB_COLUMN_VUID
} CamelDBKnownColumnNames;

CamelDBKnownColumnNames camel_db_get_column_ident (GHashTable **hash, gint index, gint ncols, gchar **col_names);

/**
 * CamelDBSelectCB:
 * @user_data: a callback user data
 * @ncol: how many columns is provided
 * @colvalues: (array length=ncol): array of column values, as UTF-8 strings
 * @colnames: (array length=ncol): array of column names
 *
 * A callback called for the SELECT statements. The items at the same index of @colvalues
 * and @colnames correspond to each other.
 *
 * Returns: 0 to continue the SELECT execution, non-zero to abort the execution.
 *
 * Since: 2.24
 **/
typedef gint (* CamelDBSelectCB) (gpointer user_data, gint ncol, gchar **colvalues, gchar **colnames);

GType		camel_db_get_type		(void) G_GNUC_CONST;

CamelDB *	camel_db_new			(const gchar *filename,
						 GError **error);
const gchar *	camel_db_get_filename		(CamelDB *cdb);
gint		camel_db_command		(CamelDB *cdb,
						 const gchar *stmt,
						 GError **error);
gint		camel_db_transaction_command	(CamelDB *cdb,
						 const GList *qry_list,
						 GError **error);
gint		camel_db_begin_transaction	(CamelDB *cdb,
						 GError **error);
gint		camel_db_add_to_transaction	(CamelDB *cdb,
						 const gchar *query,
						 GError **error);
gint		camel_db_end_transaction	(CamelDB *cdb,
						 GError **error);
gint		camel_db_abort_transaction	(CamelDB *cdb,
						 GError **error);
gint		camel_db_clear_folder_summary	(CamelDB *cdb,
						 const gchar *folder_name,
						 GError **error);
gint		camel_db_rename_folder		(CamelDB *cdb,
						 const gchar *old_folder_name,
						 const gchar *new_folder_name,
						 GError **error);
gint		camel_db_delete_folder		(CamelDB *cdb,
						 const gchar *folder_name,
						 GError **error);
gint		camel_db_delete_uid		(CamelDB *cdb,
						 const gchar *folder_name,
						 const gchar *uid,
						 GError **error);
gint		camel_db_delete_uids		(CamelDB *cdb,
						 const gchar *folder_name,
						 const GList *uids,
						 GError **error);
gint		camel_db_create_folders_table	(CamelDB *cdb,
						 GError **error);
gint		camel_db_select			(CamelDB *cdb,
						 const gchar *stmt,
						 CamelDBSelectCB callback,
						 gpointer user_data,
						 GError **error);
gint		camel_db_write_folder_info_record
						(CamelDB *cdb,
						 CamelFIRecord *record,
						 GError **error);
gint		camel_db_read_folder_info_record
						(CamelDB *cdb,
						 const gchar *folder_name,
						 CamelFIRecord *record,
						 GError **error);
gint		camel_db_prepare_message_info_table
						(CamelDB *cdb,
						 const gchar *folder_name,
						 GError **error);
gint		camel_db_write_message_info_record
						(CamelDB *cdb,
						 const gchar *folder_name,
						 CamelMIRecord *record,
						 GError **error);
gint		camel_db_read_message_info_records
						(CamelDB *cdb,
						 const gchar *folder_name,
						 gpointer user_data,
						 CamelDBSelectCB callback,
						 GError **error);
gint		camel_db_read_message_info_record_with_uid
						(CamelDB *cdb,
						 const gchar *folder_name,
						 const gchar *uid,
						 gpointer user_data,
						 CamelDBSelectCB callback,
						 GError **error);
gint		camel_db_count_junk_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_unread_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_deleted_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_total_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_visible_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_visible_unread_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_junk_not_deleted_message_info
						(CamelDB *cdb,
						 const gchar *table_name,
						 guint32 *count,
						 GError **error);
gint		camel_db_count_message_info	(CamelDB *cdb,
						 const gchar *query,
						 guint32 *count,
						 GError **error);
gint		camel_db_get_folder_uids	(CamelDB *cdb,
						 const gchar *folder_name,
						 const gchar *sort_by,
						 const gchar *collate,
						 GHashTable *hash,
						 GError **error);
GPtrArray *	camel_db_get_folder_junk_uids	(CamelDB *cdb,
						 const gchar *folder_name,
						 GError **error);
GPtrArray *	camel_db_get_folder_deleted_uids
						(CamelDB *cdb,
						 const gchar *folder_name,
						 GError **error);
gint		camel_db_set_collate		(CamelDB *cdb,
						 const gchar *col,
						 const gchar *collate,
						 CamelDBCollate func);
gint		camel_db_start_in_memory_transactions
						(CamelDB *cdb,
						 GError **error);
gint		camel_db_flush_in_memory_transactions
						(CamelDB *cdb,
						 const gchar *folder_name,
						 GError **error);
gint		camel_db_reset_folder_version	(CamelDB *cdb,
						 const gchar *folder_name,
						 gint reset_version,
						 GError **error);
gboolean	camel_db_maybe_run_maintenance	(CamelDB *cdb,
						 GError **error);

void		camel_db_release_cache_memory	(void);

gchar *		camel_db_sqlize_string		(const gchar *string);
void		camel_db_free_sqlized_string	(gchar *string);
gchar *		camel_db_get_column_name	(const gchar *raw_name);
void		camel_db_camel_mir_free		(CamelMIRecord *record);

G_END_DECLS

#endif