NeoMutt  2022-04-29-178-g3b62e6
Teaching an old dog new tricks
DOXYGEN
graphviz.c File Reference

Create a GraphViz dot file from the NeoMutt objects. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "lib.h"
#include "attach/lib.h"
#include "compmbox/lib.h"
#include "imap/lib.h"
#include "maildir/lib.h"
#include "mbox/lib.h"
#include "ncrypt/lib.h"
#include "nntp/lib.h"
#include "notmuch/lib.h"
#include "pattern/lib.h"
#include "pop/lib.h"
#include "imap/adata.h"
#include "imap/mdata.h"
#include "imap/private.h"
#include "maildir/edata.h"
#include "maildir/mdata.h"
#include "maildir/private.h"
#include "mview.h"
#include "nntp/adata.h"
#include "nntp/mdata.h"
#include "notmuch/adata.h"
#include "notmuch/mdata.h"
#include "notmuch/private.h"
#include "pop/adata.h"
#include "pop/private.h"
+ Include dependency graph for graphviz.c:

Go to the source code of this file.

Macros

#define GV_HIDE_MVIEW_CONTENTS
 
#define ADD_BOOL(F)   add_flag(&buf, cont->F, #F)
 
#define ADD_BOOL(F)   add_flag(&buf, b->F, #F)
 
#define ADD_FLAG(F)   add_flag(&buf, (env->changed & F), #F)
 
#define ADDR_LIST(AL)   dot_addr_list(fp, #AL, &env->AL, links)
 
#define ADD_BOOL(F)   add_flag(&buf, e->F, #F)
 
#define ADD_BOOL(F)   add_flag(&buf, (e->security & F), #F)
 
#define ADD_BOOL(F)   add_flag(&buf, pat->F, #F)
 

Functions

void dot_email (FILE *fp, struct Email *e, struct ListHead *links)
 
void dot_envelope (FILE *fp, struct Envelope *env, struct ListHead *links)
 
void dot_patternlist (FILE *fp, struct PatternList *pl, struct ListHead *links)
 
const char * get_content_type (enum ContentType type)
 
const char * get_content_encoding (enum ContentEncoding enc)
 
const char * get_content_disposition (enum ContentDisposition disp)
 
void add_flag (struct Buffer *buf, bool is_set, const char *name)
 
void dot_type_bool (FILE *fp, const char *name, bool val)
 
void dot_type_char (FILE *fp, const char *name, char ch)
 
void dot_type_date (char *buf, size_t buflen, time_t timestamp)
 
void dot_type_file (FILE *fp, const char *name, FILE *struct_fp)
 
void dot_type_number (FILE *fp, const char *name, int num)
 
void dot_type_string_escape (char *buf, size_t buflen)
 
void dot_type_string (FILE *fp, const char *name, const char *str, bool force)
 
void dot_type_umask (char *buf, size_t buflen, int umask)
 
void dot_ptr_name (char *buf, size_t buflen, const void *ptr)
 
void dot_ptr (FILE *fp, const char *name, void *ptr, const char *colour)
 
void dot_add_link (struct ListHead *links, void *src, void *dst, const char *label, bool back, const char *colour)
 
void dot_graph_header (FILE *fp)
 
void dot_graph_footer (FILE *fp, struct ListHead *links)
 
void dot_object_header (FILE *fp, const void *ptr, const char *name, const char *colour)
 
void dot_object_footer (FILE *fp)
 
void dot_node (FILE *fp, void *ptr, const char *name, const char *colour)
 
void dot_node_link (FILE *fp, void *ptr, const char *name, void *link, const char *colour)
 
void dot_path_fs (char *buf, size_t buflen, const char *path)
 
void dot_path_imap (char *buf, size_t buflen, const char *path)
 
void dot_config (FILE *fp, const char *name, int type, struct ConfigSubset *sub, struct ListHead *links)
 
void dot_comp (FILE *fp, struct CompressInfo *ci, struct ListHead *links)
 
void dot_mailbox_type (FILE *fp, const char *name, enum MailboxType type)
 
void dot_mailbox_imap (FILE *fp, struct ImapMboxData *mdata, struct ListHead *links)
 
void dot_mailbox_maildir (FILE *fp, struct MaildirMboxData *mdata, struct ListHead *links)
 
void dot_mailbox_mbox (FILE *fp, struct MboxAccountData *mdata, struct ListHead *links)
 
void dot_mailbox_nntp (FILE *fp, struct NntpMboxData *mdata, struct ListHead *links)
 
void dot_mailbox_notmuch (FILE *fp, struct NmMboxData *mdata, struct ListHead *links)
 
void dot_mailbox_pop (FILE *fp, struct PopAccountData *adata, struct ListHead *links)
 
void dot_mailbox (FILE *fp, struct Mailbox *m, struct ListHead *links)
 
void dot_mailbox_node (FILE *fp, struct MailboxNode *mn, struct ListHead *links)
 
void dot_mailbox_list (FILE *fp, struct MailboxList *ml, struct ListHead *links, bool abbr)
 
void dot_connection (FILE *fp, struct Connection *c, struct ListHead *links)
 
void dot_account_imap (FILE *fp, struct ImapAccountData *adata, struct ListHead *links)
 
void dot_account_mbox (FILE *fp, struct MboxAccountData *adata, struct ListHead *links)
 
void dot_account_nntp (FILE *fp, struct NntpAccountData *adata, struct ListHead *links)
 
void dot_account_notmuch (FILE *fp, struct NmAccountData *adata, struct ListHead *links)
 
void dot_account_pop (FILE *fp, struct PopAccountData *adata, struct ListHead *links)
 
void dot_account (FILE *fp, struct Account *a, struct ListHead *links)
 
void dot_account_list (FILE *fp, struct AccountList *al, struct ListHead *links)
 
void dot_mview (FILE *fp, struct MailboxView *mv, struct ListHead *links)
 
void dump_graphviz (const char *title, struct MailboxView *mv)
 
void dot_parameter_list (FILE *fp, const char *name, const struct ParameterList *pl)
 
void dot_content (FILE *fp, struct Content *cont, struct ListHead *links)
 
void dot_attach_ptr (FILE *fp, struct AttachPtr *aptr, struct ListHead *links)
 
void dot_body (FILE *fp, struct Body *b, struct ListHead *links, bool link_next)
 
void dot_list_head (FILE *fp, const char *name, const struct ListHead *list)
 
void dot_addr_list (FILE *fp, const char *name, const struct AddressList *al, struct ListHead *links)
 
void dump_graphviz_body (struct Body *b)
 
void dump_graphviz_email (struct Email *e)
 
void dot_attach_ptr2 (FILE *fp, struct AttachPtr *aptr, struct ListHead *links)
 
void dot_array_actx_idx (FILE *fp, struct AttachPtr **idx, short idxlen, short idxmax, struct ListHead *links)
 
void dot_array_actx_v2r (FILE *fp, short *v2r, short vcount, struct ListHead *links)
 
void dot_array_actx_fp_idx (FILE *fp, FILE **fp_idx, short fp_len, short fp_max, struct ListHead *links)
 
void dot_array_actx_body_idx (FILE *fp, struct Body **body_idx, short body_len, short body_max, struct ListHead *links)
 
void dot_attach_ctx (FILE *fp, struct AttachCtx *actx, struct ListHead *links)
 
void dump_graphviz_attach_ctx (struct AttachCtx *actx)
 
const char * pattern_type_name (int type)
 
void dot_pattern (FILE *fp, struct Pattern *pat, struct ListHead *links)
 
void dump_graphviz_patternlist (struct PatternList *pl)
 

Detailed Description

Create a GraphViz dot file from the NeoMutt objects.

Authors
  • Richard Russon

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.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file graphviz.c.

Macro Definition Documentation

◆ GV_HIDE_MVIEW_CONTENTS

#define GV_HIDE_MVIEW_CONTENTS

Definition at line 68 of file graphviz.c.

◆ ADD_BOOL [1/5]

#define ADD_BOOL (   F)    add_flag(&buf, cont->F, #F)

◆ ADD_BOOL [2/5]

#define ADD_BOOL (   F)    add_flag(&buf, b->F, #F)

◆ ADD_FLAG

#define ADD_FLAG (   F)    add_flag(&buf, (env->changed & F), #F)

◆ ADDR_LIST

#define ADDR_LIST (   AL)    dot_addr_list(fp, #AL, &env->AL, links)

◆ ADD_BOOL [3/5]

#define ADD_BOOL (   F)    add_flag(&buf, e->F, #F)

◆ ADD_BOOL [4/5]

#define ADD_BOOL (   F)    add_flag(&buf, (e->security & F), #F)

◆ ADD_BOOL [5/5]

#define ADD_BOOL (   F)    add_flag(&buf, pat->F, #F)

Function Documentation

◆ dot_email()

void dot_email ( FILE *  fp,
struct Email e,
struct ListHead *  links 
)

Definition at line 1355 of file graphviz.c.

1356{
1357 struct Buffer buf = mutt_buffer_make(256);
1358 char arr[256];
1359
1360 dot_object_header(fp, e, "Email", "#ff80ff");
1361
1362 dot_type_string(fp, "path", e->path, true);
1363
1364#define ADD_BOOL(F) add_flag(&buf, e->F, #F)
1365 ADD_BOOL(active);
1366 ADD_BOOL(attach_del);
1367 ADD_BOOL(attach_valid);
1368 ADD_BOOL(changed);
1369 ADD_BOOL(collapsed);
1370 ADD_BOOL(deleted);
1371 ADD_BOOL(display_subject);
1372 ADD_BOOL(expired);
1373 ADD_BOOL(flagged);
1374 ADD_BOOL(matched);
1375 ADD_BOOL(mime);
1376 ADD_BOOL(old);
1377 ADD_BOOL(purge);
1378 ADD_BOOL(quasi_deleted);
1379 ADD_BOOL(read);
1380 ADD_BOOL(recip_valid);
1381 ADD_BOOL(replied);
1382 ADD_BOOL(searched);
1383 ADD_BOOL(subject_changed);
1384 ADD_BOOL(superseded);
1385 ADD_BOOL(tagged);
1386 ADD_BOOL(threaded);
1387 ADD_BOOL(trash);
1388 ADD_BOOL(visible);
1389#undef ADD_BOOL
1390 dot_type_string(fp, "bools",
1391 mutt_buffer_is_empty(&buf) ? "[NONE]" : mutt_buffer_string(&buf), true);
1392
1393 mutt_buffer_reset(&buf);
1394#define ADD_BOOL(F) add_flag(&buf, (e->security & F), #F)
1409#undef ADD_BOOL
1410 dot_type_string(fp, "security",
1411 mutt_buffer_is_empty(&buf) ? "[NONE]" : mutt_buffer_string(&buf), true);
1412
1413 dot_type_number(fp, "num_hidden", e->num_hidden);
1414 dot_type_number(fp, "offset", e->offset);
1415 dot_type_number(fp, "lines", e->lines);
1416 dot_type_number(fp, "index", e->index);
1417 dot_type_number(fp, "msgno", e->msgno);
1418 dot_type_number(fp, "vnum", e->vnum);
1419 dot_type_number(fp, "score", e->score);
1420 dot_type_number(fp, "attach_total", e->attach_total);
1421
1422 // struct MaildirEmailData *edata = maildir_edata_get(e);
1423 // if (edata)
1424 // dot_type_string(fp, "maildir_flags", edata->maildir_flags, false);
1425
1426 if (e->date_sent != 0)
1427 {
1428 char zone[32];
1429 dot_type_date(arr, sizeof(arr), e->date_sent);
1430 snprintf(zone, sizeof(zone), " (%c%02u%02u)", e->zoccident ? '-' : '+',
1431 e->zhours, e->zminutes);
1432 mutt_str_cat(arr, sizeof(arr), zone);
1433 dot_type_string(fp, "date_sent", arr, false);
1434 }
1435
1436 if (e->received != 0)
1437 {
1438 dot_type_date(arr, sizeof(arr), e->received);
1439 dot_type_string(fp, "received", arr, false);
1440 }
1441
1443
1444 if (e->body)
1445 {
1446 dot_body(fp, e->body, links, true);
1447 dot_add_link(links, e, e->body, "Email->body", false, NULL);
1448 }
1449
1450#ifndef GV_HIDE_ENVELOPE
1451 if (e->env)
1452 {
1453 dot_envelope(fp, e->env, links);
1454 dot_add_link(links, e, e->env, "Email->env", false, NULL);
1455
1456 mutt_buffer_reset(&buf);
1457 mutt_buffer_addstr(&buf, "{ rank=same ");
1458
1459 dot_ptr_name(arr, sizeof(arr), e);
1460 mutt_buffer_add_printf(&buf, "%s ", arr);
1461
1462 dot_ptr_name(arr, sizeof(arr), e->env);
1463 mutt_buffer_add_printf(&buf, "%s ", arr);
1464
1465 mutt_buffer_addstr(&buf, "}");
1466
1468 }
1469#endif
1470
1471 // struct TagList tags;
1472
1473 mutt_buffer_dealloc(&buf);
1474}
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:63
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:250
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:292
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:223
int mutt_buffer_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
Definition: buffer.c:201
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:81
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
void dot_ptr_name(char *buf, size_t buflen, const void *ptr)
Definition: graphviz.c:260
void dot_object_footer(FILE *fp)
Definition: graphviz.c:357
void dot_type_date(char *buf, size_t buflen, time_t timestamp)
Definition: graphviz.c:184
void dot_type_number(FILE *fp, const char *name, int num)
Definition: graphviz.c:206
void dot_type_string(FILE *fp, const char *name, const char *str, bool force)
Definition: graphviz.c:228
#define ADD_BOOL(F)
void dot_object_header(FILE *fp, const void *ptr, const char *name, const char *colour)
Definition: graphviz.c:340
void dot_envelope(FILE *fp, struct Envelope *env, struct ListHead *links)
Definition: graphviz.c:1293
void dot_add_link(struct ListHead *links, void *src, void *dst, const char *label, bool back, const char *colour)
Definition: graphviz.c:282
void dot_body(FILE *fp, struct Body *b, struct ListHead *links, bool link_next)
Definition: graphviz.c:1120
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Definition: list.c:64
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:250
char * mutt_str_cat(char *buf, size_t buflen, const char *s)
Concatenate two strings.
Definition: string.c:265
#define SEC_INLINE
Email has an inline signature.
Definition: lib.h:85
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:87
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
Definition: lib.h:86
#define PGP_TRADITIONAL_CHECKED
Email has a traditional (inline) signature.
Definition: lib.h:92
#define SEC_GOODSIGN
Email has a valid signature.
Definition: lib.h:80
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:90
#define SEC_SIGNOPAQUE
Email has an opaque signature (encrypted)
Definition: lib.h:83
#define SEC_BADSIGN
Email has a bad signature.
Definition: lib.h:81
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:91
#define SEC_PARTSIGN
Not all parts of the email is signed.
Definition: lib.h:82
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:78
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
Definition: lib.h:88
#define SEC_SIGN
Email is signed.
Definition: lib.h:79
#define SEC_KEYBLOCK
Email has a key attached.
Definition: lib.h:84
String manipulation buffer.
Definition: buffer.h:34
char * data
Pointer to data.
Definition: buffer.h:35
unsigned int zminutes
Minutes away from UTC.
Definition: email.h:55
struct Envelope * env
Envelope information.
Definition: email.h:66
int lines
How many lines in the body of this message?
Definition: email.h:60
struct Body * body
List of MIME parts.
Definition: email.h:67
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
Definition: email.h:122
bool zoccident
True, if west of UTC, False if east.
Definition: email.h:56
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:69
short attach_total
Number of qualifying attachments in message, if attach_valid.
Definition: email.h:115
unsigned int zhours
Hours away from UTC.
Definition: email.h:54
time_t date_sent
Time when the message was sent (UTC)
Definition: email.h:58
int vnum
Virtual message number.
Definition: email.h:114
int score
Message score.
Definition: email.h:113
int msgno
Number displayed to the user.
Definition: email.h:111
char * path
Path of Email (for local Mailboxes)
Definition: email.h:68
int index
The absolute (unsorted) message number.
Definition: email.h:110
time_t received
Time when the message was placed in the mailbox.
Definition: email.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_envelope()

void dot_envelope ( FILE *  fp,
struct Envelope env,
struct ListHead *  links 
)

Definition at line 1293 of file graphviz.c.

1294{
1295 struct Buffer buf = mutt_buffer_make(256);
1296
1297 dot_object_header(fp, env, "Envelope", "#ffff00");
1298
1299#define ADD_FLAG(F) add_flag(&buf, (env->changed & F), #F)
1304#undef ADD_BOOL
1305 dot_type_string(fp, "changed",
1306 mutt_buffer_is_empty(&buf) ? "[NONE]" : mutt_buffer_string(&buf), true);
1307
1308#define ADDR_LIST(AL) dot_addr_list(fp, #AL, &env->AL, links)
1309 ADDR_LIST(return_path);
1310 ADDR_LIST(from);
1311 ADDR_LIST(to);
1312 ADDR_LIST(cc);
1313 ADDR_LIST(bcc);
1314 ADDR_LIST(sender);
1315 ADDR_LIST(reply_to);
1316 ADDR_LIST(mail_followup_to);
1317 ADDR_LIST(x_original_to);
1318#undef ADDR_LIST
1319
1320 dot_type_string(fp, "date", env->date, false);
1321 dot_type_string(fp, "disp_subj", env->disp_subj, false);
1322 dot_type_string(fp, "followup_to", env->followup_to, false);
1323 dot_type_string(fp, "list_post", env->list_post, false);
1324 dot_type_string(fp, "list_subscribe", env->list_subscribe, false);
1325 dot_type_string(fp, "list_unsubscribe", env->list_unsubscribe, false);
1326 dot_type_string(fp, "message_id", env->message_id, false);
1327 dot_type_string(fp, "newsgroups", env->newsgroups, false);
1328 dot_type_string(fp, "organization", env->organization, false);
1329 dot_type_string(fp, "real_subj", env->real_subj, false);
1330 dot_type_string(fp, "spam", mutt_buffer_string(&env->spam), false);
1331 dot_type_string(fp, "subject", env->subject, false);
1332 dot_type_string(fp, "supersedes", env->supersedes, false);
1333 dot_type_string(fp, "xref", env->xref, false);
1334 dot_type_string(fp, "x_comment_to", env->x_comment_to, false);
1335 dot_type_string(fp, "x_label", env->x_label, false);
1336
1337 if (0)
1338 {
1339 dot_list_head(fp, "references", &env->references);
1340 dot_list_head(fp, "in_reply_to", &env->in_reply_to);
1341 dot_list_head(fp, "userhdrs", &env->userhdrs);
1342 }
1343
1344#ifdef USE_AUTOCRYPT
1345 dot_ptr(fp, "autocrypt", env->autocrypt, NULL);
1346 dot_ptr(fp, "autocrypt_gossip", env->autocrypt_gossip, NULL);
1347#endif
1348
1350
1351 mutt_buffer_dealloc(&buf);
1352}
#define MUTT_ENV_CHANGED_SUBJECT
Protected header update.
Definition: envelope.h:37
#define MUTT_ENV_CHANGED_XLABEL
X-Label edited.
Definition: envelope.h:36
#define MUTT_ENV_CHANGED_IRT
In-Reply-To changed to link/break threads.
Definition: envelope.h:34
#define MUTT_ENV_CHANGED_REFS
References changed to break thread.
Definition: envelope.h:35
#define ADDR_LIST(AL)
void dot_list_head(FILE *fp, const char *name, const struct ListHead *list)
Definition: graphviz.c:1259
#define ADD_FLAG(F)
void dot_ptr(FILE *fp, const char *name, void *ptr, const char *colour)
Definition: graphviz.c:265
struct ListHead userhdrs
user defined headers
Definition: envelope.h:87
char * supersedes
Supersedes header.
Definition: envelope.h:74
char * list_subscribe
This stores a mailto URL, or nothing.
Definition: envelope.h:68
char * followup_to
List of 'followup-to' fields.
Definition: envelope.h:81
char * message_id
Message ID.
Definition: envelope.h:73
char * x_comment_to
List of 'X-comment-to' fields.
Definition: envelope.h:82
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
Definition: envelope.h:90
char * newsgroups
List of newsgroups.
Definition: envelope.h:79
struct ListHead references
message references (in reverse order)
Definition: envelope.h:85
struct AutocryptHeader * autocrypt
Autocrypt header.
Definition: envelope.h:89
struct Buffer spam
Spam header.
Definition: envelope.h:84
struct ListHead in_reply_to
in-reply-to header content
Definition: envelope.h:86
char * subject
Email's subject.
Definition: envelope.h:70
char * xref
List of cross-references.
Definition: envelope.h:80
char * organization
Organisation header.
Definition: envelope.h:77
char * x_label
X-Label.
Definition: envelope.h:76
char * list_post
This stores a mailto URL, or nothing.
Definition: envelope.h:67
char * date
Sent date.
Definition: envelope.h:75
char * real_subj
Offset of the real subject.
Definition: envelope.h:71
char * disp_subj
Display subject (modified copy of subject)
Definition: envelope.h:72
char * list_unsubscribe
This stores a mailto URL, or nothing.
Definition: envelope.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_patternlist()

void dot_patternlist ( FILE *  fp,
struct PatternList *  pl,
struct ListHead *  links 
)

Definition at line 1802 of file graphviz.c.

1803{
1804 struct Buffer buf;
1805 mutt_buffer_init(&buf);
1806
1807 char name[256] = { 0 };
1808 mutt_buffer_addstr(&buf, "{ rank=same ");
1809
1810 struct Pattern *prev = NULL;
1811 struct Pattern *np = NULL;
1812 SLIST_FOREACH(np, pl, entries)
1813 {
1814 dot_pattern(fp, np, links);
1815 if (prev)
1816 dot_add_link(links, prev, np, "PatternList->next", false, "#ff0000");
1817 prev = np;
1818
1819 dot_ptr_name(name, sizeof(name), np);
1820 mutt_buffer_add_printf(&buf, "%s ", name);
1821 }
1822
1823 mutt_buffer_addstr(&buf, "}");
1824
1825 mutt_list_insert_tail(links, mutt_str_dup(buf.data));
1826 mutt_buffer_dealloc(&buf);
1827}
struct Buffer * mutt_buffer_init(struct Buffer *buf)
Initialise a new Buffer.
Definition: buffer.c:48
void dot_pattern(FILE *fp, struct Pattern *pat, struct ListHead *links)
Definition: graphviz.c:1744
#define SLIST_FOREACH(var, head, field)
Definition: queue.h:231
A simple (non-regex) pattern.
Definition: lib.h:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_content_type()

const char * get_content_type ( enum ContentType  type)

Definition at line 81 of file graphviz.c.

82{
83 switch (type)
84 {
85 case TYPE_OTHER:
86 return "TYPE_OTHER";
87 case TYPE_AUDIO:
88 return "TYPE_AUDIO";
90 return "TYPE_APPLICATION";
91 case TYPE_IMAGE:
92 return "TYPE_IMAGE";
93 case TYPE_MESSAGE:
94 return "TYPE_MESSAGE";
95 case TYPE_MODEL:
96 return "TYPE_MODEL";
97 case TYPE_MULTIPART:
98 return "TYPE_MULTIPART";
99 case TYPE_TEXT:
100 return "TYPE_TEXT";
101 case TYPE_VIDEO:
102 return "TYPE_VIDEO";
103 case TYPE_ANY:
104 return "TYPE_ANY";
105 default:
106 return "UNKNOWN";
107 }
108}
@ TYPE_AUDIO
Type: 'audio/*'.
Definition: mime.h:32
@ TYPE_IMAGE
Type: 'image/*'.
Definition: mime.h:34
@ TYPE_OTHER
Unknown Content-Type.
Definition: mime.h:31
@ TYPE_MESSAGE
Type: 'message/*'.
Definition: mime.h:35
@ TYPE_MODEL
Type: 'model/*'.
Definition: mime.h:36
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
@ TYPE_APPLICATION
Type: 'application/*'.
Definition: mime.h:33
@ TYPE_TEXT
Type: 'text/*'.
Definition: mime.h:38
@ TYPE_ANY
Type: '*' or '.*'.
Definition: mime.h:40
@ TYPE_VIDEO
Type: 'video/*'.
Definition: mime.h:39
+ Here is the caller graph for this function:

◆ get_content_encoding()

const char * get_content_encoding ( enum ContentEncoding  enc)

Definition at line 110 of file graphviz.c.

111{
112 switch (enc)
113 {
114 case ENC_OTHER:
115 return "ENC_OTHER";
116 case ENC_7BIT:
117 return "ENC_7BIT";
118 case ENC_8BIT:
119 return "ENC_8BIT";
121 return "ENC_QUOTED_PRINTABLE";
122 case ENC_BASE64:
123 return "ENC_BASE64";
124 case ENC_BINARY:
125 return "ENC_BINARY";
126 case ENC_UUENCODED:
127 return "ENC_UUENCODED";
128 default:
129 return "UNKNOWN";
130 }
131}
@ ENC_7BIT
7-bit text
Definition: mime.h:49
@ ENC_UUENCODED
UUEncoded text.
Definition: mime.h:54
@ ENC_OTHER
Encoding unknown.
Definition: mime.h:48
@ ENC_BINARY
Binary.
Definition: mime.h:53
@ ENC_BASE64
Base-64 encoded text.
Definition: mime.h:52
@ ENC_8BIT
8-bit text
Definition: mime.h:50
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
Definition: mime.h:51
+ Here is the caller graph for this function:

◆ get_content_disposition()

const char * get_content_disposition ( enum ContentDisposition  disp)

Definition at line 133 of file graphviz.c.

134{
135 switch (disp)
136 {
137 case DISP_INLINE:
138 return "DISP_INLINE";
139 case DISP_ATTACH:
140 return "DISP_ATTACH";
141 case DISP_FORM_DATA:
142 return "DISP_FORM_DATA";
143 case DISP_NONE:
144 return "DISP_NONE";
145 default:
146 return "UNKNOWN";
147 }
148}
@ DISP_ATTACH
Content is attached.
Definition: mime.h:63
@ DISP_INLINE
Content is inline.
Definition: mime.h:62
@ DISP_NONE
No preferred disposition.
Definition: mime.h:65
@ DISP_FORM_DATA
Content is form-data.
Definition: mime.h:64
+ Here is the caller graph for this function:

◆ add_flag()

void add_flag ( struct Buffer buf,
bool  is_set,
const char *  name 
)

Definition at line 150 of file graphviz.c.

151{
152 if (!buf || !name)
153 return;
154
155 if (is_set)
156 {
157 if (!mutt_buffer_is_empty(buf))
158 mutt_buffer_addch(buf, ',');
159 mutt_buffer_addstr(buf, name);
160 }
161}
size_t mutt_buffer_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition: buffer.c:238
+ Here is the call graph for this function:

◆ dot_type_bool()

void dot_type_bool ( FILE *  fp,
const char *  name,
bool  val 
)

Definition at line 163 of file graphviz.c.

164{
165 static const char *values[] = { "false", "true" };
166 fprintf(fp, "\t\t<tr>\n");
167 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
168 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
169 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", values[val]);
170 fprintf(fp, "\t\t</tr>\n");
171}
+ Here is the caller graph for this function:

◆ dot_type_char()

void dot_type_char ( FILE *  fp,
const char *  name,
char  ch 
)

Definition at line 174 of file graphviz.c.

175{
176 fprintf(fp, "\t\t<tr>\n");
177 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
178 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
179 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%c</td>\n", ch);
180 fprintf(fp, "\t\t</tr>\n");
181}
+ Here is the caller graph for this function:

◆ dot_type_date()

void dot_type_date ( char *  buf,
size_t  buflen,
time_t  timestamp 
)

Definition at line 184 of file graphviz.c.

185{
186 mutt_date_localtime_format(buf, buflen, "%Y-%m-%d %H:%M:%S", timestamp);
187}
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
Definition: date.c:691
static const char * timestamp(time_t stamp)
Create a YYYY-MM-DD HH:MM:SS timestamp.
Definition: logging.c:77
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_type_file()

void dot_type_file ( FILE *  fp,
const char *  name,
FILE *  struct_fp 
)

Definition at line 189 of file graphviz.c.

190{
191 fprintf(fp, "\t\t<tr>\n");
192 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
193 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
194 if (struct_fp)
195 {
196 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%p (%d)</td>\n",
197 (void *) struct_fp, fileno(struct_fp));
198 }
199 else
200 {
201 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">NULL</td>\n");
202 }
203 fprintf(fp, "\t\t</tr>\n");
204}
+ Here is the caller graph for this function:

◆ dot_type_number()

void dot_type_number ( FILE *  fp,
const char *  name,
int  num 
)

Definition at line 206 of file graphviz.c.

207{
208 fprintf(fp, "\t\t<tr>\n");
209 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
210 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
211 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%d</td>\n", num);
212 fprintf(fp, "\t\t</tr>\n");
213}
+ Here is the caller graph for this function:

◆ dot_type_string_escape()

void dot_type_string_escape ( char *  buf,
size_t  buflen 
)

Definition at line 215 of file graphviz.c.

216{
217 for (; buf[0]; buf++)
218 {
219 if (buf[0] == '<')
220 mutt_str_inline_replace(buf, buflen, 1, "&lt;");
221 else if (buf[0] == '>')
222 mutt_str_inline_replace(buf, buflen, 1, "&gt;");
223 else if (buf[0] == '&')
224 mutt_str_inline_replace(buf, buflen, 1, "&amp;");
225 }
226}
bool mutt_str_inline_replace(char *buf, size_t buflen, size_t xlen, const char *rstr)
Replace the beginning of a string.
Definition: string.c:926
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_type_string()

void dot_type_string ( FILE *  fp,
const char *  name,
const char *  str,
bool  force 
)

Definition at line 228 of file graphviz.c.

229{
230 if ((!str || (str[0] == '\0')) && !force)
231 return;
232
233 char buf[1024] = "[NULL]";
234
235 if (str)
236 {
237 mutt_str_copy(buf, str, sizeof(buf));
238 dot_type_string_escape(buf, sizeof(buf));
239 }
240
241 bool quoted = ((buf[0] != '[') && (buf[0] != '*'));
242
243 fprintf(fp, "\t\t<tr>\n");
244 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
245 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
246 if (quoted)
247 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">\"%s\"</td>\n", buf);
248 else
249 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", buf);
250 fprintf(fp, "\t\t</tr>\n");
251}
void dot_type_string_escape(char *buf, size_t buflen)
Definition: graphviz.c:215
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:629
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_type_umask()

void dot_type_umask ( char *  buf,
size_t  buflen,
int  umask 
)

Definition at line 254 of file graphviz.c.

255{
256 snprintf(buf, buflen, "0%03o", umask);
257}
+ Here is the caller graph for this function:

◆ dot_ptr_name()

void dot_ptr_name ( char *  buf,
size_t  buflen,
const void *  ptr 
)

Definition at line 260 of file graphviz.c.

261{
262 snprintf(buf, buflen, "obj_%p", ptr);
263}
+ Here is the caller graph for this function:

◆ dot_ptr()

void dot_ptr ( FILE *  fp,
const char *  name,
void *  ptr,
const char *  colour 
)

Definition at line 265 of file graphviz.c.

266{
267 fprintf(fp, "\t\t<tr>\n");
268 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
269 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
270 if (colour && ptr)
271 {
272 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\" bgcolor=\"%s\">%p</td>\n",
273 colour, ptr);
274 }
275 else
276 {
277 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%p</td>\n", ptr);
278 }
279 fprintf(fp, "\t\t</tr>\n");
280}
+ Here is the caller graph for this function:

◆ dot_add_link()

void dot_add_link ( struct ListHead *  links,
void *  src,
void *  dst,
const char *  label,
bool  back,
const char *  colour 
)

Definition at line 282 of file graphviz.c.

284{
285 if (!src || !dst)
286 return;
287 if (!colour)
288 colour = "#c0c0c0";
289
290 char obj1[64] = { 0 };
291 char obj2[64] = { 0 };
292 char text[256] = { 0 };
293 char lstr[128] = { 0 };
294
295 dot_ptr_name(obj1, sizeof(obj1), src);
296 dot_ptr_name(obj2, sizeof(obj2), dst);
297
298 if (label)
299 snprintf(lstr, sizeof(lstr), "edgetooltip=\"%s\"", label);
300
301 snprintf(text, sizeof(text), "%s -> %s [ %s %s color=\"%s\" ]", obj1, obj2,
302 back ? "dir=back" : "", lstr, colour);
304}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_graph_header()

void dot_graph_header ( FILE *  fp)

Definition at line 306 of file graphviz.c.

307{
308 fprintf(fp, "digraph neomutt\n");
309 fprintf(fp, "{\n\n");
310
311 fprintf(fp, "\tgraph [\n");
312 fprintf(fp, "\t\trankdir=\"TB\"\n");
313 fprintf(fp, "\t\tnodesep=\"0.5\"\n");
314 fprintf(fp, "\t\tranksep=\"0.5\"\n");
315 fprintf(fp, "\t];\n");
316 fprintf(fp, "\n");
317 fprintf(fp, "\tnode [\n");
318 fprintf(fp, "\t\tshape=\"plain\"\n");
319 fprintf(fp, "\t];\n");
320 fprintf(fp, "\n");
321 fprintf(fp, "\tedge [\n");
322 fprintf(fp, "\t\tpenwidth=\"4.5\"\n");
323 fprintf(fp, "\t\tarrowsize=\"1.0\"\n");
324 fprintf(fp, "\t\tcolor=\"#c0c0c0\"\n");
325 fprintf(fp, "\t];\n");
326 fprintf(fp, "\n");
327}
+ Here is the caller graph for this function:

◆ dot_graph_footer()

void dot_graph_footer ( FILE *  fp,
struct ListHead *  links 
)

Definition at line 329 of file graphviz.c.

330{
331 fprintf(fp, "\n");
332 struct ListNode *np = NULL;
333 STAILQ_FOREACH(np, links, entries)
334 {
335 fprintf(fp, "\t%s;\n", np->data);
336 }
337 fprintf(fp, "\n}\n");
338}
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
A List node for strings.
Definition: list.h:35
char * data
String.
Definition: list.h:36
+ Here is the caller graph for this function:

◆ dot_object_header()

void dot_object_header ( FILE *  fp,
const void *  ptr,
const char *  name,
const char *  colour 
)

Definition at line 340 of file graphviz.c.

341{
342 char obj[64] = { 0 };
343 dot_ptr_name(obj, sizeof(obj), ptr);
344
345 if (!colour)
346 colour = "#ffff80";
347
348 fprintf(fp, "\t%s [\n", obj);
349 fprintf(fp, "\t\tlabel=<<table cellspacing=\"0\" border=\"1\" rows=\"*\" "
350 "color=\"#d0d0d0\">\n");
351 fprintf(fp, "\t\t<tr>\n");
352 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\" bgcolor=\"%s\" port=\"top\" colspan=\"3\"><font color=\"#000000\" point-size=\"20\"><b>%s</b></font> <font point-size=\"12\">(%p)</font></td>\n",
353 colour, name, ptr);
354 fprintf(fp, "\t\t</tr>\n");
355}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_object_footer()

void dot_object_footer ( FILE *  fp)

Definition at line 357 of file graphviz.c.

358{
359 fprintf(fp, "\t\t</table>>\n");
360 fprintf(fp, "\t];\n");
361 fprintf(fp, "\n");
362}
+ Here is the caller graph for this function:

◆ dot_node()

void dot_node ( FILE *  fp,
void *  ptr,
const char *  name,
const char *  colour 
)

Definition at line 364 of file graphviz.c.

365{
366 char obj[64] = { 0 };
367 dot_ptr_name(obj, sizeof(obj), ptr);
368
369 fprintf(fp, "\t%s [\n", obj);
370 fprintf(fp, "\t\tlabel=<<table cellspacing=\"0\" border=\"1\" rows=\"*\" "
371 "color=\"#d0d0d0\">\n");
372 fprintf(fp, "\t\t<tr>\n");
373 fprintf(fp, "\t\t\t<td border=\"0\" bgcolor=\"%s\" port=\"top\"><font color=\"#000000\" point-size=\"20\"><b>%s</b></font></td>\n",
374 colour, name);
375 fprintf(fp, "\t\t</tr>\n");
377}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_node_link()

void dot_node_link ( FILE *  fp,
void *  ptr,
const char *  name,
void *  link,
const char *  colour 
)

Definition at line 379 of file graphviz.c.

380{
381 char obj[64] = { 0 };
382 dot_ptr_name(obj, sizeof(obj), ptr);
383
384 fprintf(fp, "\t%s [\n", obj);
385 fprintf(fp, "\t\tlabel=<<table cellspacing=\"0\" border=\"1\" rows=\"*\" "
386 "color=\"#d0d0d0\">\n");
387 fprintf(fp, "\t\t<tr>\n");
388 fprintf(fp, "\t\t\t<td border=\"0\" bgcolor=\"%s\" port=\"top\"><font color=\"#000000\" point-size=\"20\"><b>%s</b></font></td>\n",
389 colour, name);
390 fprintf(fp, "\t\t</tr>\n");
391
392 fprintf(fp, "\t\t<tr>\n");
393 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\" bgcolor=\"%s\">%p</td>\n", colour, link);
394 fprintf(fp, "\t\t</tr>\n");
395
397}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_path_fs()

void dot_path_fs ( char *  buf,
size_t  buflen,
const char *  path 
)

Definition at line 399 of file graphviz.c.

400{
401 if (!path)
402 {
403 buf[0] = '\0';
404 return;
405 }
406
407 const char *slash = strrchr(path, '/');
408 if (slash)
409 slash++;
410 else
411 slash = path;
412
413 mutt_str_copy(buf, slash, buflen);
414}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_path_imap()

void dot_path_imap ( char *  buf,
size_t  buflen,
const char *  path 
)

Definition at line 416 of file graphviz.c.

417{
418 char tmp[1024] = { 0 };
419 mutt_str_copy(tmp, path, sizeof(tmp));
420
421 struct Url *u = url_parse(tmp);
422
423 if (u->path && (u->path[0] != '\0'))
424 mutt_str_copy(buf, u->path, buflen);
425 else
426 snprintf(buf, buflen, "%s:%s", u->host, u->user);
427
428 url_free(&u);
429}
A parsed URL proto://user:password@host:port/path?a=1&b=2
Definition: url.h:69
char * user
Username.
Definition: url.h:71
char * host
Host.
Definition: url.h:73
char * path
Path.
Definition: url.h:75
struct Url * url_parse(const char *src)
Fill in Url.
Definition: url.c:234
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition: url.c:123
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_config()

void dot_config ( FILE *  fp,
const char *  name,
int  type,
struct ConfigSubset sub,
struct ListHead *  links 
)

Definition at line 432 of file graphviz.c.

434{
435 if (!sub)
436 return;
437
438 struct Buffer value = mutt_buffer_make(256);
439 dot_object_header(fp, (void *) name, "Config", "#ffff80");
440 dot_type_string(fp, "scope", sub->name, true);
441
442 if (sub->name)
443 {
444 char scope[256];
445 snprintf(scope, sizeof(scope), "%s:", sub->name);
446
447 struct HashElem **list = get_elem_list(sub->cs);
448 for (size_t i = 0; list[i]; i++)
449 {
450 struct HashElem *item = list[i];
451 if ((item->type & type) == 0)
452 continue;
453
454 const char *iname = item->key.strkey;
455 size_t slen = strlen(scope);
456 if (mutt_str_startswith(iname, scope) != 0)
457 {
458 if (strchr(iname + slen, ':'))
459 continue;
460 if ((DTYPE(item->type) == DT_STRING) && (item->type & DT_SENSITIVE))
461 {
462 dot_type_string(fp, iname + slen, "***", true);
463 }
464 else
465 {
466 mutt_buffer_reset(&value);
467 cs_subset_he_string_get(sub, item, &value);
468 dot_type_string(fp, iname + slen, value.data, true);
469 }
470 }
471 }
472 FREE(&list);
473 }
474 else
475 {
476 struct HashElem **list = get_elem_list(sub->cs);
477 int i = 0;
478 for (; list[i]; i++)
479 ; // do nothing
480
481 dot_type_number(fp, "count", i);
482 FREE(&list);
483 }
484
486 mutt_buffer_dealloc(&value);
487}
#define FREE(x)
Definition: memory.h:43
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:227
const char * name
Scope name of Subset.
Definition: subset.h:48
struct ConfigSet * cs
Parent ConfigSet.
Definition: subset.h:51
The item stored in a Hash Table.
Definition: hash.h:44
union HashKey key
Key representing the data.
Definition: hash.h:46
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Definition: hash.h:45
int cs_subset_he_string_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
Definition: subset.c:354
struct HashElem ** get_elem_list(struct ConfigSet *cs)
Create a sorted list of all config items.
Definition: subset.c:75
#define DTYPE(x)
Mask for the Data Type.
Definition: types.h:44
#define DT_STRING
a string
Definition: types.h:41
#define DT_SENSITIVE
Contains sensitive value, e.g. password.
Definition: types.h:49
const char * strkey
String key.
Definition: hash.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_comp()

void dot_comp ( FILE *  fp,
struct CompressInfo ci,
struct ListHead *  links 
)

Definition at line 490 of file graphviz.c.

491{
492 dot_object_header(fp, ci, "CompressInfo", "#c0c060");
493 dot_type_string(fp, "append", ci->cmd_append, true);
494 dot_type_string(fp, "close", ci->cmd_close, true);
495 dot_type_string(fp, "open", ci->cmd_open, true);
497}
const char * cmd_append
append-hook command
Definition: lib.h:48
const char * cmd_open
open-hook command
Definition: lib.h:50
const char * cmd_close
close-hook command
Definition: lib.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_type()

void dot_mailbox_type ( FILE *  fp,
const char *  name,
enum MailboxType  type 
)

Definition at line 499 of file graphviz.c.

500{
501 const char *typestr = NULL;
502
503 switch (type)
504 {
505 case MUTT_MBOX:
506 typestr = "MBOX";
507 break;
508 case MUTT_MMDF:
509 typestr = "MMDF";
510 break;
511 case MUTT_MH:
512 typestr = "MH";
513 break;
514 case MUTT_MAILDIR:
515 typestr = "MAILDIR";
516 break;
517 case MUTT_NNTP:
518 typestr = "NNTP";
519 break;
520 case MUTT_IMAP:
521 typestr = "IMAP";
522 break;
523 case MUTT_NOTMUCH:
524 typestr = "NOTMUCH";
525 break;
526 case MUTT_POP:
527 typestr = "POP";
528 break;
529 case MUTT_COMPRESSED:
530 typestr = "COMPRESSED";
531 break;
532 default:
533 typestr = "UNKNOWN";
534 }
535
536 fprintf(fp, "\t\t<tr>\n");
537 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
538 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
539 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", typestr);
540 fprintf(fp, "\t\t</tr>\n");
541}
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition: mailbox.h:51
@ MUTT_MMDF
'mmdf' Mailbox type
Definition: mailbox.h:46
@ MUTT_POP
'POP3' Mailbox type
Definition: mailbox.h:52
@ MUTT_MH
'MH' Mailbox type
Definition: mailbox.h:47
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition: mailbox.h:49
@ MUTT_IMAP
'IMAP' Mailbox type
Definition: mailbox.h:50
@ MUTT_MBOX
'mbox' Mailbox type
Definition: mailbox.h:45
@ MUTT_COMPRESSED
Compressed file Mailbox type.
Definition: mailbox.h:53
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition: mailbox.h:48
+ Here is the caller graph for this function:

◆ dot_mailbox_imap()

void dot_mailbox_imap ( FILE *  fp,
struct ImapMboxData mdata,
struct ListHead *  links 
)

Definition at line 544 of file graphviz.c.

545{
546 dot_object_header(fp, mdata, "ImapMboxData", "#60c060");
547 dot_type_string(fp, "name", mdata->name, true);
548 dot_type_string(fp, "munge_name", mdata->munge_name, true);
549 dot_type_string(fp, "real_name", mdata->real_name, true);
551}
char * real_name
Original Mailbox name, e.g.: INBOX can be just \0.
Definition: mdata.h:42
char * munge_name
Munged version of the mailbox name.
Definition: mdata.h:41
char * name
Mailbox name.
Definition: mdata.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_maildir()

void dot_mailbox_maildir ( FILE *  fp,
struct MaildirMboxData mdata,
struct ListHead *  links 
)

Definition at line 553 of file graphviz.c.

554{
555 char buf[64] = { 0 };
556
557 dot_object_header(fp, mdata, "MaildirMboxData", "#60c060");
558
559 dot_type_date(buf, sizeof(buf), mdata->mtime_cur.tv_sec);
560 dot_type_string(fp, "mtime_cur", buf, true);
561
562 dot_type_umask(buf, sizeof(buf), mdata->mh_umask);
563 dot_type_string(fp, "mh_umask", buf, true);
565}
void dot_type_umask(char *buf, size_t buflen, int umask)
Definition: graphviz.c:254
mode_t mh_umask
umask to use when creating files
Definition: mdata.h:37
struct timespec mtime_cur
Timestamp of the 'cur' dir.
Definition: mdata.h:36
time_t tv_sec
Number of seconds since the epoch.
Definition: file.h:50
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_mbox()

void dot_mailbox_mbox ( FILE *  fp,
struct MboxAccountData mdata,
struct ListHead *  links 
)

Definition at line 567 of file graphviz.c.

568{
569 char buf[64] = { 0 };
570
571 dot_object_header(fp, mdata, "MboxAccountData", "#60c060");
572 dot_ptr(fp, "fp", mdata->fp, NULL);
573
574 dot_type_date(buf, sizeof(buf), mdata->atime.tv_sec);
575 dot_type_string(fp, "atime", buf, true);
576
578}
FILE * fp
Mailbox file.
Definition: lib.h:50
struct timespec atime
File's last-access time.
Definition: lib.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_nntp()

void dot_mailbox_nntp ( FILE *  fp,
struct NntpMboxData mdata,
struct ListHead *  links 
)

Definition at line 580 of file graphviz.c.

581{
582 dot_object_header(fp, mdata, "NntpMboxData", "#60c060");
583 dot_type_string(fp, "group", mdata->group, true);
584 dot_type_string(fp, "desc", mdata->desc, true);
585
586 dot_type_number(fp, "first_message", mdata->first_message);
587 dot_type_number(fp, "last_message", mdata->last_message);
588 dot_type_number(fp, "last_loaded", mdata->last_loaded);
589 dot_type_number(fp, "last_cached", mdata->last_cached);
590 dot_type_number(fp, "unread", mdata->unread);
591
592 dot_type_bool(fp, "subscribed", mdata->subscribed);
593 dot_type_bool(fp, "has_new_mail", mdata->has_new_mail);
594 dot_type_bool(fp, "allowed", mdata->allowed);
595 dot_type_bool(fp, "deleted", mdata->deleted);
596
598}
void dot_type_bool(FILE *fp, const char *name, bool val)
Definition: graphviz.c:163
anum_t last_cached
Definition: mdata.h:39
bool deleted
Definition: mdata.h:44
bool allowed
Definition: mdata.h:43
anum_t last_message
Definition: mdata.h:37
char * group
Name of newsgroup.
Definition: mdata.h:34
char * desc
Description of newsgroup.
Definition: mdata.h:35
anum_t unread
Definition: mdata.h:40
anum_t last_loaded
Definition: mdata.h:38
bool has_new_mail
Definition: mdata.h:42
anum_t first_message
Definition: mdata.h:36
bool subscribed
Definition: mdata.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_notmuch()

void dot_mailbox_notmuch ( FILE *  fp,
struct NmMboxData mdata,
struct ListHead *  links 
)

Definition at line 600 of file graphviz.c.

601{
602 dot_object_header(fp, mdata, "NmMboxData", "#60c060");
603 dot_type_number(fp, "db_limit", mdata->db_limit);
605}
int db_limit
Maximum number of results to return.
Definition: mdata.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_pop()

void dot_mailbox_pop ( FILE *  fp,
struct PopAccountData adata,
struct ListHead *  links 
)

Definition at line 607 of file graphviz.c.

608{
609 dot_object_header(fp, adata, "PopAccountData", "#60c060");
610 dot_ptr(fp, "conn", adata->conn, "#ff8080");
612}
struct Connection * conn
Connection to POP server.
Definition: adata.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox()

void dot_mailbox ( FILE *  fp,
struct Mailbox m,
struct ListHead *  links 
)

Definition at line 615 of file graphviz.c.

616{
617 char buf[64] = { 0 };
618
619 dot_object_header(fp, m, "Mailbox", "#80ff80");
620 dot_mailbox_type(fp, "type", m->type);
621 dot_type_string(fp, "name", m->name, false);
622
623 if ((m->type == MUTT_IMAP) || (m->type == MUTT_POP))
624 {
625 dot_path_imap(buf, sizeof(buf), mutt_buffer_string(&m->pathbuf));
626 dot_type_string(fp, "pathbuf", buf, true);
627 dot_path_imap(buf, sizeof(buf), m->realpath);
628 dot_type_string(fp, "realpath", buf, true);
629 }
630 else
631 {
632 dot_path_fs(buf, sizeof(buf), mutt_buffer_string(&m->pathbuf));
633 dot_type_string(fp, "pathbuf", buf, true);
634 dot_path_fs(buf, sizeof(buf), m->realpath);
635 dot_type_string(fp, "realpath", buf, true);
636 }
637
638#ifdef GV_HIDE_MDATA
639 dot_ptr(fp, "mdata", m->mdata, NULL);
640#endif
641 dot_ptr(fp, "account", m->account, "#80ffff");
642 dot_type_number(fp, "opened", m->opened);
643
644 dot_type_number(fp, "msg_count", m->msg_count);
645 // dot_type_number(fp, "msg_unread", m->msg_unread);
646 // dot_type_number(fp, "msg_flagged", m->msg_flagged);
647 // dot_type_number(fp, "msg_new", m->msg_new);
648 // dot_type_number(fp, "msg_deleted", m->msg_deleted);
649 // dot_type_number(fp, "msg_tagged", m->msg_tagged);
650
651 dot_ptr(fp, "emails", m->emails, NULL);
652 dot_type_number(fp, "email_max", m->email_max);
653 dot_ptr(fp, "v2r", m->v2r, NULL);
654 dot_type_number(fp, "vcount", m->vcount);
655
657
658 // dot_add_link(links, m, m->mdata, false, NULL);
659
660#ifndef GV_HIDE_MDATA
661 if (m->mdata)
662 {
663 if (m->type == MUTT_MAILDIR)
664 dot_mailbox_maildir(fp, m->mdata, links);
665 else if (m->type == MUTT_IMAP)
666 dot_mailbox_imap(fp, m->mdata, links);
667 else if (m->type == MUTT_POP)
668 dot_mailbox_pop(fp, m->mdata, links);
669 else if (m->type == MUTT_MBOX)
670 dot_mailbox_mbox(fp, m->mdata, links);
671 else if (m->type == MUTT_NNTP)
672 dot_mailbox_nntp(fp, m->mdata, links);
673 else if (m->type == MUTT_NOTMUCH)
674 dot_mailbox_notmuch(fp, m->mdata, links);
675
676 dot_add_link(links, m, m->mdata, "Mailbox->mdata", false, NULL);
677 }
678#endif
679
680 if (m->compress_info)
681 {
682 dot_comp(fp, m->compress_info, links);
683 dot_add_link(links, m, m->compress_info, "Mailbox->compress_info", false, NULL);
684 }
685
686#ifndef GV_HIDE_CONFIG
687 if (m->name)
688 {
689 dot_config(fp, m->name, DT_INHERIT_MBOX, m->sub, links);
690 dot_add_link(links, m, m->name, "Mailbox Config", false, NULL);
691 }
692#endif
693}
void dot_mailbox_pop(FILE *fp, struct PopAccountData *adata, struct ListHead *links)
Definition: graphviz.c:607
void dot_path_fs(char *buf, size_t buflen, const char *path)
Definition: graphviz.c:399
void dot_mailbox_imap(FILE *fp, struct ImapMboxData *mdata, struct ListHead *links)
Definition: graphviz.c:544
void dot_comp(FILE *fp, struct CompressInfo *ci, struct ListHead *links)
Definition: graphviz.c:490
void dot_mailbox_type(FILE *fp, const char *name, enum MailboxType type)
Definition: graphviz.c:499
void dot_config(FILE *fp, const char *name, int type, struct ConfigSubset *sub, struct ListHead *links)
Definition: graphviz.c:432
void dot_mailbox_mbox(FILE *fp, struct MboxAccountData *mdata, struct ListHead *links)
Definition: graphviz.c:567
void dot_path_imap(char *buf, size_t buflen, const char *path)
Definition: graphviz.c:416
void dot_mailbox_notmuch(FILE *fp, struct NmMboxData *mdata, struct ListHead *links)
Definition: graphviz.c:600
void dot_mailbox_maildir(FILE *fp, struct MaildirMboxData *mdata, struct ListHead *links)
Definition: graphviz.c:553
void dot_mailbox_nntp(FILE *fp, struct NntpMboxData *mdata, struct ListHead *links)
Definition: graphviz.c:580
int vcount
The number of virtual messages.
Definition: mailbox.h:99
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition: mailbox.h:81
int * v2r
Mapping from virtual to real msgno.
Definition: mailbox.h:98
int msg_count
Total number of messages.
Definition: mailbox.h:88
int email_max
Number of pointers in emails.
Definition: mailbox.h:97
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
void * mdata
Driver specific data.
Definition: mailbox.h:133
struct Email ** emails
Array of Emails.
Definition: mailbox.h:96
char * name
A short name for the Mailbox.
Definition: mailbox.h:82
struct Buffer pathbuf
Path of the Mailbox.
Definition: mailbox.h:80
struct Account * account
Account that owns this Mailbox.
Definition: mailbox.h:128
int opened
Number of times mailbox is opened.
Definition: mailbox.h:129
void * compress_info
Compressed mbox module private data.
Definition: mailbox.h:121
struct ConfigSubset * sub
Inherited config items.
Definition: mailbox.h:83
#define DT_INHERIT_MBOX
Config item can be Mailbox-specific.
Definition: types.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_node()

void dot_mailbox_node ( FILE *  fp,
struct MailboxNode mn,
struct ListHead *  links 
)

Definition at line 695 of file graphviz.c.

696{
697 dot_node(fp, mn, "MN", "#80ff80");
698
699 dot_mailbox(fp, mn->mailbox, links);
700
701 dot_add_link(links, mn, mn->mailbox, "MailboxNode->mailbox", false, NULL);
702
703 struct Buffer buf;
704 mutt_buffer_init(&buf);
705
706 char name[256] = { 0 };
707 mutt_buffer_addstr(&buf, "{ rank=same ");
708
709 dot_ptr_name(name, sizeof(name), mn);
710 mutt_buffer_add_printf(&buf, "%s ", name);
711
712 dot_ptr_name(name, sizeof(name), mn->mailbox);
713 mutt_buffer_add_printf(&buf, "%s ", name);
714
715#ifndef GV_HIDE_MDATA
716 if (mn->mailbox->mdata)
717 {
718 dot_ptr_name(name, sizeof(name), mn->mailbox->mdata);
719 mutt_buffer_add_printf(&buf, "%s ", name);
720 }
721#endif
722
723#ifndef GV_HIDE_CONFIG
724 if (mn->mailbox->name)
725 {
726 dot_ptr_name(name, sizeof(name), mn->mailbox->name);
727 mutt_buffer_add_printf(&buf, "%s ", name);
728 }
729#endif
730
731 mutt_buffer_addstr(&buf, "}");
732
733 mutt_list_insert_tail(links, mutt_str_dup(buf.data));
735}
void dot_node(FILE *fp, void *ptr, const char *name, const char *colour)
Definition: graphviz.c:364
void dot_mailbox(FILE *fp, struct Mailbox *m, struct ListHead *links)
Definition: graphviz.c:615
struct Mailbox * mailbox
Mailbox in the list.
Definition: mailbox.h:155
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_list()

void dot_mailbox_list ( FILE *  fp,
struct MailboxList *  ml,
struct ListHead *  links,
bool  abbr 
)

Definition at line 737 of file graphviz.c.

738{
739 struct MailboxNode *prev = NULL;
740 struct MailboxNode *np = NULL;
741 STAILQ_FOREACH(np, ml, entries)
742 {
743 if (abbr)
744 dot_node_link(fp, np, "MN", np->mailbox, "#80ff80");
745 else
746 dot_mailbox_node(fp, np, links);
747 if (prev)
748 dot_add_link(links, prev, np, "MailboxNode->next", false, NULL);
749 prev = np;
750 }
751}
void dot_mailbox_node(FILE *fp, struct MailboxNode *mn, struct ListHead *links)
Definition: graphviz.c:695
void dot_node_link(FILE *fp, void *ptr, const char *name, void *link, const char *colour)
Definition: graphviz.c:379
List of Mailboxes.
Definition: mailbox.h:154
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_connection()

void dot_connection ( FILE *  fp,
struct Connection c,
struct ListHead *  links 
)

Definition at line 754 of file graphviz.c.

755{
756 dot_object_header(fp, c, "Connection", "#ff8080");
757 // dot_ptr(fp, "sockdata", c->sockdata, "#60c0c0");
758 dot_type_number(fp, "fd", c->fd);
760
761 dot_object_header(fp, c->inbuf, "ConnAccount", "#ff8080");
762 dot_type_string(fp, "user", c->account.user, true);
763 dot_type_string(fp, "host", c->account.host, true);
764 dot_type_number(fp, "port", c->account.port);
766
767 dot_add_link(links, c, c->inbuf, "Connection.ConnAccount", false, NULL);
768}
char user[128]
Username.
Definition: connaccount.h:56
char host[128]
Server to login to.
Definition: connaccount.h:54
unsigned short port
Port to connect to.
Definition: connaccount.h:58
char inbuf[1024]
Buffer for incoming traffic.
Definition: connection.h:52
struct ConnAccount account
Account details: username, password, etc.
Definition: connection.h:50
int fd
Socket file descriptor.
Definition: connection.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_imap()

void dot_account_imap ( FILE *  fp,
struct ImapAccountData adata,
struct ListHead *  links 
)

Definition at line 770 of file graphviz.c.

771{
772 dot_object_header(fp, adata, "ImapAccountData", "#60c0c0");
773 // dot_type_string(fp, "mbox_name", adata->mbox_name, true);
774 // dot_type_string(fp, "login", adata->conn->account.login, true);
775 dot_type_string(fp, "user", adata->conn->account.user, true);
776 dot_type_string(fp, "pass", adata->conn->account.pass[0] ? "***" : "", true);
777 dot_type_number(fp, "port", adata->conn->account.port);
778 // dot_ptr(fp, "conn", adata->conn, "#ff8080");
779 dot_type_bool(fp, "unicode", adata->unicode);
780 dot_type_bool(fp, "qresync", adata->qresync);
781 dot_type_char(fp, "seqid", adata->seqid);
782 dot_ptr(fp, "mailbox", adata->mailbox, "#80ff80");
784
785 if (adata->conn)
786 {
787 dot_connection(fp, adata->conn, links);
788 dot_add_link(links, adata, adata->conn, "ImapAccountData->conn", false, NULL);
789 }
790}
void dot_type_char(FILE *fp, const char *name, char ch)
Definition: graphviz.c:174
void dot_connection(FILE *fp, struct Connection *c, struct ListHead *links)
Definition: graphviz.c:754
char pass[256]
Password.
Definition: connaccount.h:57
bool qresync
true, if QRESYNC is successfully ENABLE'd
Definition: adata.h:63
unsigned char seqid
tag sequence prefix
Definition: adata.h:56
bool unicode
If true, we can send UTF-8, and the server will use UTF8 rather than mUTF7.
Definition: adata.h:62
struct Mailbox * mailbox
Current selected mailbox.
Definition: adata.h:76
struct Connection * conn
Connection to IMAP server.
Definition: adata.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_mbox()

void dot_account_mbox ( FILE *  fp,
struct MboxAccountData adata,
struct ListHead *  links 
)

Definition at line 792 of file graphviz.c.

793{
794 char buf[64] = { 0 };
795
796 dot_object_header(fp, adata, "MboxAccountData", "#60c0c0");
797 dot_ptr(fp, "fp", adata->fp, NULL);
798
799 dot_type_date(buf, sizeof(buf), adata->atime.tv_sec);
800 dot_type_string(fp, "atime", buf, true);
801 dot_type_bool(fp, "locked", adata->locked);
802 dot_type_bool(fp, "append", adata->append);
803
805}
bool append
mailbox is opened in append mode
Definition: lib.h:54
bool locked
is the mailbox locked?
Definition: lib.h:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_nntp()

void dot_account_nntp ( FILE *  fp,
struct NntpAccountData adata,
struct ListHead *  links 
)

Definition at line 807 of file graphviz.c.

808{
809 dot_object_header(fp, adata, "NntpAccountData", "#60c0c0");
810 dot_type_number(fp, "groups_num", adata->groups_num);
811
812 dot_type_bool(fp, "hasCAPABILITIES", adata->hasCAPABILITIES);
813 dot_type_bool(fp, "hasSTARTTLS", adata->hasSTARTTLS);
814 dot_type_bool(fp, "hasDATE", adata->hasDATE);
815 dot_type_bool(fp, "hasLIST_NEWSGROUPS", adata->hasLIST_NEWSGROUPS);
816 dot_type_bool(fp, "hasXGTITLE", adata->hasXGTITLE);
817 dot_type_bool(fp, "hasLISTGROUP", adata->hasLISTGROUP);
818 dot_type_bool(fp, "hasLISTGROUPrange", adata->hasLISTGROUPrange);
819 dot_type_bool(fp, "hasOVER", adata->hasOVER);
820 dot_type_bool(fp, "hasXOVER", adata->hasXOVER);
821 dot_type_bool(fp, "cacheable", adata->cacheable);
822 dot_type_bool(fp, "newsrc_modified", adata->newsrc_modified);
823
824 dot_type_string(fp, "authenticators", adata->authenticators, true);
825 dot_type_string(fp, "overview_fmt", adata->overview_fmt, true);
826 dot_type_string(fp, "newsrc_file", adata->newsrc_file, true);
827 dot_type_file(fp, "newsrc_fp", adata->fp_newsrc);
828
829 dot_type_number(fp, "groups_num", adata->groups_num);
830 dot_type_number(fp, "groups_max", adata->groups_max);
831
832 char buf[128];
833 dot_type_date(buf, sizeof(buf), adata->mtime);
834 dot_type_string(fp, "mtime", buf, true);
835 dot_type_date(buf, sizeof(buf), adata->newgroups_time);
836 dot_type_string(fp, "newgroups_time", buf, true);
837 dot_type_date(buf, sizeof(buf), adata->check_time);
838 dot_type_string(fp, "check_time", buf, true);
839
841
842 if (adata->conn)
843 {
844 dot_connection(fp, adata->conn, links);
845 dot_add_link(links, adata, adata->conn, "NntpAccountData->conn", false, NULL);
846 }
847}
void dot_type_file(FILE *fp, const char *name, FILE *struct_fp)
Definition: graphviz.c:189
time_t newgroups_time
Definition: adata.h:57
bool newsrc_modified
Definition: adata.h:50
bool hasXOVER
Server supports XOVER command.
Definition: adata.h:46
struct Connection * conn
Connection to NNTP Server.
Definition: adata.h:63
char * authenticators
Definition: adata.h:53
char * overview_fmt
Definition: adata.h:54
bool hasXGTITLE
Server supports XGTITLE command.
Definition: adata.h:42
unsigned int groups_num
Definition: adata.h:59
bool hasCAPABILITIES
Server supports CAPABILITIES command.
Definition: adata.h:38
bool hasSTARTTLS
Server supports STARTTLS command.
Definition: adata.h:39
bool hasLISTGROUPrange
Server supports LISTGROUPrange command.
Definition: adata.h:44
time_t check_time
Definition: adata.h:58
time_t mtime
Definition: adata.h:56
unsigned int groups_max
Definition: adata.h:60
bool hasLISTGROUP
Server supports LISTGROUP command.
Definition: adata.h:43
FILE * fp_newsrc
Definition: adata.h:51
bool cacheable
Definition: adata.h:49
bool hasOVER
Server supports OVER command.
Definition: adata.h:45
char * newsrc_file
Definition: adata.h:52
bool hasDATE
Server supports DATE command.
Definition: adata.h:40
bool hasLIST_NEWSGROUPS
Server supports LIST_NEWSGROUPS command.
Definition: adata.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_notmuch()

void dot_account_notmuch ( FILE *  fp,
struct NmAccountData adata,
struct ListHead *  links 
)

Definition at line 849 of file graphviz.c.

850{
851 dot_object_header(fp, adata, "NmAccountData", "#60c0c0");
852 dot_ptr(fp, "db", adata->db, NULL);
854}
notmuch_database_t * db
Connection to Notmuch database.
Definition: adata.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_pop()

void dot_account_pop ( FILE *  fp,
struct PopAccountData adata,
struct ListHead *  links 
)

Definition at line 856 of file graphviz.c.

857{
858 char buf[64] = { 0 };
859
860 dot_object_header(fp, adata, "PopAccountData", "#60c0c0");
861
862 dot_type_date(buf, sizeof(buf), adata->check_time);
863 dot_type_string(fp, "check_time", buf, true);
864
865 dot_type_string(fp, "login", adata->conn->account.login, true);
866 dot_type_string(fp, "user", adata->conn->account.user, true);
867 dot_type_string(fp, "pass", adata->conn->account.pass[0] ? "***" : "", true);
868 dot_type_number(fp, "port", adata->conn->account.port);
869 // dot_ptr(fp, "conn", adata->conn, "#ff8080");
871
872 if (adata->conn)
873 {
874 dot_connection(fp, adata->conn, links);
875 dot_add_link(links, adata, adata->conn, "PopAccountData->conn", false, NULL);
876 }
877}
char login[128]
Login name.
Definition: connaccount.h:55
time_t check_time
Definition: adata.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account()

void dot_account ( FILE *  fp,
struct Account a,
struct ListHead *  links 
)

Definition at line 880 of file graphviz.c.

881{
882 dot_object_header(fp, a, "Account", "#80ffff");
883 dot_mailbox_type(fp, "type", a->type);
884 dot_type_string(fp, "name", a->name, true);
885 // dot_ptr(fp, "adata", a->adata, "#60c0c0");
887
888#ifndef GV_HIDE_ADATA
889 if (a->adata)
890 {
891 if (a->type == MUTT_IMAP)
892 dot_account_imap(fp, a->adata, links);
893 else if (a->type == MUTT_POP)
894 dot_account_pop(fp, a->adata, links);
895 else if (a->type == MUTT_MBOX)
896 dot_account_mbox(fp, a->adata, links);
897 else if (a->type == MUTT_NNTP)
898 dot_account_nntp(fp, a->adata, links);
899 else if (a->type == MUTT_NOTMUCH)
900 dot_account_notmuch(fp, a->adata, links);
901
902 dot_add_link(links, a, a->adata, "Account->adata", false, NULL);
903 }
904#endif
905
906#ifndef GV_HIDE_CONFIG
907 if (a->name)
908 {
909 dot_config(fp, a->name, DT_INHERIT_ACC, a->sub, links);
910 dot_add_link(links, a, a->name, "Config", false, NULL);
911
912 char name[256] = { 0 };
913 struct Buffer buf;
914 mutt_buffer_init(&buf);
915
916 mutt_buffer_addstr(&buf, "{ rank=same ");
917
918 dot_ptr_name(name, sizeof(name), a);
919 mutt_buffer_add_printf(&buf, "%s ", name);
920
921 dot_ptr_name(name, sizeof(name), a->name);
922 mutt_buffer_add_printf(&buf, "%s ", name);
923
924 mutt_buffer_addstr(&buf, "}");
925 mutt_list_insert_tail(links, mutt_str_dup(buf.data));
927 }
928#endif
929
930 struct MailboxNode *first = STAILQ_FIRST(&a->mailboxes);
931 dot_add_link(links, a, first, "Account->mailboxes", false, NULL);
932 dot_mailbox_list(fp, &a->mailboxes, links, false);
933}
void dot_account_pop(FILE *fp, struct PopAccountData *adata, struct ListHead *links)
Definition: graphviz.c:856
void dot_account_mbox(FILE *fp, struct MboxAccountData *adata, struct ListHead *links)
Definition: graphviz.c:792
void dot_account_imap(FILE *fp, struct ImapAccountData *adata, struct ListHead *links)
Definition: graphviz.c:770
void dot_account_notmuch(FILE *fp, struct NmAccountData *adata, struct ListHead *links)
Definition: graphviz.c:849
void dot_account_nntp(FILE *fp, struct NntpAccountData *adata, struct ListHead *links)
Definition: graphviz.c:807
void dot_mailbox_list(FILE *fp, struct MailboxList *ml, struct ListHead *links, bool abbr)
Definition: graphviz.c:737
#define STAILQ_FIRST(head)
Definition: queue.h:350
enum MailboxType type
Type of Mailboxes this Account contains.
Definition: account.h:38
char * name
Name of Account.
Definition: account.h:39
struct ConfigSubset * sub
Inherited config items.
Definition: account.h:40
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
struct MailboxList mailboxes
List of Mailboxes.
Definition: account.h:41
#define DT_INHERIT_ACC
Config item can be Account-specific.
Definition: types.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_list()

void dot_account_list ( FILE *  fp,
struct AccountList *  al,
struct ListHead *  links 
)

Definition at line 935 of file graphviz.c.

936{
937 struct Account *prev = NULL;
938 struct Account *np = NULL;
939 TAILQ_FOREACH(np, al, entries)
940 {
941#ifdef GV_HIDE_MBOX
942 if (np->type == MUTT_MBOX)
943 continue;
944#endif
945 dot_account(fp, np, links);
946 if (prev)
947 dot_add_link(links, prev, np, "Account->next", false, NULL);
948
949 prev = np;
950 }
951}
void dot_account(FILE *fp, struct Account *a, struct ListHead *links)
Definition: graphviz.c:880
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
A group of associated Mailboxes.
Definition: account.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mview()

void dot_mview ( FILE *  fp,
struct MailboxView mv,
struct ListHead *  links 
)

Definition at line 954 of file graphviz.c.

955{
956 dot_object_header(fp, mv, "MailboxView", "#ff80ff");
957 dot_ptr(fp, "mailbox", mv->mailbox, "#80ff80");
958#ifdef GV_HIDE_MVIEW_CONTENTS
959 dot_type_number(fp, "vsize", mv->vsize);
960 dot_type_string(fp, "pattern", mv->pattern, true);
961 dot_type_bool(fp, "collapsed", mv->collapsed);
962#endif
964}
bool collapsed
Are all threads collapsed?
Definition: mview.h:47
off_t vsize
Size (in bytes) of the messages shown.
Definition: mview.h:39
struct Mailbox * mailbox
Current Mailbox.
Definition: mview.h:49
char * pattern
Limit pattern string.
Definition: mview.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_graphviz()

void dump_graphviz ( const char *  title,
struct MailboxView mv 
)

Definition at line 967 of file graphviz.c.

968{
969 char name[256] = { 0 };
970 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
971
972 time_t now = time(NULL);
973 if (title)
974 {
975 char date[128];
976 mutt_date_localtime_format(date, sizeof(date), "%T", now);
977 snprintf(name, sizeof(name), "%s-%s.gv", date, title);
978 }
979 else
980 {
981 mutt_date_localtime_format(name, sizeof(name), "%T.gv", now);
982 }
983
984 umask(022);
985 FILE *fp = fopen(name, "w");
986 if (!fp)
987 return;
988
990
991#ifndef GV_HIDE_NEOMUTT
992 dot_node(fp, NeoMutt, "NeoMutt", "#ffa500");
994 "NeoMutt->accounts", false, NULL);
995#ifndef GV_HIDE_CONFIG
996 dot_config(fp, (const char *) NeoMutt->sub, 0, NeoMutt->sub, &links);
997 dot_add_link(&links, NeoMutt, NeoMutt->sub, "NeoMutt Config", false, NULL);
998 struct Buffer buf = mutt_buffer_make(256);
999 char obj1[64] = { 0 };
1000 char obj2[64] = { 0 };
1001 dot_ptr_name(obj1, sizeof(obj1), NeoMutt);
1002 dot_ptr_name(obj2, sizeof(obj2), NeoMutt->sub);
1003 mutt_buffer_printf(&buf, "{ rank=same %s %s }", obj1, obj2);
1005 mutt_buffer_dealloc(&buf);
1006#endif
1007#endif
1008
1009 dot_account_list(fp, &NeoMutt->accounts, &links);
1010
1011#ifndef GV_HIDE_MVIEW
1012 if (mv)
1013 dot_mview(fp, mv, &links);
1014
1015#ifndef GV_HIDE_NEOMUTT
1016 /* Globals */
1017 fprintf(fp, "\t{ rank=same ");
1018 if (mv)
1019 {
1020 dot_ptr_name(name, sizeof(name), mv);
1021 fprintf(fp, "%s ", name);
1022 }
1023 dot_ptr_name(name, sizeof(name), NeoMutt);
1024 fprintf(fp, "%s ", name);
1025 fprintf(fp, "}\n");
1026#endif
1027#endif
1028
1029 fprintf(fp, "\t{ rank=same ");
1030 struct Account *np = NULL;
1031 TAILQ_FOREACH(np, &NeoMutt->accounts, entries)
1032 {
1033#ifdef GV_HIDE_MBOX
1034 if (np->type == MUTT_MBOX)
1035 continue;
1036#endif
1037 dot_ptr_name(name, sizeof(name), np);
1038 fprintf(fp, "%s ", name);
1039 }
1040 fprintf(fp, "}\n");
1041
1042 dot_graph_footer(fp, &links);
1043 fclose(fp);
1044 mutt_list_free(&links);
1045}
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:158
void dot_graph_header(FILE *fp)
Definition: graphviz.c:306
void dot_account_list(FILE *fp, struct AccountList *al, struct ListHead *links)
Definition: graphviz.c:935
void dot_graph_footer(FILE *fp, struct ListHead *links)
Definition: graphviz.c:329
void dot_mview(FILE *fp, struct MailboxView *mv, struct ListHead *links)
Definition: graphviz.c:954
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122
#define STAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:324
#define TAILQ_FIRST(head)
Definition: queue.h:723
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct AccountList accounts
List of all Accounts.
Definition: neomutt.h:40
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_parameter_list()

void dot_parameter_list ( FILE *  fp,
const char *  name,
const struct ParameterList *  pl 
)

Definition at line 1048 of file graphviz.c.

1049{
1050 if (!pl)
1051 return;
1052 if (TAILQ_EMPTY(pl))
1053 return;
1054
1055 dot_object_header(fp, pl, "ParameterList", "#00ff00");
1056
1057 struct Parameter *np = NULL;
1058 TAILQ_FOREACH(np, pl, entries)
1059 {
1060 dot_type_string(fp, np->attribute, np->value, false);
1061 }
1062
1064}
#define TAILQ_EMPTY(head)
Definition: queue.h:721
Attribute associated with a MIME part.
Definition: parameter.h:33
char * attribute
Parameter name.
Definition: parameter.h:34
char * value
Parameter value.
Definition: parameter.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_content()

void dot_content ( FILE *  fp,
struct Content cont,
struct ListHead *  links 
)

Definition at line 1066 of file graphviz.c.

1067{
1068 struct Buffer buf = mutt_buffer_make(256);
1069
1070 dot_object_header(fp, cont, "Content", "#800080");
1071
1072 dot_type_number(fp, "hibin", cont->hibin);
1073 dot_type_number(fp, "lobin", cont->lobin);
1074 dot_type_number(fp, "nulbin", cont->nulbin);
1075 dot_type_number(fp, "crlf", cont->crlf);
1076 dot_type_number(fp, "ascii", cont->ascii);
1077 dot_type_number(fp, "linemax", cont->linemax);
1078
1079#define ADD_BOOL(F) add_flag(&buf, cont->F, #F)
1080 ADD_BOOL(space);
1081 ADD_BOOL(binary);
1082 ADD_BOOL(from);
1083 ADD_BOOL(dot);
1084 ADD_BOOL(cr);
1085#undef ADD_BOOL
1086
1088
1089 mutt_buffer_dealloc(&buf);
1090}
long crlf
\r and \n characters
Definition: content.h:39
long hibin
8-bit characters
Definition: content.h:36
long ascii
Number of ascii chars.
Definition: content.h:40
long nulbin
Null characters (0x0)
Definition: content.h:38
long linemax
Length of the longest line in the file.
Definition: content.h:41
long lobin
Unprintable 7-bit chars (eg., control chars)
Definition: content.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_attach_ptr()

void dot_attach_ptr ( FILE *  fp,
struct AttachPtr aptr,
struct ListHead *  links 
)

Definition at line 1093 of file graphviz.c.

1094{
1095 if (!aptr)
1096 return;
1097
1098 struct Buffer buf = mutt_buffer_make(256);
1099
1100 dot_object_header(fp, aptr, "AttachPtr", "#ff0000");
1101
1102 dot_type_file(fp, "fp", aptr->fp);
1103
1104 dot_type_string(fp, "parent_type", get_content_type(aptr->parent_type), false);
1105
1106 dot_type_number(fp, "level", aptr->level);
1107 dot_type_number(fp, "num", aptr->num);
1108
1109 dot_type_bool(fp, "unowned", aptr->unowned);
1110 dot_type_bool(fp, "collapsed", aptr->collapsed);
1111 dot_type_bool(fp, "decrypted", aptr->decrypted);
1112
1114
1115 dot_add_link(links, aptr->body, aptr, "AttachPtr->body", true, NULL);
1116
1117 mutt_buffer_dealloc(&buf);
1118}
const char * get_content_type(enum ContentType type)
Definition: graphviz.c:81
struct Body * body
Attachment.
Definition: attach.h:36
bool collapsed
Group is collapsed.
Definition: attach.h:44
int num
Attachment index number.
Definition: attach.h:41
int level
Nesting depth of attachment.
Definition: attach.h:40
FILE * fp
Used in the recvattach menu.
Definition: attach.h:37
bool unowned
Don't unlink on detach.
Definition: attach.h:42
bool decrypted
Not part of message as stored in the email->body.
Definition: attach.h:43
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition: attach.h:38
+ Here is the call graph for this function:

◆ dot_body()

void dot_body ( FILE *  fp,
struct Body b,
struct ListHead *  links,
bool  link_next 
)

Definition at line 1120 of file graphviz.c.

1121{
1122 struct Buffer buf = mutt_buffer_make(256);
1123
1124 dot_object_header(fp, b, "Body", "#2020ff");
1125
1126 char file[256];
1127 dot_path_fs(file, sizeof(file), b->filename);
1128 dot_type_string(fp, "file", file, false);
1129
1130 dot_type_string(fp, "charset", b->charset, false);
1131 dot_type_string(fp, "description", b->description, false);
1132 dot_type_string(fp, "d_filename", b->d_filename, false);
1133 dot_type_string(fp, "form_name", b->form_name, false);
1134 dot_type_string(fp, "language", b->language, false);
1135 dot_type_string(fp, "subtype", b->subtype, false);
1136 dot_type_string(fp, "xtype", b->xtype, false);
1137
1138 dot_type_string(fp, "type", get_content_type(b->type), true);
1139 dot_type_string(fp, "encoding", get_content_encoding(b->encoding), true);
1140 dot_type_string(fp, "disposition", get_content_disposition(b->disposition), true);
1141
1142 if (b->stamp != 0)
1143 {
1144 char arr[64];
1145 dot_type_date(arr, sizeof(arr), b->stamp);
1146 dot_type_string(fp, "stamp", arr, true);
1147 }
1148
1149#define ADD_BOOL(F) add_flag(&buf, b->F, #F)
1150 ADD_BOOL(attach_qualifies);
1151 ADD_BOOL(badsig);
1152 ADD_BOOL(deleted);
1153 ADD_BOOL(force_charset);
1154 ADD_BOOL(goodsig);
1155#ifdef USE_AUTOCRYPT
1156 ADD_BOOL(is_autocrypt);
1157#endif
1158 ADD_BOOL(noconv);
1159 ADD_BOOL(tagged);
1160 ADD_BOOL(unlink);
1161 ADD_BOOL(use_disp);
1162 ADD_BOOL(warnsig);
1163#undef ADD_BOOL
1164 dot_type_string(fp, "bools",
1165 mutt_buffer_is_empty(&buf) ? "[NONE]" : mutt_buffer_string(&buf), true);
1166
1167 dot_type_number(fp, "attach_count", b->attach_count);
1168 dot_type_number(fp, "hdr_offset", b->hdr_offset);
1169 dot_type_number(fp, "length", b->length);
1170 dot_type_number(fp, "offset", b->offset);
1171
1172 dot_ptr(fp, "aptr", b->aptr, "#3bcbc4");
1173
1174#ifdef GV_HIDE_BODY_CONTENT
1175 if (!TAILQ_EMPTY(&b->parameter))
1176 {
1177 struct Parameter *param = TAILQ_FIRST(&b->parameter);
1178 if (mutt_str_equal(param->attribute, "boundary"))
1179 {
1180 dot_type_string(fp, "boundary", param->value, false);
1181 }
1182 }
1183#endif
1184
1186
1187#ifndef GV_HIDE_BODY_CONTENT
1188 if (!TAILQ_EMPTY(&b->parameter))
1189 {
1190 dot_parameter_list(fp, "parameter", &b->parameter);
1191 dot_add_link(links, b, &b->parameter, "Body->mime_headers", false, NULL);
1192 }
1193#endif
1194
1195#ifndef GV_HIDE_ENVELOPE
1196 if (b->mime_headers)
1197 {
1198 dot_envelope(fp, b->mime_headers, links);
1199 dot_add_link(links, b, b->mime_headers, "Body->mime_headers", false, NULL);
1200 }
1201#endif
1202
1203 if (b->email)
1204 {
1205 dot_email(fp, b->email, links);
1206 dot_add_link(links, b, b->email, "Body->email", false, NULL);
1207 }
1208
1209 if (b->parts)
1210 {
1211 if (!b->email)
1212 dot_body(fp, b->parts, links, true);
1213 dot_add_link(links, b, b->parts, "Body->parts", false, "#ff0000");
1214 }
1215
1216 if (b->next && link_next)
1217 {
1218 char name[256] = { 0 };
1219 mutt_buffer_reset(&buf);
1220
1221 mutt_buffer_addstr(&buf, "{ rank=same ");
1222
1223 dot_ptr_name(name, sizeof(name), b);
1224 mutt_buffer_add_printf(&buf, "%s ", name);
1225
1226 for (; b->next; b = b->next)
1227 {
1228 dot_body(fp, b->next, links, false);
1229 dot_add_link(links, b, b->next, "Body->next", false, "#008000");
1230
1231 dot_ptr_name(name, sizeof(name), b->next);
1232 mutt_buffer_add_printf(&buf, "%s ", name);
1233 }
1234
1235 mutt_buffer_addstr(&buf, "}");
1237 }
1238 else
1239 {
1240#ifndef GV_HIDE_BODY_CONTENT
1241 if (b->content)
1242 {
1243 dot_content(fp, b->content, links);
1244 dot_add_link(links, b, b->content, "Body->content", false, NULL);
1245 }
1246#endif
1247
1248 // if (b->aptr)
1249 // {
1250 // dot_attach_ptr(fp, b->aptr, links);
1251 // dot_add_link(links, b, b->aptr, "Body->aptr", false, NULL);
1252 // }
1253 }
1254
1255 mutt_buffer_dealloc(&buf);
1256}
void dot_parameter_list(FILE *fp, const char *name, const struct ParameterList *pl)
Definition: graphviz.c:1048
void dot_email(FILE *fp, struct Email *e, struct ListHead *links)
Definition: graphviz.c:1355
void dot_content(FILE *fp, struct Content *cont, struct ListHead *links)
Definition: graphviz.c:1066
const char * get_content_encoding(enum ContentEncoding enc)
Definition: graphviz.c:110
const char * get_content_disposition(enum ContentDisposition disp)
Definition: graphviz.c:133
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:784
char * language
content-language (RFC8255)
Definition: body.h:77
char * d_filename
filename to be used for the content-disposition header If NULL, filename is used instead.
Definition: body.h:56
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:72
LOFF_T offset
offset where the actual data begins
Definition: body.h:52
signed short attach_count
Number of attachments.
Definition: body.h:90
char * xtype
content-type if x-unknown
Definition: body.h:61
time_t stamp
Time stamp of last encoding update.
Definition: body.h:76
struct Envelope * mime_headers
Memory hole protected headers.
Definition: body.h:75
LOFF_T length
length (in bytes) of attachment
Definition: body.h:53
char * charset
Send mode: charset of attached file as stored on disk.
Definition: body.h:78
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:62
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition: body.h:74
struct Email * email
header information for message/rfc822
Definition: body.h:73
char * description
content-description
Definition: body.h:55
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:42
struct Content * content
Detailed info about the content of the attachment.
Definition: body.h:69
struct Body * next
next attachment in the list
Definition: body.h:71
char * subtype
content-type subtype
Definition: body.h:60
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition: body.h:41
long hdr_offset
Offset in stream where the headers begin.
Definition: body.h:80
char * form_name
Content-Disposition form-data name param.
Definition: body.h:59
unsigned int type
content-type primary type, ContentType
Definition: body.h:40
char * filename
When sending a message, this is the file to which this structure refers.
Definition: body.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_list_head()

void dot_list_head ( FILE *  fp,
const char *  name,
const struct ListHead *  list 
)

Definition at line 1259 of file graphviz.c.

1260{
1261 if (!list || !name)
1262 return;
1263 if (STAILQ_EMPTY(list))
1264 return;
1265
1266 struct Buffer buf = mutt_buffer_make(256);
1267
1268 struct ListNode *np = NULL;
1269 STAILQ_FOREACH(np, list, entries)
1270 {
1271 if (!mutt_buffer_is_empty(&buf))
1272 mutt_buffer_addch(&buf, ',');
1273 mutt_buffer_addstr(&buf, np->data);
1274 }
1275
1276 dot_type_string(fp, name, mutt_buffer_string(&buf), false);
1277}
#define STAILQ_EMPTY(head)
Definition: queue.h:348
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_addr_list()

void dot_addr_list ( FILE *  fp,
const char *  name,
const struct AddressList *  al,
struct ListHead *  links 
)

Definition at line 1279 of file graphviz.c.

1281{
1282 if (!al)
1283 return;
1284 if (TAILQ_EMPTY(al))
1285 return;
1286
1287 char buf[1024] = { 0 };
1288
1289 mutt_addrlist_write(al, buf, sizeof(buf), true);
1290 dot_type_string(fp, name, buf, false);
1291}
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
Definition: address.c:1150
+ Here is the call graph for this function:

◆ dump_graphviz_body()

void dump_graphviz_body ( struct Body b)

Definition at line 1476 of file graphviz.c.

1477{
1478 char name[256] = { 0 };
1479 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1480
1481 time_t now = time(NULL);
1482 mutt_date_localtime_format(name, sizeof(name), "%T-email.gv", now);
1483
1484 umask(022);
1485 FILE *fp = fopen(name, "w");
1486 if (!fp)
1487 return;
1488
1489 dot_graph_header(fp);
1490
1491 dot_body(fp, b, &links, true);
1492
1493 dot_graph_footer(fp, &links);
1494 fclose(fp);
1495 mutt_list_free(&links);
1496}
+ Here is the call graph for this function:

◆ dump_graphviz_email()

void dump_graphviz_email ( struct Email e)

Definition at line 1498 of file graphviz.c.

1499{
1500 char name[256] = { 0 };
1501 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1502
1503 time_t now = time(NULL);
1504 mutt_date_localtime_format(name, sizeof(name), "%T-email.gv", now);
1505
1506 umask(022);
1507 FILE *fp = fopen(name, "w");
1508 if (!fp)
1509 return;
1510
1511 dot_graph_header(fp);
1512
1513 dot_email(fp, e, &links);
1514
1515 dot_graph_footer(fp, &links);
1516 fclose(fp);
1517 mutt_list_free(&links);
1518}
+ Here is the call graph for this function:

◆ dot_attach_ptr2()

void dot_attach_ptr2 ( FILE *  fp,
struct AttachPtr aptr,
struct ListHead *  links 
)

Definition at line 1520 of file graphviz.c.

1521{
1522 if (!aptr)
1523 return;
1524
1525 struct Buffer buf = mutt_buffer_make(256);
1526
1527 dot_object_header(fp, aptr, "AttachPtr", "#3bcbc4");
1528
1529 dot_ptr(fp, "body", aptr->body, "#2020ff");
1530 dot_type_file(fp, "fp", aptr->fp);
1531
1532 dot_type_string(fp, "parent_type", get_content_type(aptr->parent_type), false);
1533 dot_type_number(fp, "level", aptr->level);
1534 dot_type_number(fp, "num", aptr->num);
1535 dot_type_bool(fp, "unowned", aptr->unowned);
1536 dot_type_bool(fp, "collapsed", aptr->collapsed);
1537 dot_type_bool(fp, "decrypted", aptr->decrypted);
1538
1539 // dot_type_string(fp, "tree", aptr->tree, false);
1540
1542
1543 mutt_buffer_dealloc(&buf);
1544}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_array_actx_idx()

void dot_array_actx_idx ( FILE *  fp,
struct AttachPtr **  idx,
short  idxlen,
short  idxmax,
struct ListHead *  links 
)

Definition at line 1546 of file graphviz.c.

1548{
1549 dot_object_header(fp, idx, "AttachCtx-&gt;idx", "#9347de");
1550
1551 dot_type_number(fp, "idxlen", idxlen);
1552 dot_type_number(fp, "idxmax", idxmax);
1553
1554 char arr[32];
1555 for (size_t i = 0; i < idxmax; i++)
1556 {
1557 snprintf(arr, sizeof(arr), "idx[%ld]", i);
1558 dot_ptr(fp, arr, idx[i], "#3bcbc4");
1559 }
1560
1562
1563 for (size_t i = 0; i < idxlen; i++)
1564 {
1565 dot_attach_ptr2(fp, idx[i], links);
1566 dot_add_link(links, idx, idx[i], "AttachCtx-&gt;idx", false, NULL);
1567 }
1568}
void dot_attach_ptr2(FILE *fp, struct AttachPtr *aptr, struct ListHead *links)
Definition: graphviz.c:1520
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_array_actx_v2r()

void dot_array_actx_v2r ( FILE *  fp,
short *  v2r,
short  vcount,
struct ListHead *  links 
)

Definition at line 1570 of file graphviz.c.

1571{
1572 dot_object_header(fp, v2r, "AttachCtx-&gt;v2r", "#9347de");
1573
1574 dot_type_number(fp, "vcount", vcount);
1575
1576 char arr[32];
1577 for (size_t i = 0; i < vcount; i++)
1578 {
1579 snprintf(arr, sizeof(arr), "v2r[%ld]", i);
1580 dot_type_number(fp, arr, v2r[i]);
1581 }
1582
1584}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_array_actx_fp_idx()

void dot_array_actx_fp_idx ( FILE *  fp,
FILE **  fp_idx,
short  fp_len,
short  fp_max,
struct ListHead *  links 
)

Definition at line 1586 of file graphviz.c.

1588{
1589 dot_object_header(fp, fp_idx, "AttachCtx-&gt;fp_idx", "#f86e28");
1590
1591 dot_type_number(fp, "fp_len", fp_len);
1592 dot_type_number(fp, "fp_max", fp_max);
1593
1594 char arr[32];
1595 for (size_t i = 0; i < fp_max; i++)
1596 {
1597 snprintf(arr, sizeof(arr), "fp_idx[%ld]", i);
1598 dot_type_file(fp, arr, fp_idx[i]);
1599 }
1600
1602}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_array_actx_body_idx()

void dot_array_actx_body_idx ( FILE *  fp,
struct Body **  body_idx,
short  body_len,
short  body_max,
struct ListHead *  links 
)

Definition at line 1604 of file graphviz.c.

1606{
1607 dot_object_header(fp, body_idx, "AttachCtx-&gt;body_idx", "#4ff270");
1608
1609 dot_type_number(fp, "body_len", body_len);
1610 dot_type_number(fp, "body_max", body_max);
1611
1612 char arr[32];
1613 for (size_t i = 0; i < body_max; i++)
1614 {
1615 snprintf(arr, sizeof(arr), "body_idx[%ld]", i);
1616 dot_ptr(fp, arr, body_idx[i], "#2020ff");
1617 }
1618
1620
1621 for (size_t i = 0; i < body_max; i++)
1622 {
1623 if (!body_idx[i])
1624 continue;
1625 dot_body(fp, body_idx[i], links, true);
1626 dot_add_link(links, body_idx, body_idx[i], "AttachCtx->Body", false, "#008000");
1627 }
1628}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_attach_ctx()

void dot_attach_ctx ( FILE *  fp,
struct AttachCtx actx,
struct ListHead *  links 
)

Definition at line 1630 of file graphviz.c.

1631{
1632 struct Buffer buf = mutt_buffer_make(256);
1633 // char arr[256];
1634
1635 dot_object_header(fp, actx, "AttachCtx", "#9347de");
1636
1637 dot_ptr(fp, "email", actx->email, "#ff80ff");
1638 dot_type_file(fp, "fp_root", actx->fp_root);
1639
1641
1642 if (actx->idx)
1643 {
1644 dot_array_actx_idx(fp, actx->idx, actx->idxlen, actx->idxmax, links);
1645 dot_add_link(links, actx, actx->idx, "AttachCtx-&gt;idx", false, NULL);
1646 }
1647
1648 if (actx->v2r)
1649 {
1650 dot_array_actx_v2r(fp, actx->v2r, actx->vcount, links);
1651 dot_add_link(links, actx, actx->v2r, "AttachCtx-&gt;v2r", false, NULL);
1652 }
1653
1654 if (actx->fp_idx)
1655 {
1656 dot_array_actx_fp_idx(fp, actx->fp_idx, actx->fp_len, actx->fp_max, links);
1657 dot_add_link(links, actx, actx->fp_idx, "AttachCtx-&gt;fp_idx", false, NULL);
1658 }
1659
1660 if (actx->body_idx)
1661 {
1662 dot_array_actx_body_idx(fp, actx->body_idx, actx->body_len, actx->body_max, links);
1663 dot_add_link(links, actx, actx->body_idx, "AttachCtx-&gt;body_idx", false, NULL);
1664 }
1665
1666 mutt_buffer_dealloc(&buf);
1667}
void dot_array_actx_idx(FILE *fp, struct AttachPtr **idx, short idxlen, short idxmax, struct ListHead *links)
Definition: graphviz.c:1546
void dot_array_actx_v2r(FILE *fp, short *v2r, short vcount, struct ListHead *links)
Definition: graphviz.c:1570
void dot_array_actx_body_idx(FILE *fp, struct Body **body_idx, short body_len, short body_max, struct ListHead *links)
Definition: graphviz.c:1604
void dot_array_actx_fp_idx(FILE *fp, FILE **fp_idx, short fp_len, short fp_max, struct ListHead *links)
Definition: graphviz.c:1586
short vcount
The number of virtual attachments.
Definition: attach.h:60
short body_len
Number of Body parts.
Definition: attach.h:67
FILE * fp_root
Used by recvattach for updating.
Definition: attach.h:53
short fp_max
Size of FILE array.
Definition: attach.h:64
struct Email * email
Used by recvattach for updating.
Definition: attach.h:52
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:55
struct Body ** body_idx
Extra struct Body* used for decryption.
Definition: attach.h:66
short fp_len
Number of FILE handles.
Definition: attach.h:63
short body_max
Size of Body array.
Definition: attach.h:68
FILE ** fp_idx
Extra FILE* used for decryption.
Definition: attach.h:62
short idxmax
Size of attachment array.
Definition: attach.h:57
short idxlen
Number of attachmentes.
Definition: attach.h:56
short * v2r
Mapping from virtual to real attachment.
Definition: attach.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_graphviz_attach_ctx()

void dump_graphviz_attach_ctx ( struct AttachCtx actx)

Definition at line 1669 of file graphviz.c.

1670{
1671 char name[256] = { 0 };
1672 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1673
1674 time_t now = time(NULL);
1675 mutt_date_localtime_format(name, sizeof(name), "%T-actx.gv", now);
1676
1677 umask(022);
1678 FILE *fp = fopen(name, "w");
1679 if (!fp)
1680 return;
1681
1682 dot_graph_header(fp);
1683
1684 dot_attach_ctx(fp, actx, &links);
1685
1686 dot_graph_footer(fp, &links);
1687 fclose(fp);
1688 mutt_list_free(&links);
1689}
void dot_attach_ctx(FILE *fp, struct AttachCtx *actx, struct ListHead *links)
Definition: graphviz.c:1630
+ Here is the call graph for this function:

◆ pattern_type_name()

const char * pattern_type_name ( int  type)

Definition at line 1691 of file graphviz.c.

1692{
1693 static struct Mapping PatternNames[] = {
1694 // clang-format off
1695 { "address", MUTT_PAT_ADDRESS },
1696 { "AND", MUTT_PAT_AND },
1697 { "body", MUTT_PAT_BODY },
1698 { "broken", MUTT_PAT_BROKEN },
1699 { "cc", MUTT_PAT_CC },
1700 { "children", MUTT_PAT_CHILDREN },
1701 { "collapsed", MUTT_PAT_COLLAPSED },
1702 { "crypt_encrypt", MUTT_PAT_CRYPT_ENCRYPT },
1703 { "crypt_sign", MUTT_PAT_CRYPT_SIGN },
1704 { "crypt_verified", MUTT_PAT_CRYPT_VERIFIED },
1705 { "date", MUTT_PAT_DATE },
1706 { "date_received", MUTT_PAT_DATE_RECEIVED },
1707 { "driver_tags", MUTT_PAT_DRIVER_TAGS },
1708 { "duplicated", MUTT_PAT_DUPLICATED },
1709 { "from", MUTT_PAT_FROM },
1710 { "header", MUTT_PAT_HEADER },
1711 { "hormel", MUTT_PAT_HORMEL },
1712 { "id", MUTT_PAT_ID },
1713 { "id_external", MUTT_PAT_ID_EXTERNAL },
1714 { "list", MUTT_PAT_LIST },
1715 { "message", MUTT_PAT_MESSAGE },
1716 { "mimeattach", MUTT_PAT_MIMEATTACH },
1717 { "mimetype", MUTT_PAT_MIMETYPE },
1718 { "newsgroups", MUTT_PAT_NEWSGROUPS },
1719 { "OR", MUTT_PAT_OR },
1720 { "parent", MUTT_PAT_PARENT },
1721 { "personal_from", MUTT_PAT_PERSONAL_FROM },
1722 { "personal_recip", MUTT_PAT_PERSONAL_RECIP },
1723 { "pgp_key", MUTT_PAT_PGP_KEY },
1724 { "recipient", MUTT_PAT_RECIPIENT },
1725 { "reference", MUTT_PAT_REFERENCE },
1726 { "score", MUTT_PAT_SCORE },
1727 { "sender", MUTT_PAT_SENDER },
1728 { "serversearch", MUTT_PAT_SERVERSEARCH },
1729 { "size", MUTT_PAT_SIZE },
1730 { "subject", MUTT_PAT_SUBJECT },
1731 { "subscribed_list", MUTT_PAT_SUBSCRIBED_LIST },
1732 { "thread", MUTT_PAT_THREAD },
1733 { "to", MUTT_PAT_TO },
1734 { "unreferenced", MUTT_PAT_UNREFERENCED },
1735 { "whole_msg", MUTT_PAT_WHOLE_MSG },
1736 { "xlabel", MUTT_PAT_XLABEL },
1737 { NULL, 0 },
1738 // clang-format on
1739 };
1740
1741 return mutt_map_get_name(type, PatternNames);
1742}
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition: mapping.c:42
@ MUTT_PAT_HEADER
Pattern matches email's header.
Definition: lib.h:148
@ MUTT_PAT_WHOLE_MSG
Pattern matches raw email text.
Definition: lib.h:150
@ MUTT_PAT_BROKEN
Message is part of a broken thread.
Definition: lib.h:144
@ MUTT_PAT_ID_EXTERNAL
Message-Id is among results from an external query.
Definition: lib.h:146
@ MUTT_PAT_OR
Either pattern can match.
Definition: lib.h:131
@ MUTT_PAT_CHILDREN
Pattern matches a child email.
Definition: lib.h:134
@ MUTT_PAT_PARENT
Pattern matches parent.
Definition: lib.h:133
@ MUTT_PAT_REFERENCE
Pattern matches 'References:' or 'In-Reply-To:' field.
Definition: lib.h:155
@ MUTT_PAT_FROM
Pattern matches 'From:' field.
Definition: lib.h:139
@ MUTT_PAT_DRIVER_TAGS
Pattern matches message tags.
Definition: lib.h:168
@ MUTT_PAT_COLLAPSED
Thread is collapsed.
Definition: lib.h:137
@ MUTT_PAT_CRYPT_VERIFIED
Message is crypographically verified.
Definition: lib.h:163
@ MUTT_PAT_HORMEL
Pattern matches email's spam score.
Definition: lib.h:149
@ MUTT_PAT_SUBJECT
Pattern matches 'Subject:' field.
Definition: lib.h:138
@ MUTT_PAT_LIST
Email is on mailing list.
Definition: lib.h:157
@ MUTT_PAT_NEWSGROUPS
Pattern matches newsgroup.
Definition: lib.h:172
@ MUTT_PAT_PERSONAL_RECIP
Email is addressed to the user.
Definition: lib.h:159
@ MUTT_PAT_CC
Pattern matches 'Cc:' field.
Definition: lib.h:136
@ MUTT_PAT_SUBSCRIBED_LIST
Email is on subscribed mailing list.
Definition: lib.h:158
@ MUTT_PAT_SERVERSEARCH
Server-side pattern matches.
Definition: lib.h:167
@ MUTT_PAT_RECIPIENT
User is a recipient of the email.
Definition: lib.h:156
@ MUTT_PAT_CRYPT_ENCRYPT
Message is encrypted.
Definition: lib.h:164
@ MUTT_PAT_UNREFERENCED
Message is unreferenced in the thread.
Definition: lib.h:143
@ MUTT_PAT_CRYPT_SIGN
Message is signed.
Definition: lib.h:162
@ MUTT_PAT_MESSAGE
Pattern matches message number.
Definition: lib.h:152
@ MUTT_PAT_AND
Both patterns must match.
Definition: lib.h:130
@ MUTT_PAT_DATE
Pattern matches 'Date:' field.
Definition: lib.h:140
@ MUTT_PAT_XLABEL
Pattern matches keyword/label.
Definition: lib.h:166
@ MUTT_PAT_SCORE
Pattern matches email's score.
Definition: lib.h:153
@ MUTT_PAT_MIMEATTACH
Pattern matches number of attachments.
Definition: lib.h:169
@ MUTT_PAT_DUPLICATED
Duplicate message.
Definition: lib.h:142
@ MUTT_PAT_PERSONAL_FROM
Email is from the user.
Definition: lib.h:160
@ MUTT_PAT_TO
Pattern matches 'To:' field.
Definition: lib.h:135
@ MUTT_PAT_SENDER
Pattern matches sender.
Definition: lib.h:151
@ MUTT_PAT_DATE_RECEIVED
Pattern matches date received.
Definition: lib.h:141
@ MUTT_PAT_ADDRESS
Pattern matches any address field.
Definition: lib.h:161
@ MUTT_PAT_MIMETYPE
Pattern matches MIME type.
Definition: lib.h:170
@ MUTT_PAT_PGP_KEY
Message has PGP key.
Definition: lib.h:165
@ MUTT_PAT_ID
Pattern matches email's Message-Id.
Definition: lib.h:145
@ MUTT_PAT_THREAD
Pattern matches email thread.
Definition: lib.h:132
@ MUTT_PAT_SIZE
Pattern matches email's size.
Definition: lib.h:154
@ MUTT_PAT_BODY
Pattern matches email's body.
Definition: lib.h:147
Mapping between user-readable string and a constant.
Definition: mapping.h:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_pattern()

void dot_pattern ( FILE *  fp,
struct Pattern pat,
struct ListHead *  links 
)

Definition at line 1744 of file graphviz.c.

1745{
1746 struct Buffer buf = mutt_buffer_make(256);
1747 dot_object_header(fp, pat, "Pattern", "#c040c0");
1748
1749 dot_type_string(fp, "op", pattern_type_name(pat->op), true);
1750 if ((pat->min != 0) || (pat->max != 0))
1751 {
1752 dot_type_number(fp, "min", pat->min);
1753 dot_type_number(fp, "max", pat->max);
1754 }
1755
1756#define ADD_BOOL(F) add_flag(&buf, pat->F, #F)
1757 ADD_BOOL(pat_not);
1758 ADD_BOOL(all_addr);
1759 ADD_BOOL(string_match);
1760 ADD_BOOL(group_match);
1761 ADD_BOOL(ign_case);
1762 ADD_BOOL(is_alias);
1763 ADD_BOOL(dynamic);
1764 ADD_BOOL(sendmode);
1765 ADD_BOOL(is_multi);
1766#undef ADD_BOOL
1767 dot_type_string(fp, "flags",
1768 mutt_buffer_is_empty(&buf) ? "[NONE]" : mutt_buffer_string(&buf), true);
1769
1770 if (pat->group_match)
1771 {
1772 // struct Group *group; ///< Address group if group_match is set
1773 }
1774 else if (pat->string_match)
1775 {
1776 dot_type_string(fp, "str", pat->p.str, true);
1777 }
1778 else if (pat->is_multi)
1779 {
1780 // struct ListHead multi_cases; ///< Multiple strings for ~I pattern
1781 }
1782 else
1783 {
1784 if (pat->p.regex)
1785 {
1786 dot_ptr(fp, "regex", pat->p.regex, NULL);
1787 dot_type_string(fp, "pattern", pat->raw_pattern, true);
1788 }
1789 }
1790
1792
1793 if (pat->child)
1794 {
1795 dot_patternlist(fp, pat->child, links);
1796 struct Pattern *first = SLIST_FIRST(pat->child);
1797 dot_add_link(links, pat, first, "Patern->child", false, "#00ff00");
1798 }
1799 mutt_buffer_dealloc(&buf);
1800}
void dot_patternlist(FILE *fp, struct PatternList *pl, struct ListHead *links)
Definition: graphviz.c:1802
const char * pattern_type_name(int type)
Definition: graphviz.c:1691
#define SLIST_FIRST(head)
Definition: queue.h:229
bool group_match
Check a group of Addresses.
Definition: lib.h:75
union Pattern::@1 p
int max
Maximum for range checks.
Definition: lib.h:82
struct PatternList * child
Arguments to logical operation.
Definition: lib.h:83
bool string_match
Check a string for a match.
Definition: lib.h:74
regex_t * regex
Compiled regex, for non-pattern matching.
Definition: lib.h:85
char * str
String, if string_match is set.
Definition: lib.h:87
short op
Operation, e.g. MUTT_PAT_SCORE.
Definition: lib.h:71
bool is_multi
Multiple case (only for ~I pattern now)
Definition: lib.h:80
int min
Minimum for range checks.
Definition: lib.h:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_graphviz_patternlist()

void dump_graphviz_patternlist ( struct PatternList *  pl)

Definition at line 1829 of file graphviz.c.

1830{
1831 char name[256] = { 0 };
1832 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1833
1834 time_t now = time(NULL);
1835 mutt_date_localtime_format(name, sizeof(name), "%T-pattern.gv", now);
1836
1837 umask(022);
1838 FILE *fp = fopen(name, "w");
1839 if (!fp)
1840 return;
1841
1842 dot_graph_header(fp);
1843
1844 dot_patternlist(fp, pl, &links);
1845
1846 dot_graph_footer(fp, &links);
1847 fclose(fp);
1848 mutt_list_free(&links);
1849}
+ Here is the call graph for this function: