NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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 "gui/lib.h"
#include "lib.h"
#include "attach/lib.h"
#include "compmbox/lib.h"
#include "expando/lib.h"
#include "imap/lib.h"
#include "maildir/lib.h"
#include "mbox/lib.h"
#include "ncrypt/lib.h"
#include "nntp/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 "nntp/adata.h"
#include "nntp/mdata.h"
#include "pop/adata.h"
#include "pop/private.h"
#include "notmuch/lib.h"
#include "notmuch/adata.h"
#include "notmuch/mdata.h"
#include "notmuch/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)
 
#define ADD_BOOL(F)
 
#define ADD_FLAG(F)
 
#define ADDR_LIST(AL)
 
#define ADD_BOOL(F)
 
#define ADD_BOOL(F)
 
#define ADD_BOOL(F)
 

Functions

void dot_email (FILE *fp, const struct Email *e, struct ListHead *links)
 
void dot_envelope (FILE *fp, const struct Envelope *env, struct ListHead *links)
 
void dot_patternlist (FILE *fp, const struct PatternList *pl, struct ListHead *links)
 
void dot_expando_node (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_type_bool (FILE *fp, const char *name, bool val)
 Write a boolean type field to GraphViz output.
 
void dot_type_char (FILE *fp, const char *name, char ch)
 Write a character type field to GraphViz output.
 
void dot_type_date (char *buf, size_t buflen, time_t timestamp)
 Format a timestamp for GraphViz output.
 
void dot_type_file (FILE *fp, const char *name, FILE *struct_fp)
 Write a file pointer field to GraphViz output.
 
void dot_type_number (FILE *fp, const char *name, int num)
 Write a number type field to GraphViz output.
 
void dot_type_string_escape (struct Buffer *buf)
 Escape special characters in a string for GraphViz.
 
void dot_type_string (FILE *fp, const char *name, const char *str, bool force)
 Write a string type field to GraphViz output.
 
void dot_type_umask (char *buf, size_t buflen, int umask)
 Format a file mode as octal string.
 
void dot_ptr_name (char *buf, size_t buflen, const void *ptr)
 Generate GraphViz object name from pointer.
 
void dot_ptr (FILE *fp, const char *name, void *ptr, const char *colour)
 Write a pointer field to GraphViz output.
 
void dot_add_link (struct ListHead *links, const void *src, const void *dst, const char *label, const char *short_label, bool back, const char *colour)
 Add a link between two objects in GraphViz.
 
void dot_graph_header (FILE *fp)
 Write GraphViz graph header.
 
void dot_graph_footer (FILE *fp, struct ListHead *links)
 Write GraphViz graph footer with links.
 
void dot_object_header (FILE *fp, const void *ptr, const char *name, const char *colour)
 Write GraphViz object header.
 
void dot_object_footer (FILE *fp)
 Write GraphViz object footer.
 
void dot_node (FILE *fp, void *ptr, const char *name, const char *colour)
 Write a simple GraphViz node.
 
void dot_path_fs (char *buf, size_t buflen, const char *path)
 Extract filesystem path from full path.
 
void dot_path_imap (char *buf, size_t buflen, const char *path)
 Extract IMAP path from full 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)
 Write a mailbox type field to GraphViz output.
 
void dot_mailbox_imap (FILE *fp, struct ImapMboxData *mdata, struct ListHead *links)
 Dump IMAP mailbox metadata.
 
void dot_mailbox_maildir (FILE *fp, struct MaildirMboxData *mdata, struct ListHead *links)
 Dump Maildir mailbox metadata.
 
void dot_mailbox_mbox (FILE *fp, struct MboxAccountData *mdata, struct ListHead *links)
 Dump Mbox mailbox metadata.
 
void dot_mailbox_nntp (FILE *fp, struct NntpMboxData *mdata, struct ListHead *links)
 Dump NNTP mailbox metadata.
 
void dot_mailbox_notmuch (FILE *fp, struct NmMboxData *mdata, struct ListHead *links)
 Dump Notmuch mailbox metadata.
 
void dot_mailbox_pop (FILE *fp, struct PopAccountData *adata, struct ListHead *links)
 Dump POP mailbox metadata.
 
void dot_mailbox (FILE *fp, struct Mailbox *m, struct ListHead *links)
 Dump a mailbox object.
 
void dot_mailbox_array (FILE *fp, struct MailboxArray *ma, struct ListHead *links)
 Dump an array of mailboxes.
 
void dot_connection (FILE *fp, struct Connection *c, struct ListHead *links)
 Dump a connection.
 
void dot_account_imap (FILE *fp, struct ImapAccountData *adata, struct ListHead *links)
 Dump IMAP account data.
 
void dot_account_mbox (FILE *fp, struct MboxAccountData *adata, struct ListHead *links)
 Dump Mbox account data.
 
void dot_account_nntp (FILE *fp, struct NntpAccountData *adata, struct ListHead *links)
 Dump NNTP account data.
 
void dot_account_notmuch (FILE *fp, struct NmAccountData *adata, struct ListHead *links)
 Dump Notmuch account data.
 
void dot_account_pop (FILE *fp, struct PopAccountData *adata, struct ListHead *links)
 Dump POP account data.
 
void dot_account (FILE *fp, struct Account *a, struct ListHead *links)
 Dump an account object.
 
void dot_account_array (FILE *fp, struct AccountArray *aa, struct ListHead *links)
 Dump an array of accounts.
 
void dot_mview (FILE *fp, const struct MailboxView *mv, struct ListHead *links)
 Dump a mailbox view.
 
void dump_graphviz (const char *title, const struct MailboxView *mv)
 Dump NeoMutt data structures to GraphViz format.
 
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, const 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 (const struct Body *b)
 
void dump_graphviz_email (const struct Email *e, const char *title)
 
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, const struct AttachCtx *actx, struct ListHead *links)
 
void dump_graphviz_attach_ctx (const 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)
 
void dot_format (FILE *fp, struct ExpandoFormat *fmt)
 
void dot_expando_node_empty (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_text (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_pad (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_condition (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_conditional_bool (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_conditional_date (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_container (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_expando (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dot_expando_node_unknown (FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
 
void dump_graphviz_expando_node (const struct ExpandoNode *node)
 

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 70 of file graphviz.c.

◆ ADD_BOOL [1/5]

#define ADD_BOOL ( F)
Value:
add_flag(buf, cont->F, #F)
void add_flag(struct Buffer *buf, bool is_set, const char *name)
Add a flag name to a buffer if set.
Definition common.c:40

◆ ADD_BOOL [2/5]

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

◆ ADD_FLAG

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

◆ ADDR_LIST

#define ADDR_LIST ( AL)
Value:
dot_addr_list(fp, #AL, &env->AL, links)
void dot_addr_list(FILE *fp, const char *name, const struct AddressList *al, struct ListHead *links)
Definition graphviz.c:1386

◆ ADD_BOOL [3/5]

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

◆ ADD_BOOL [4/5]

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

◆ ADD_BOOL [5/5]

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

Function Documentation

◆ dot_email()

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

Helper to add an email boolean flag to graphviz output

Helper to add an email security flag to graphviz output

Definition at line 1463 of file graphviz.c.

1464{
1465 struct Buffer *buf = buf_pool_get();
1466 char arr[256];
1467
1468 dot_object_header(fp, e, "Email", "#ff80ff");
1469
1470 dot_type_string(fp, "path", e->path, true);
1471
1473#define ADD_BOOL(F) add_flag(buf, e->F, #F)
1474 ADD_BOOL(active);
1475 ADD_BOOL(attach_del);
1476 ADD_BOOL(attach_valid);
1477 ADD_BOOL(changed);
1478 ADD_BOOL(collapsed);
1479 ADD_BOOL(deleted);
1480 ADD_BOOL(display_subject);
1481 ADD_BOOL(expired);
1482 ADD_BOOL(flagged);
1483 ADD_BOOL(matched);
1484 ADD_BOOL(mime);
1485 ADD_BOOL(old);
1486 ADD_BOOL(purge);
1487 ADD_BOOL(quasi_deleted);
1488 ADD_BOOL(read);
1489 ADD_BOOL(recip_valid);
1490 ADD_BOOL(replied);
1491 ADD_BOOL(searched);
1492 ADD_BOOL(subject_changed);
1493 ADD_BOOL(superseded);
1494 ADD_BOOL(tagged);
1495 ADD_BOOL(threaded);
1496 ADD_BOOL(trash);
1497 ADD_BOOL(visible);
1498#undef ADD_BOOL
1499 dot_type_string(fp, "bools", buf_is_empty(buf) ? "[NONE]" : buf_string(buf), true);
1500
1501 buf_reset(buf);
1503#define ADD_BOOL(F) add_flag(buf, (e->security & F), #F)
1518#undef ADD_BOOL
1519 dot_type_string(fp, "security", buf_is_empty(buf) ? "[NONE]" : buf_string(buf), true);
1520
1521 dot_type_number(fp, "num_hidden", e->num_hidden);
1522 dot_type_number(fp, "offset", e->offset);
1523 dot_type_number(fp, "lines", e->lines);
1524 dot_type_number(fp, "index", e->index);
1525 dot_type_number(fp, "msgno", e->msgno);
1526 dot_type_number(fp, "vnum", e->vnum);
1527 dot_type_number(fp, "score", e->score);
1528 dot_type_number(fp, "attach_total", e->attach_total);
1529
1530 // struct MaildirEmailData *edata = maildir_edata_get(e);
1531 // if (edata)
1532 // dot_type_string(fp, "maildir_flags", edata->maildir_flags, false);
1533
1534 if (e->date_sent != 0)
1535 {
1536 char zone[32];
1537 dot_type_date(arr, sizeof(arr), e->date_sent);
1538 snprintf(zone, sizeof(zone), " (%c%02u%02u)", e->zoccident ? '-' : '+',
1539 e->zhours, e->zminutes);
1540 struct Buffer *date = buf_pool_get();
1541 buf_printf(date, "%s%s", arr, zone);
1542 dot_type_string(fp, "date_sent", buf_string(date), false);
1543 buf_pool_release(&date);
1544 }
1545
1546 if (e->received != 0)
1547 {
1548 dot_type_date(arr, sizeof(arr), e->received);
1549 dot_type_string(fp, "received", arr, false);
1550 }
1551
1553
1554 if (e->body)
1555 {
1556 dot_body(fp, e->body, links, true);
1557 dot_add_link(links, e, e->body, "Email->body", NULL, false, NULL);
1558 }
1559
1560#ifndef GV_HIDE_ENVELOPE
1561 if (e->env)
1562 {
1563 dot_envelope(fp, e->env, links);
1564 dot_add_link(links, e, e->env, "Email->env", NULL, false, NULL);
1565
1566 buf_reset(buf);
1567 buf_addstr(buf, "{ rank=same ");
1568
1569 dot_ptr_name(arr, sizeof(arr), e);
1570 buf_add_printf(buf, "%s ", arr);
1571
1572 dot_ptr_name(arr, sizeof(arr), e->env);
1573 buf_add_printf(buf, "%s ", arr);
1574
1575 buf_addstr(buf, "}");
1576
1577 mutt_list_insert_tail(links, buf_strdup(buf));
1578 }
1579#endif
1580
1581 // struct TagList tags;
1582
1583 buf_pool_release(&buf);
1584}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
Definition buffer.c:204
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:76
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition buffer.c:291
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:226
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
Definition buffer.c:571
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
void dot_add_link(struct ListHead *links, const void *src, const void *dst, const char *label, const char *short_label, bool back, const char *colour)
Add a link between two objects in GraphViz.
Definition graphviz.c:275
void dot_ptr_name(char *buf, size_t buflen, const void *ptr)
Generate GraphViz object name from pointer.
Definition graphviz.c:236
void dot_object_footer(FILE *fp)
Write GraphViz object footer.
Definition graphviz.c:374
void dot_type_date(char *buf, size_t buflen, time_t timestamp)
Format a timestamp for GraphViz output.
Definition graphviz.c:126
void dot_type_number(FILE *fp, const char *name, int num)
Write a number type field to GraphViz output.
Definition graphviz.c:160
void dot_type_string(FILE *fp, const char *name, const char *str, bool force)
Write a string type field to GraphViz output.
Definition graphviz.c:193
void dot_envelope(FILE *fp, const struct Envelope *env, struct ListHead *links)
Definition graphviz.c:1400
void dot_body(FILE *fp, const struct Body *b, struct ListHead *links, bool link_next)
Definition graphviz.c:1226
#define ADD_BOOL(F)
void dot_object_header(FILE *fp, const void *ptr, const char *name, const char *colour)
Write GraphViz object header.
Definition graphviz.c:353
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Definition list.c:65
#define SEC_INLINE
Email has an inline signature.
Definition lib.h:93
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition lib.h:95
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
Definition lib.h:94
#define PGP_TRADITIONAL_CHECKED
Email has a traditional (inline) signature.
Definition lib.h:100
#define SEC_GOODSIGN
Email has a valid signature.
Definition lib.h:88
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition lib.h:98
#define SEC_SIGNOPAQUE
Email has an opaque signature (encrypted)
Definition lib.h:91
#define SEC_BADSIGN
Email has a bad signature.
Definition lib.h:89
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition lib.h:99
#define SEC_PARTSIGN
Not all parts of the email is signed.
Definition lib.h:90
#define SEC_ENCRYPT
Email is encrypted.
Definition lib.h:86
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
Definition lib.h:96
#define SEC_SIGN
Email is signed.
Definition lib.h:87
#define SEC_KEYBLOCK
Email has a key attached.
Definition lib.h:92
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
String manipulation buffer.
Definition buffer.h:36
unsigned int zminutes
Minutes away from UTC.
Definition email.h:57
struct Envelope * env
Envelope information.
Definition email.h:68
int lines
How many lines in the body of this message?
Definition email.h:62
struct Body * body
List of MIME parts.
Definition email.h:69
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
Definition email.h:123
bool zoccident
True, if west of UTC, False if east.
Definition email.h:58
LOFF_T offset
Where in the stream does this message begin?
Definition email.h:71
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:56
time_t date_sent
Time when the message was sent (UTC)
Definition email.h:60
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:70
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:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_envelope()

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

Helper to add an envelope changed flag to graphviz output

Helper to output an address list in graphviz

Definition at line 1400 of file graphviz.c.

1401{
1402 struct Buffer *buf = buf_pool_get();
1403
1404 dot_object_header(fp, env, "Envelope", "#ffff00");
1405
1407#define ADD_FLAG(F) add_flag(buf, (env->changed & F), #F)
1412#undef ADD_BOOL
1413 dot_type_string(fp, "changed", buf_is_empty(buf) ? "[NONE]" : buf_string(buf), true);
1414
1416#define ADDR_LIST(AL) dot_addr_list(fp, #AL, &env->AL, links)
1417 ADDR_LIST(return_path);
1418 ADDR_LIST(from);
1419 ADDR_LIST(to);
1420 ADDR_LIST(cc);
1421 ADDR_LIST(bcc);
1422 ADDR_LIST(sender);
1423 ADDR_LIST(reply_to);
1424 ADDR_LIST(mail_followup_to);
1425 ADDR_LIST(x_original_to);
1426#undef ADDR_LIST
1427
1428 dot_type_string(fp, "date", env->date, false);
1429 dot_type_string(fp, "disp_subj", env->disp_subj, false);
1430 dot_type_string(fp, "followup_to", env->followup_to, false);
1431 dot_type_string(fp, "list_post", env->list_post, false);
1432 dot_type_string(fp, "list_subscribe", env->list_subscribe, false);
1433 dot_type_string(fp, "list_unsubscribe", env->list_unsubscribe, false);
1434 dot_type_string(fp, "message_id", env->message_id, false);
1435 dot_type_string(fp, "newsgroups", env->newsgroups, false);
1436 dot_type_string(fp, "organization", env->organization, false);
1437 dot_type_string(fp, "real_subj", env->real_subj, false);
1438 dot_type_string(fp, "spam", buf_string(&env->spam), false);
1439 dot_type_string(fp, "subject", env->subject, false);
1440 dot_type_string(fp, "supersedes", env->supersedes, false);
1441 dot_type_string(fp, "xref", env->xref, false);
1442 dot_type_string(fp, "x_comment_to", env->x_comment_to, false);
1443 dot_type_string(fp, "x_label", env->x_label, false);
1444
1445 if (0)
1446 {
1447 dot_list_head(fp, "references", &env->references);
1448 dot_list_head(fp, "in_reply_to", &env->in_reply_to);
1449 dot_list_head(fp, "userhdrs", &env->userhdrs);
1450 }
1451
1452#ifdef USE_AUTOCRYPT
1453 dot_ptr(fp, "autocrypt", env->autocrypt, NULL);
1454 dot_ptr(fp, "autocrypt_gossip", env->autocrypt_gossip, NULL);
1455#endif
1456
1458
1459 buf_pool_release(&buf);
1460}
#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:1365
#define ADD_FLAG(F)
void dot_ptr(FILE *fp, const char *name, void *ptr, const char *colour)
Write a pointer field to GraphViz output.
Definition graphviz.c:248
struct ListHead userhdrs
user defined headers
Definition envelope.h:85
char * supersedes
Supersedes header.
Definition envelope.h:74
char * list_subscribe
This stores a mailto URL, or nothing.
Definition envelope.h:68
char *const subject
Email's subject.
Definition envelope.h:70
char * followup_to
List of 'followup-to' fields.
Definition envelope.h:80
char * message_id
Message ID.
Definition envelope.h:73
char * x_comment_to
List of 'X-comment-to' fields.
Definition envelope.h:81
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
Definition envelope.h:88
char * newsgroups
List of newsgroups.
Definition envelope.h:78
struct ListHead references
message references (in reverse order)
Definition envelope.h:83
struct AutocryptHeader * autocrypt
Autocrypt header.
Definition envelope.h:87
struct Buffer spam
Spam header.
Definition envelope.h:82
struct ListHead in_reply_to
in-reply-to header content
Definition envelope.h:84
char * xref
List of cross-references.
Definition envelope.h:79
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 *const real_subj
Offset of the real subject.
Definition envelope.h:71
char * date
Sent date.
Definition envelope.h:75
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,
const struct PatternList * pl,
struct ListHead * links )

Definition at line 1909 of file graphviz.c.

1910{
1911 struct Buffer *buf = buf_pool_get();
1912
1913 char name[256] = { 0 };
1914 buf_addstr(buf, "{ rank=same ");
1915
1916 struct Pattern *prev = NULL;
1917 struct Pattern *np = NULL;
1918 SLIST_FOREACH(np, pl, entries)
1919 {
1920 dot_pattern(fp, np, links);
1921 if (prev)
1922 dot_add_link(links, prev, np, "PatternList->next", NULL, false, "#ff0000");
1923 prev = np;
1924
1925 dot_ptr_name(name, sizeof(name), np);
1926 buf_add_printf(buf, "%s ", name);
1927 }
1928
1929 buf_addstr(buf, "}");
1930
1931 mutt_list_insert_tail(links, buf_strdup(buf));
1932 buf_pool_release(&buf);
1933}
void dot_pattern(FILE *fp, struct Pattern *pat, struct ListHead *links)
Definition graphviz.c:1852
#define SLIST_FOREACH(var, head, field)
Definition queue.h:229
A simple (non-regex) pattern.
Definition lib.h:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node()

void dot_expando_node ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2183 of file graphviz.c.

2184{
2185 switch (node->type)
2186 {
2187 case ENT_CONDITION:
2188 dot_expando_node_condition(fp, node, links);
2189 break;
2190 case ENT_CONDBOOL:
2191 dot_expando_node_conditional_bool(fp, node, links);
2192 break;
2193 case ENT_CONDDATE:
2194 dot_expando_node_conditional_date(fp, node, links);
2195 break;
2196 case ENT_CONTAINER:
2197 dot_expando_node_container(fp, node, links);
2198 break;
2199 case ENT_EMPTY:
2200 dot_expando_node_empty(fp, node, links);
2201 break;
2202 case ENT_EXPANDO:
2203 dot_expando_node_expando(fp, node, links);
2204 break;
2205 case ENT_PADDING:
2206 dot_expando_node_pad(fp, node, links);
2207 break;
2208 case ENT_TEXT:
2209 dot_expando_node_text(fp, node, links);
2210 break;
2211 default:
2212 dot_expando_node_unknown(fp, node, links);
2213 break;
2214 }
2215}
void dot_expando_node_condition(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2043
void dot_expando_node_expando(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2151
void dot_expando_node_unknown(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2168
void dot_expando_node_empty(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:1982
void dot_expando_node_conditional_bool(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2073
void dot_expando_node_conditional_date(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2088
void dot_expando_node_pad(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2001
void dot_expando_node_container(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2110
void dot_expando_node_text(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:1989
@ ENT_EXPANDO
Expando, e.g. 'n'.
Definition node.h:39
@ ENT_CONTAINER
Container for other nodes.
Definition node.h:44
@ ENT_CONDITION
True/False condition.
Definition node.h:41
@ ENT_TEXT
Plain text.
Definition node.h:38
@ ENT_CONDDATE
True/False date condition.
Definition node.h:43
@ ENT_EMPTY
Empty.
Definition node.h:37
@ ENT_CONDBOOL
True/False boolean condition.
Definition node.h:42
@ ENT_PADDING
Padding: soft, hard, EOL.
Definition node.h:40
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition node.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_type_bool()

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

Write a boolean type field to GraphViz output.

Parameters
fpFile pointer
nameField name
valBoolean value

Definition at line 90 of file graphviz.c.

91{
92 static const char *values[] = { "false", "true" };
93 fprintf(fp, "\t\t<tr>\n");
94 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
95 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
96 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", values[val]);
97 fprintf(fp, "\t\t</tr>\n");
98}
+ Here is the caller graph for this function:

◆ dot_type_char()

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

Write a character type field to GraphViz output.

Parameters
fpFile pointer
nameField name
chCharacter value

Definition at line 107 of file graphviz.c.

108{
109 fprintf(fp, "\t\t<tr>\n");
110 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
111 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
112 if (ch == '\0')
113 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">NUL</td>\n");
114 else
115 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">'%c'</td>\n", ch);
116 fprintf(fp, "\t\t</tr>\n");
117}
+ Here is the caller graph for this function:

◆ dot_type_date()

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

Format a timestamp for GraphViz output.

Parameters
bufBuffer for output
buflenBuffer length
timestampTimestamp to format

Definition at line 126 of file graphviz.c.

127{
128 mutt_date_localtime_format(buf, buflen, "%Y-%m-%d %H:%M:%S", timestamp);
129}
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
Definition date.c:952
static const char * timestamp(time_t stamp)
Create a YYYY-MM-DD HH:MM:SS timestamp.
Definition logging.c:79
+ 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 )

Write a file pointer field to GraphViz output.

Parameters
fpFile pointer
nameField name
struct_fpFile pointer value

Definition at line 137 of file graphviz.c.

138{
139 fprintf(fp, "\t\t<tr>\n");
140 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
141 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
142 if (struct_fp)
143 {
144 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%p (%d)</td>\n",
145 struct_fp, fileno(struct_fp));
146 }
147 else
148 {
149 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">NULL</td>\n");
150 }
151 fprintf(fp, "\t\t</tr>\n");
152}
+ Here is the caller graph for this function:

◆ dot_type_number()

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

Write a number type field to GraphViz output.

Parameters
fpFile pointer
nameField name
numNumeric value

Definition at line 160 of file graphviz.c.

161{
162 fprintf(fp, "\t\t<tr>\n");
163 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
164 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
165 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%d</td>\n", num);
166 fprintf(fp, "\t\t</tr>\n");
167}
+ Here is the caller graph for this function:

◆ dot_type_string_escape()

void dot_type_string_escape ( struct Buffer * buf)

Escape special characters in a string for GraphViz.

Parameters
bufString buffer to escape

Definition at line 173 of file graphviz.c.

174{
175 for (int i = buf_len(buf) - 1; i >= 0; i--)
176 {
177 if (buf_at(buf, i) == '<')
178 buf_inline_replace(buf, i, 1, "&lt;");
179 else if (buf_at(buf, i) == '>')
180 buf_inline_replace(buf, i, 1, "&gt;");
181 else if (buf_at(buf, 1) == '&')
182 buf_inline_replace(buf, i, 1, "&amp;");
183 }
184}
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
Definition buffer.c:491
char buf_at(const struct Buffer *buf, size_t offset)
Return the character at the given offset.
Definition buffer.c:668
void buf_inline_replace(struct Buffer *buf, size_t pos, size_t len, const char *str)
Definition buffer.c:768
+ 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 )

Write a string type field to GraphViz output.

Parameters
fpFile pointer
nameField name
strString value
forceAlways output even if empty

Definition at line 193 of file graphviz.c.

194{
195 if ((!str || (str[0] == '\0')) && !force)
196 return;
197
198 struct Buffer *buf = buf_new(str);
199
200 if (!buf_is_empty(buf))
202
203 bool quoted = ((buf_at(buf, 0) != '[') && (buf_at(buf, 0) != '*'));
204
205 fprintf(fp, "\t\t<tr>\n");
206 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
207 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
208 if (quoted)
209 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">\"%s\"</td>\n", buf_string(buf));
210 else
211 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", buf_string(buf));
212 fprintf(fp, "\t\t</tr>\n");
213
214 buf_free(&buf);
215}
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
Definition buffer.c:319
struct Buffer * buf_new(const char *str)
Allocate a new Buffer.
Definition buffer.c:304
void dot_type_string_escape(struct Buffer *buf)
Escape special characters in a string for GraphViz.
Definition graphviz.c:173
+ 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 )

Format a file mode as octal string.

Parameters
bufBuffer for output
buflenBuffer length
umaskFile mode mask

Definition at line 224 of file graphviz.c.

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

◆ dot_ptr_name()

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

Generate GraphViz object name from pointer.

Parameters
bufBuffer for output
buflenBuffer length
ptrPointer to convert

Definition at line 236 of file graphviz.c.

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

◆ dot_ptr()

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

Write a pointer field to GraphViz output.

Parameters
fpFile pointer
nameField name
ptrPointer value
colourOptional color for pointer

Definition at line 248 of file graphviz.c.

249{
250 fprintf(fp, "\t\t<tr>\n");
251 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
252 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
253 if (colour && ptr)
254 {
255 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\" bgcolor=\"%s\">%p</td>\n",
256 colour, ptr);
257 }
258 else
259 {
260 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%p</td>\n", ptr);
261 }
262 fprintf(fp, "\t\t</tr>\n");
263}
+ Here is the caller graph for this function:

◆ dot_add_link()

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

Add a link between two objects in GraphViz.

Parameters
linksList to add link to
srcSource object pointer
dstDestination object pointer
labelFull label text
short_labelShort label text
backTrue if arrow should be reversed
colourOptional color for edge

Definition at line 275 of file graphviz.c.

277{
278 if (!src || !dst)
279 return;
280 if (!colour)
281 colour = "#c0c0c0";
282
283 char obj1[64] = { 0 };
284 char obj2[64] = { 0 };
285 char text[512] = { 0 };
286 char lstr[128] = { 0 };
287 char sstr[128] = { 0 };
288
289 dot_ptr_name(obj1, sizeof(obj1), src);
290 dot_ptr_name(obj2, sizeof(obj2), dst);
291
292 if (label)
293 snprintf(lstr, sizeof(lstr), "edgetooltip=\"%s\"", label);
294
295 if (short_label)
296 snprintf(sstr, sizeof(sstr), "label=\"%s\"", short_label);
297
298 snprintf(text, sizeof(text), "%s -> %s [ %s %s %s color=\"%s\" ]", obj1, obj2,
299 back ? "dir=back" : "", lstr, sstr, colour);
301}
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:257
+ 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)

Write GraphViz graph header.

Parameters
fpFile pointer

Definition at line 307 of file graphviz.c.

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

◆ dot_graph_footer()

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

Write GraphViz graph footer with links.

Parameters
fpFile pointer
linksList of link definitions

Definition at line 335 of file graphviz.c.

336{
337 fprintf(fp, "\n");
338 struct ListNode *np = NULL;
339 STAILQ_FOREACH(np, links, entries)
340 {
341 fprintf(fp, "\t%s;\n", np->data);
342 }
343 fprintf(fp, "\n}\n");
344}
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
A List node for strings.
Definition list.h:37
char * data
String.
Definition list.h:38
+ 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 )

Write GraphViz object header.

Parameters
fpFile pointer
ptrObject pointer
nameObject name
colourBackground color

Definition at line 353 of file graphviz.c.

354{
355 char obj[64] = { 0 };
356 dot_ptr_name(obj, sizeof(obj), ptr);
357
358 if (!colour)
359 colour = "#ffff80";
360
361 fprintf(fp, "\t%s [\n", obj);
362 fprintf(fp, "\t\tlabel=<<table cellspacing=\"0\" border=\"1\" rows=\"*\" "
363 "color=\"#d0d0d0\">\n");
364 fprintf(fp, "\t\t<tr>\n");
365 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",
366 colour, name, ptr);
367 fprintf(fp, "\t\t</tr>\n");
368}
+ 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)

Write GraphViz object footer.

Parameters
fpFile pointer

Definition at line 374 of file graphviz.c.

375{
376 fprintf(fp, "\t\t</table>>\n");
377 fprintf(fp, "\t];\n");
378 fprintf(fp, "\n");
379}
+ Here is the caller graph for this function:

◆ dot_node()

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

Write a simple GraphViz node.

Parameters
fpFile pointer
ptrNode pointer
nameNode name
colourNode color

Definition at line 388 of file graphviz.c.

389{
390 char obj[64] = { 0 };
391 dot_ptr_name(obj, sizeof(obj), ptr);
392
393 fprintf(fp, "\t%s [\n", obj);
394 fprintf(fp, "\t\tlabel=<<table cellspacing=\"0\" border=\"1\" rows=\"*\" "
395 "color=\"#d0d0d0\">\n");
396 fprintf(fp, "\t\t<tr>\n");
397 fprintf(fp, "\t\t\t<td border=\"0\" bgcolor=\"%s\" port=\"top\"><font color=\"#000000\" point-size=\"20\"><b>%s</b></font></td>\n",
398 colour, name);
399 fprintf(fp, "\t\t</tr>\n");
401}
+ 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 )

Extract filesystem path from full path.

Parameters
bufBuffer for output
buflenBuffer length
pathFull path

Definition at line 409 of file graphviz.c.

410{
411 if (!path)
412 {
413 buf[0] = '\0';
414 return;
415 }
416
417 const char *slash = strrchr(path, '/');
418 if (slash)
419 slash++;
420 else
421 slash = path;
422
423 mutt_str_copy(buf, slash, buflen);
424}
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:583
+ 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 )

Extract IMAP path from full path.

Parameters
bufBuffer for output
buflenBuffer length
pathFull path

Definition at line 432 of file graphviz.c.

433{
434 char tmp[1024] = { 0 };
435 mutt_str_copy(tmp, path, sizeof(tmp));
436
437 struct Url *u = url_parse(tmp);
438
439 if (u->path && (u->path[0] != '\0'))
440 mutt_str_copy(buf, u->path, buflen);
441 else
442 snprintf(buf, buflen, "%s:%s", u->host, u->user);
443
444 url_free(&u);
445}
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:239
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition url.c:124
+ 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 448 of file graphviz.c.

450{
451 if (!sub)
452 return;
453
454 struct Buffer *value = buf_pool_get();
455 dot_object_header(fp, name, "Config", "#ffff80");
456 dot_type_string(fp, "scope", sub->name, true);
457
458 if (sub->name)
459 {
460 char scope[256];
461 snprintf(scope, sizeof(scope), "%s:", sub->name);
462
463 struct HashElemArray hea = get_elem_list(sub->cs, GEL_ALL_CONFIG);
464 struct HashElem **hep = NULL;
465 ARRAY_FOREACH(hep, &hea)
466 {
467 struct HashElem *item = *hep;
468 if ((item->type & type) == 0)
469 continue;
470
471 const char *iname = item->key.strkey;
472 size_t slen = strlen(scope);
473 if (mutt_str_startswith(iname, scope) != 0)
474 {
475 if (strchr(iname + slen, ':'))
476 continue;
477 if ((CONFIG_TYPE(item->type) == DT_STRING) && (item->type & D_SENSITIVE))
478 {
479 dot_type_string(fp, iname + slen, "***", true);
480 }
481 else
482 {
483 buf_reset(value);
484 cs_subset_he_string_get(sub, item, value);
485 dot_type_string(fp, iname + slen, buf_string(value), true);
486 }
487 }
488 }
489 ARRAY_FREE(&hea);
490 }
491 else
492 {
493 struct HashElemArray hea = get_elem_list(sub->cs, GEL_ALL_CONFIG);
494 dot_type_number(fp, "count", ARRAY_SIZE(&hea));
495 ARRAY_FREE(&hea);
496 }
497
499 buf_pool_release(&value);
500}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
#define ARRAY_SIZE(head)
The number of elements stored.
Definition array.h:87
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition string.c:234
const char * name
Scope name of Subset.
Definition subset.h:47
struct ConfigSet * cs
Parent ConfigSet.
Definition subset.h:50
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:338
struct HashElemArray get_elem_list(struct ConfigSet *cs, enum GetElemListFlags flags)
Create a sorted list of all config items.
Definition subset.c:81
@ GEL_ALL_CONFIG
All the normal config (no synonyms or deprecated)
Definition subset.h:81
#define CONFIG_TYPE(t)
Extract the type from the flags.
Definition types.h:50
@ DT_STRING
a string
Definition types.h:44
#define D_SENSITIVE
Contains sensitive value, e.g. password.
Definition types.h:81
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 503 of file graphviz.c.

504{
505 dot_object_header(fp, ci, "CompressInfo", "#c0c060");
506 dot_type_string(fp, "append", ci->cmd_append->string, true);
507 dot_type_string(fp, "close", ci->cmd_close->string, true);
508 dot_type_string(fp, "open", ci->cmd_open->string, true);
510}
struct Expando * cmd_open
open-hook command
Definition lib.h:64
struct Expando * cmd_append
append-hook command
Definition lib.h:62
struct Expando * cmd_close
close-hook command
Definition lib.h:63
const char * string
Pointer to the parsed string.
Definition expando.h:42
+ 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 )

Write a mailbox type field to GraphViz output.

Parameters
fpFile pointer
nameField name
typeMailbox type

Definition at line 518 of file graphviz.c.

519{
520 const char *typestr = NULL;
521
522 switch (type)
523 {
524 case MUTT_MBOX:
525 typestr = "MBOX";
526 break;
527 case MUTT_MMDF:
528 typestr = "MMDF";
529 break;
530 case MUTT_MH:
531 typestr = "MH";
532 break;
533 case MUTT_MAILDIR:
534 typestr = "MAILDIR";
535 break;
536 case MUTT_NNTP:
537 typestr = "NNTP";
538 break;
539 case MUTT_IMAP:
540 typestr = "IMAP";
541 break;
542 case MUTT_NOTMUCH:
543 typestr = "NOTMUCH";
544 break;
545 case MUTT_POP:
546 typestr = "POP";
547 break;
548 case MUTT_COMPRESSED:
549 typestr = "COMPRESSED";
550 break;
551 default:
552 typestr = "UNKNOWN";
553 }
554
555 fprintf(fp, "\t\t<tr>\n");
556 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", name);
557 fprintf(fp, "\t\t\t<td border=\"0\">=</td>\n");
558 fprintf(fp, "\t\t\t<td border=\"0\" align=\"left\">%s</td>\n", typestr);
559 fprintf(fp, "\t\t</tr>\n");
560}
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition mailbox.h:50
@ MUTT_MMDF
'mmdf' Mailbox type
Definition mailbox.h:45
@ MUTT_POP
'POP3' Mailbox type
Definition mailbox.h:51
@ MUTT_MH
'MH' Mailbox type
Definition mailbox.h:46
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition mailbox.h:48
@ MUTT_IMAP
'IMAP' Mailbox type
Definition mailbox.h:49
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:44
@ MUTT_COMPRESSED
Compressed file Mailbox type.
Definition mailbox.h:52
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition mailbox.h:47
+ Here is the caller graph for this function:

◆ dot_mailbox_imap()

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

Dump IMAP mailbox metadata.

Parameters
fpFile pointer
mdataIMAP metadata
linksList of links

Definition at line 569 of file graphviz.c.

570{
571 dot_object_header(fp, mdata, "ImapMboxData", "#60c060");
572 dot_type_string(fp, "name", mdata->name, true);
573 dot_type_string(fp, "munge_name", mdata->munge_name, true);
574 dot_type_string(fp, "real_name", mdata->real_name, true);
576}
char * real_name
Original Mailbox name, e.g.: INBOX can be just \0.
Definition mdata.h:43
char * munge_name
Munged version of the mailbox name.
Definition mdata.h:42
char * name
Mailbox name.
Definition mdata.h:41
+ 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 )

Dump Maildir mailbox metadata.

Parameters
fpFile pointer
mdataMaildir metadata
linksList of links

Definition at line 584 of file graphviz.c.

585{
586 char buf[64] = { 0 };
587
588 dot_object_header(fp, mdata, "MaildirMboxData", "#60c060");
589
590 dot_type_date(buf, sizeof(buf), mdata->mtime_cur.tv_sec);
591 dot_type_string(fp, "mtime_cur", buf, true);
592
593 dot_type_umask(buf, sizeof(buf), mdata->umask);
594 dot_type_string(fp, "umask", buf, true);
596}
void dot_type_umask(char *buf, size_t buflen, int umask)
Format a file mode as octal string.
Definition graphviz.c:224
struct timespec mtime_cur
Timestamp of the 'cur' dir.
Definition mdata.h:37
mode_t umask
umask to use when creating files
Definition mdata.h:38
+ 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 )

Dump Mbox mailbox metadata.

Parameters
fpFile pointer
mdataMbox metadata
linksList of links

Definition at line 604 of file graphviz.c.

605{
606 char buf[64] = { 0 };
607
608 dot_object_header(fp, mdata, "MboxAccountData", "#60c060");
609 dot_ptr(fp, "fp", mdata->fp, NULL);
610
611 dot_type_date(buf, sizeof(buf), mdata->atime.tv_sec);
612 dot_type_string(fp, "atime", buf, true);
613
615}
FILE * fp
Mailbox file.
Definition lib.h:51
struct timespec atime
File's last-access time.
Definition lib.h:53
+ 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 )

Dump NNTP mailbox metadata.

Parameters
fpFile pointer
mdataNNTP metadata
linksList of links

Definition at line 623 of file graphviz.c.

624{
625 dot_object_header(fp, mdata, "NntpMboxData", "#60c060");
626 dot_type_string(fp, "group", mdata->group, true);
627 dot_type_string(fp, "desc", mdata->desc, true);
628
629 dot_type_number(fp, "first_message", mdata->first_message);
630 dot_type_number(fp, "last_message", mdata->last_message);
631 dot_type_number(fp, "last_loaded", mdata->last_loaded);
632 dot_type_number(fp, "last_cached", mdata->last_cached);
633 dot_type_number(fp, "unread", mdata->unread);
634
635 dot_type_bool(fp, "subscribed", mdata->subscribed);
636 dot_type_bool(fp, "has_new_mail", mdata->has_new_mail);
637 dot_type_bool(fp, "allowed", mdata->allowed);
638 dot_type_bool(fp, "deleted", mdata->deleted);
639
641}
void dot_type_bool(FILE *fp, const char *name, bool val)
Write a boolean type field to GraphViz output.
Definition graphviz.c:90
anum_t last_cached
Last cached article.
Definition mdata.h:40
bool deleted
Newsgroup is deleted.
Definition mdata.h:45
bool allowed
Posting allowed.
Definition mdata.h:44
anum_t last_message
Last article number.
Definition mdata.h:38
char * group
Name of newsgroup.
Definition mdata.h:35
char * desc
Description of newsgroup.
Definition mdata.h:36
anum_t unread
Unread articles.
Definition mdata.h:41
anum_t last_loaded
Last loaded article.
Definition mdata.h:39
bool has_new_mail
Has new articles.
Definition mdata.h:43
anum_t first_message
First article number.
Definition mdata.h:37
bool subscribed
Subscribed to this newsgroup.
Definition mdata.h:42
+ 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 )

Dump Notmuch mailbox metadata.

Parameters
fpFile pointer
mdataNotmuch metadata
linksList of links

Definition at line 650 of file graphviz.c.

651{
652 dot_object_header(fp, mdata, "NmMboxData", "#60c060");
653 dot_type_number(fp, "db_limit", mdata->db_limit);
655}
int db_limit
Maximum number of results to return.
Definition mdata.h:38
+ 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 )

Dump POP mailbox metadata.

Parameters
fpFile pointer
adataPOP account metadata
linksList of links

Definition at line 664 of file graphviz.c.

665{
666 dot_object_header(fp, adata, "PopAccountData", "#60c060");
667 dot_ptr(fp, "conn", adata->conn, "#ff8080");
669}
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 )

Dump a mailbox object.

Parameters
fpFile pointer
mMailbox to dump
linksList of links

Definition at line 678 of file graphviz.c.

679{
680 char buf[64] = { 0 };
681
682 dot_object_header(fp, m, "Mailbox", "#80ff80");
683 dot_mailbox_type(fp, "type", m->type);
684 dot_type_string(fp, "name", m->name, false);
685
686 if ((m->type == MUTT_IMAP) || (m->type == MUTT_POP))
687 {
688 dot_path_imap(buf, sizeof(buf), buf_string(&m->pathbuf));
689 dot_type_string(fp, "pathbuf", buf, true);
690 dot_path_imap(buf, sizeof(buf), m->realpath);
691 dot_type_string(fp, "realpath", buf, true);
692 }
693 else
694 {
695 dot_path_fs(buf, sizeof(buf), buf_string(&m->pathbuf));
696 dot_type_string(fp, "pathbuf", buf, true);
697 dot_path_fs(buf, sizeof(buf), m->realpath);
698 dot_type_string(fp, "realpath", buf, true);
699 }
700
701#ifdef GV_HIDE_MDATA
702 dot_ptr(fp, "mdata", m->mdata, NULL);
703#endif
704 dot_ptr(fp, "account", m->account, "#80ffff");
705 dot_type_number(fp, "opened", m->opened);
706
707 dot_type_number(fp, "msg_count", m->msg_count);
708 // dot_type_number(fp, "msg_unread", m->msg_unread);
709 // dot_type_number(fp, "msg_flagged", m->msg_flagged);
710 // dot_type_number(fp, "msg_new", m->msg_new);
711 // dot_type_number(fp, "msg_deleted", m->msg_deleted);
712 // dot_type_number(fp, "msg_tagged", m->msg_tagged);
713
714 dot_ptr(fp, "emails", m->emails, NULL);
715 dot_type_number(fp, "email_max", m->email_max);
716 dot_ptr(fp, "v2r", m->v2r, NULL);
717 dot_type_number(fp, "vcount", m->vcount);
718
720
721 // dot_add_link(links, m, m->mdata, NULL, NULL, false, NULL);
722
723#ifndef GV_HIDE_MDATA
724 if (m->mdata)
725 {
726 if (m->type == MUTT_MAILDIR)
727 dot_mailbox_maildir(fp, m->mdata, links);
728 else if (m->type == MUTT_IMAP)
729 dot_mailbox_imap(fp, m->mdata, links);
730 else if (m->type == MUTT_POP)
731 dot_mailbox_pop(fp, m->mdata, links);
732 else if (m->type == MUTT_MBOX)
733 dot_mailbox_mbox(fp, m->mdata, links);
734 else if (m->type == MUTT_NNTP)
735 dot_mailbox_nntp(fp, m->mdata, links);
736#ifdef USE_NOTMUCH
737 else if (m->type == MUTT_NOTMUCH)
738 dot_mailbox_notmuch(fp, m->mdata, links);
739#endif
740
741 dot_add_link(links, m, m->mdata, "Mailbox->mdata", NULL, false, NULL);
742 }
743#endif
744
745 if (m->compress_info)
746 {
747 dot_comp(fp, m->compress_info, links);
748 dot_add_link(links, m, m->compress_info, "Mailbox->compress_info", NULL, false, NULL);
749 }
750
751#ifndef GV_HIDE_CONFIG
752 if (m->name)
753 {
754 dot_config(fp, m->name, 0, m->sub, links);
755 dot_add_link(links, m, m->name, "Mailbox Config", NULL, false, NULL);
756 }
757#endif
758}
void dot_mailbox_pop(FILE *fp, struct PopAccountData *adata, struct ListHead *links)
Dump POP mailbox metadata.
Definition graphviz.c:664
void dot_path_fs(char *buf, size_t buflen, const char *path)
Extract filesystem path from full path.
Definition graphviz.c:409
void dot_mailbox_imap(FILE *fp, struct ImapMboxData *mdata, struct ListHead *links)
Dump IMAP mailbox metadata.
Definition graphviz.c:569
void dot_comp(FILE *fp, struct CompressInfo *ci, struct ListHead *links)
Definition graphviz.c:503
void dot_mailbox_type(FILE *fp, const char *name, enum MailboxType type)
Write a mailbox type field to GraphViz output.
Definition graphviz.c:518
void dot_config(FILE *fp, const char *name, int type, struct ConfigSubset *sub, struct ListHead *links)
Definition graphviz.c:448
void dot_mailbox_mbox(FILE *fp, struct MboxAccountData *mdata, struct ListHead *links)
Dump Mbox mailbox metadata.
Definition graphviz.c:604
void dot_path_imap(char *buf, size_t buflen, const char *path)
Extract IMAP path from full path.
Definition graphviz.c:432
void dot_mailbox_notmuch(FILE *fp, struct NmMboxData *mdata, struct ListHead *links)
Dump Notmuch mailbox metadata.
Definition graphviz.c:650
void dot_mailbox_maildir(FILE *fp, struct MaildirMboxData *mdata, struct ListHead *links)
Dump Maildir mailbox metadata.
Definition graphviz.c:584
void dot_mailbox_nntp(FILE *fp, struct NntpMboxData *mdata, struct ListHead *links)
Dump NNTP mailbox metadata.
Definition graphviz.c:623
int vcount
The number of virtual messages.
Definition mailbox.h:98
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition mailbox.h:80
int * v2r
Mapping from virtual to real msgno.
Definition mailbox.h:97
int msg_count
Total number of messages.
Definition mailbox.h:87
int email_max
Size of emails array.
Definition mailbox.h:96
enum MailboxType type
Mailbox type.
Definition mailbox.h:101
void * mdata
Driver specific data.
Definition mailbox.h:131
struct Email ** emails
Array of Emails.
Definition mailbox.h:95
char * name
A short name for the Mailbox.
Definition mailbox.h:81
struct Buffer pathbuf
Path of the Mailbox.
Definition mailbox.h:79
struct Account * account
Account that owns this Mailbox.
Definition mailbox.h:126
int opened
Number of times mailbox is opened.
Definition mailbox.h:127
void * compress_info
Compressed mbox module private data.
Definition mailbox.h:120
struct ConfigSubset * sub
Inherited config items.
Definition mailbox.h:82
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mailbox_array()

void dot_mailbox_array ( FILE * fp,
struct MailboxArray * ma,
struct ListHead * links )

Dump an array of mailboxes.

Parameters
fpFile pointer
maMailbox array
linksList of links

Definition at line 766 of file graphviz.c.

767{
768 struct Buffer *buf = buf_pool_get();
769
770 char name[256] = { 0 };
771 buf_addstr(buf, "{ rank=same ");
772
773 struct Mailbox *prev = NULL;
774 struct Mailbox **mp = NULL;
775 ARRAY_FOREACH(mp, ma)
776 {
777 struct Mailbox *m = *mp;
778
779 dot_mailbox(fp, m, links);
780 if (prev)
781 dot_add_link(links, prev, m, "MailboxNode->next", NULL, false, NULL);
782
783 dot_ptr_name(name, sizeof(name), m);
784 buf_add_printf(buf, "%s ", name);
785
786 prev = m;
787 }
788
789 buf_addstr(buf, "}");
791 buf_pool_release(&buf);
792}
void dot_mailbox(FILE *fp, struct Mailbox *m, struct ListHead *links)
Dump a mailbox object.
Definition graphviz.c:678
A mailbox.
Definition mailbox.h:78
+ 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 )

Dump a connection.

Parameters
fpFile pointer
cConnection to dump
linksList of links

Definition at line 801 of file graphviz.c.

802{
803 dot_object_header(fp, c, "Connection", "#ff8080");
804 // dot_ptr(fp, "sockdata", c->sockdata, "#60c0c0");
805 dot_type_number(fp, "fd", c->fd);
807
808 dot_object_header(fp, c->inbuf, "ConnAccount", "#ff8080");
809 dot_type_string(fp, "user", c->account.user, true);
810 dot_type_string(fp, "host", c->account.host, true);
811 dot_type_number(fp, "port", c->account.port);
813
814 dot_add_link(links, c, c->inbuf, "Connection.ConnAccount", NULL, false, NULL);
815}
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:51
struct ConnAccount account
Account details: username, password, etc.
Definition connection.h:49
int fd
Socket file descriptor.
Definition connection.h:53
+ 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 )

Dump IMAP account data.

Parameters
fpFile pointer
adataIMAP account data
linksList of links

Definition at line 823 of file graphviz.c.

824{
825 dot_object_header(fp, adata, "ImapAccountData", "#60c0c0");
826 // dot_type_string(fp, "mbox_name", adata->mbox_name, true);
827 // dot_type_string(fp, "login", adata->conn->account.login, true);
828 dot_type_string(fp, "user", adata->conn->account.user, true);
829 dot_type_string(fp, "pass", adata->conn->account.pass[0] ? "***" : "", true);
830 dot_type_number(fp, "port", adata->conn->account.port);
831 // dot_ptr(fp, "conn", adata->conn, "#ff8080");
832 dot_type_bool(fp, "unicode", adata->unicode);
833 dot_type_bool(fp, "qresync", adata->qresync);
834 dot_type_char(fp, "seqid", adata->seqid);
835 dot_ptr(fp, "mailbox", adata->mailbox, "#80ff80");
837
838 if (adata->conn)
839 {
840 dot_connection(fp, adata->conn, links);
841 dot_add_link(links, adata, adata->conn, "ImapAccountData->conn", NULL, false, NULL);
842 }
843}
void dot_type_char(FILE *fp, const char *name, char ch)
Write a character type field to GraphViz output.
Definition graphviz.c:107
void dot_connection(FILE *fp, struct Connection *c, struct ListHead *links)
Dump a connection.
Definition graphviz.c:801
char pass[256]
Password.
Definition connaccount.h:57
bool qresync
true, if QRESYNC is successfully ENABLE'd
Definition adata.h:64
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:63
struct Mailbox * mailbox
Current selected mailbox.
Definition adata.h:79
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 )

Dump Mbox account data.

Parameters
fpFile pointer
adataMbox account data
linksList of links

Definition at line 851 of file graphviz.c.

852{
853 char buf[64] = { 0 };
854
855 dot_object_header(fp, adata, "MboxAccountData", "#60c0c0");
856 dot_ptr(fp, "fp", adata->fp, NULL);
857
858 dot_type_date(buf, sizeof(buf), adata->atime.tv_sec);
859 dot_type_string(fp, "atime", buf, true);
860 dot_type_bool(fp, "locked", adata->locked);
861 dot_type_bool(fp, "append", adata->append);
862
864}
bool append
mailbox is opened in append mode
Definition lib.h:57
bool locked
is the mailbox locked?
Definition lib.h:56
+ 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 )

Dump NNTP account data.

Parameters
fpFile pointer
adataNNTP account data
linksList of links

Definition at line 872 of file graphviz.c.

873{
874 dot_object_header(fp, adata, "NntpAccountData", "#60c0c0");
875 dot_type_number(fp, "groups_num", adata->groups_num);
876
877 dot_type_bool(fp, "hasCAPABILITIES", adata->hasCAPABILITIES);
878 dot_type_bool(fp, "hasSTARTTLS", adata->hasSTARTTLS);
879 dot_type_bool(fp, "hasDATE", adata->hasDATE);
880 dot_type_bool(fp, "hasLIST_NEWSGROUPS", adata->hasLIST_NEWSGROUPS);
881 dot_type_bool(fp, "hasXGTITLE", adata->hasXGTITLE);
882 dot_type_bool(fp, "hasLISTGROUP", adata->hasLISTGROUP);
883 dot_type_bool(fp, "hasLISTGROUPrange", adata->hasLISTGROUPrange);
884 dot_type_bool(fp, "hasOVER", adata->hasOVER);
885 dot_type_bool(fp, "hasXOVER", adata->hasXOVER);
886 dot_type_bool(fp, "cacheable", adata->cacheable);
887 dot_type_bool(fp, "newsrc_modified", adata->newsrc_modified);
888
889 dot_type_string(fp, "authenticators", adata->authenticators, true);
890 dot_type_string(fp, "overview_fmt", adata->overview_fmt, true);
891 dot_type_string(fp, "newsrc_file", adata->newsrc_file, true);
892 dot_type_file(fp, "newsrc_fp", adata->fp_newsrc);
893
894 dot_type_number(fp, "groups_num", adata->groups_num);
895 dot_type_number(fp, "groups_max", adata->groups_max);
896
897 char buf[128];
898 dot_type_date(buf, sizeof(buf), adata->mtime);
899 dot_type_string(fp, "mtime", buf, true);
900 dot_type_date(buf, sizeof(buf), adata->newgroups_time);
901 dot_type_string(fp, "newgroups_time", buf, true);
902 dot_type_date(buf, sizeof(buf), adata->check_time);
903 dot_type_string(fp, "check_time", buf, true);
904
906
907 if (adata->conn)
908 {
909 dot_connection(fp, adata->conn, links);
910 dot_add_link(links, adata, adata->conn, "NntpAccountData->conn", NULL, false, NULL);
911 }
912}
void dot_type_file(FILE *fp, const char *name, FILE *struct_fp)
Write a file pointer field to GraphViz output.
Definition graphviz.c:137
time_t newgroups_time
Last newgroups request time.
Definition adata.h:56
bool newsrc_modified
Newsrc file was modified.
Definition adata.h:49
bool hasXOVER
Server supports XOVER command.
Definition adata.h:45
struct Connection * conn
Connection to NNTP Server.
Definition adata.h:63
char * authenticators
Authenticators list.
Definition adata.h:52
char * overview_fmt
Overview format.
Definition adata.h:53
bool hasXGTITLE
Server supports XGTITLE command.
Definition adata.h:41
unsigned int groups_num
Number of newsgroups.
Definition adata.h:58
bool hasCAPABILITIES
Server supports CAPABILITIES command.
Definition adata.h:37
bool hasSTARTTLS
Server supports STARTTLS command.
Definition adata.h:38
bool hasLISTGROUPrange
Server supports LISTGROUPrange command.
Definition adata.h:43
time_t check_time
Last check time.
Definition adata.h:57
time_t mtime
Newsrc modification time.
Definition adata.h:55
unsigned int groups_max
Maximum number of newsgroups.
Definition adata.h:59
bool hasLISTGROUP
Server supports LISTGROUP command.
Definition adata.h:42
FILE * fp_newsrc
Newsrc file handle.
Definition adata.h:50
bool cacheable
Can be cached.
Definition adata.h:48
bool hasOVER
Server supports OVER command.
Definition adata.h:44
char * newsrc_file
Newsrc file path.
Definition adata.h:51
bool hasDATE
Server supports DATE command.
Definition adata.h:39
bool hasLIST_NEWSGROUPS
Server supports LIST_NEWSGROUPS command.
Definition adata.h:40
+ 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 )

Dump Notmuch account data.

Parameters
fpFile pointer
adataNotmuch account data
linksList of links

Definition at line 921 of file graphviz.c.

922{
923 dot_object_header(fp, adata, "NmAccountData", "#60c0c0");
924 dot_ptr(fp, "db", adata->db, NULL);
926}
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 )

Dump POP account data.

Parameters
fpFile pointer
adataPOP account data
linksList of links

Definition at line 935 of file graphviz.c.

936{
937 char buf[64] = { 0 };
938
939 dot_object_header(fp, adata, "PopAccountData", "#60c0c0");
940
941 dot_type_date(buf, sizeof(buf), adata->check_time);
942 dot_type_string(fp, "check_time", buf, true);
943
944 dot_type_string(fp, "login", adata->conn->account.login, true);
945 dot_type_string(fp, "user", adata->conn->account.user, true);
946 dot_type_string(fp, "pass", adata->conn->account.pass[0] ? "***" : "", true);
947 dot_type_number(fp, "port", adata->conn->account.port);
948 // dot_ptr(fp, "conn", adata->conn, "#ff8080");
950
951 dot_connection(fp, adata->conn, links);
952 dot_add_link(links, adata, adata->conn, "PopAccountData->conn", NULL, false, NULL);
953}
char login[128]
Login name.
Definition connaccount.h:55
time_t check_time
Last 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 )

Dump an account object.

Parameters
fpFile pointer
aAccount to dump
linksList of links

Definition at line 962 of file graphviz.c.

963{
964 dot_object_header(fp, a, "Account", "#80ffff");
965 dot_mailbox_type(fp, "type", a->type);
966 dot_type_string(fp, "name", a->name, true);
967 // dot_ptr(fp, "adata", a->adata, "#60c0c0");
969
970#ifndef GV_HIDE_ADATA
971 if (a->adata)
972 {
973 if (a->type == MUTT_IMAP)
974 dot_account_imap(fp, a->adata, links);
975 else if (a->type == MUTT_POP)
976 dot_account_pop(fp, a->adata, links);
977 else if (a->type == MUTT_MBOX)
978 dot_account_mbox(fp, a->adata, links);
979 else if (a->type == MUTT_NNTP)
980 dot_account_nntp(fp, a->adata, links);
981#ifdef USE_NOTMUCH
982 else if (a->type == MUTT_NOTMUCH)
983 dot_account_notmuch(fp, a->adata, links);
984#endif
985
986 dot_add_link(links, a, a->adata, "Account->adata", NULL, false, NULL);
987 }
988#endif
989
990#ifndef GV_HIDE_CONFIG
991 if (a->name)
992 {
993 dot_config(fp, a->name, 0, a->sub, links);
994 dot_add_link(links, a, a->name, "Config", NULL, false, NULL);
995
996 char name[256] = { 0 };
997 struct Buffer *buf = buf_pool_get();
998
999 buf_addstr(buf, "{ rank=same ");
1000
1001 dot_ptr_name(name, sizeof(name), a);
1002 buf_add_printf(buf, "%s ", name);
1003
1004 dot_ptr_name(name, sizeof(name), a->name);
1005 buf_add_printf(buf, "%s ", name);
1006
1007 buf_addstr(buf, "}");
1008 mutt_list_insert_tail(links, buf_strdup(buf));
1009 buf_pool_release(&buf);
1010 }
1011#endif
1012
1013 struct Mailbox **mp = ARRAY_FIRST(&a->mailboxes);
1014 if (mp && *mp)
1015 {
1016 dot_add_link(links, a, *mp, "Account->mailboxes", NULL, false, NULL);
1017 dot_mailbox_array(fp, &a->mailboxes, links);
1018 }
1019}
#define ARRAY_FIRST(head)
Convenience method to get the first element.
Definition array.h:136
void dot_account_pop(FILE *fp, struct PopAccountData *adata, struct ListHead *links)
Dump POP account data.
Definition graphviz.c:935
void dot_account_mbox(FILE *fp, struct MboxAccountData *adata, struct ListHead *links)
Dump Mbox account data.
Definition graphviz.c:851
void dot_account_imap(FILE *fp, struct ImapAccountData *adata, struct ListHead *links)
Dump IMAP account data.
Definition graphviz.c:823
void dot_account_notmuch(FILE *fp, struct NmAccountData *adata, struct ListHead *links)
Dump Notmuch account data.
Definition graphviz.c:921
void dot_account_nntp(FILE *fp, struct NntpAccountData *adata, struct ListHead *links)
Dump NNTP account data.
Definition graphviz.c:872
void dot_mailbox_array(FILE *fp, struct MailboxArray *ma, struct ListHead *links)
Dump an array of mailboxes.
Definition graphviz.c:766
enum MailboxType type
Type of Mailboxes this Account contains.
Definition account.h:37
char * name
Name of Account.
Definition account.h:38
struct MailboxArray mailboxes
All Mailboxes.
Definition account.h:40
struct ConfigSubset * sub
Inherited config items.
Definition account.h:39
void * adata
Private data (for Mailbox backends)
Definition account.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_account_array()

void dot_account_array ( FILE * fp,
struct AccountArray * aa,
struct ListHead * links )

Dump an array of accounts.

Parameters
fpFile pointer
aaAccount array
linksList of links

Definition at line 1027 of file graphviz.c.

1028{
1029 struct Account *prev = NULL;
1030 struct Account **ap = NULL;
1031 ARRAY_FOREACH(ap, aa)
1032 {
1033 struct Account *a = *ap;
1034
1035#ifdef GV_HIDE_MBOX
1036 if (a->type == MUTT_MBOX)
1037 continue;
1038#endif
1039 dot_account(fp, a, links);
1040 if (prev)
1041 dot_add_link(links, prev, a, "Account->next", NULL, false, NULL);
1042
1043 prev = a;
1044 }
1045}
void dot_account(FILE *fp, struct Account *a, struct ListHead *links)
Dump an account object.
Definition graphviz.c:962
A group of associated Mailboxes.
Definition account.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_mview()

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

Dump a mailbox view.

Parameters
fpFile pointer
mvMailbox view to dump
linksList of links

Definition at line 1054 of file graphviz.c.

1055{
1056 dot_object_header(fp, mv, "MailboxView", "#ff80ff");
1057 dot_ptr(fp, "mailbox", mv->mailbox, "#80ff80");
1058#ifdef GV_HIDE_MVIEW_CONTENTS
1059 dot_type_number(fp, "vsize", mv->vsize);
1060 dot_type_string(fp, "pattern", mv->pattern, true);
1061 dot_type_bool(fp, "collapsed", mv->collapsed);
1062#endif
1064}
bool collapsed
Are all threads collapsed?
Definition mview.h:49
off_t vsize
Size (in bytes) of the messages shown.
Definition mview.h:41
struct Mailbox * mailbox
Current Mailbox.
Definition mview.h:51
char * pattern
Limit pattern string.
Definition mview.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_graphviz()

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

Dump NeoMutt data structures to GraphViz format.

Parameters
titleOptional title for the output file
mvMailbox view to dump

Definition at line 1072 of file graphviz.c.

1073{
1074 char name[256] = { 0 };
1075 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1076
1077 time_t now = time(NULL);
1078 if (title)
1079 {
1080 char date[128];
1081 mutt_date_localtime_format(date, sizeof(date), "%T", now);
1082 snprintf(name, sizeof(name), "%s-%s.gv", date, title);
1083 }
1084 else
1085 {
1086 mutt_date_localtime_format(name, sizeof(name), "%T.gv", now);
1087 }
1088
1089 umask(022);
1090 FILE *fp = fopen(name, "w");
1091 if (!fp)
1092 return;
1093
1094 dot_graph_header(fp);
1095
1096#ifndef GV_HIDE_NEOMUTT
1097 dot_node(fp, NeoMutt, "NeoMutt", "#ffa500");
1098 struct Account **ap = ARRAY_FIRST(&NeoMutt->accounts);
1099 if (ap && *ap)
1100 {
1101 dot_add_link(&links, NeoMutt, *ap, "NeoMutt->accounts", NULL, false, NULL);
1102 }
1103#ifndef GV_HIDE_CONFIG
1104 dot_config(fp, (const char *) NeoMutt->sub, 0, NeoMutt->sub, &links);
1105 dot_add_link(&links, NeoMutt, NeoMutt->sub, "NeoMutt Config", NULL, false, NULL);
1106 struct Buffer *buf = buf_pool_get();
1107 char obj1[64] = { 0 };
1108 char obj2[64] = { 0 };
1109 dot_ptr_name(obj1, sizeof(obj1), NeoMutt);
1110 dot_ptr_name(obj2, sizeof(obj2), NeoMutt->sub);
1111 buf_printf(buf, "{ rank=same %s %s }", obj1, obj2);
1112 mutt_list_insert_tail(&links, buf_strdup(buf));
1113 buf_pool_release(&buf);
1114#endif
1115#endif
1116
1117 dot_account_array(fp, &NeoMutt->accounts, &links);
1118
1119#ifndef GV_HIDE_MVIEW
1120 if (mv)
1121 dot_mview(fp, mv, &links);
1122
1123#ifndef GV_HIDE_NEOMUTT
1124 /* Globals */
1125 fprintf(fp, "\t{ rank=same ");
1126 if (mv)
1127 {
1128 dot_ptr_name(name, sizeof(name), mv);
1129 fprintf(fp, "%s ", name);
1130 }
1131 dot_ptr_name(name, sizeof(name), NeoMutt);
1132 fprintf(fp, "%s ", name);
1133 fprintf(fp, "}\n");
1134#endif
1135#endif
1136
1137 fprintf(fp, "\t{ rank=same ");
1139 {
1140 struct Account *a = *ap;
1141
1142#ifdef GV_HIDE_MBOX
1143 if (a->type == MUTT_MBOX)
1144 continue;
1145#endif
1146 dot_ptr_name(name, sizeof(name), a);
1147 fprintf(fp, "%s ", name);
1148 }
1149 fprintf(fp, "}\n");
1150
1151 dot_graph_footer(fp, &links);
1152 fclose(fp);
1153 mutt_list_free(&links);
1154}
void dot_graph_header(FILE *fp)
Write GraphViz graph header.
Definition graphviz.c:307
void dot_account_array(FILE *fp, struct AccountArray *aa, struct ListHead *links)
Dump an array of accounts.
Definition graphviz.c:1027
void dot_mview(FILE *fp, const struct MailboxView *mv, struct ListHead *links)
Dump a mailbox view.
Definition graphviz.c:1054
void dot_graph_footer(FILE *fp, struct ListHead *links)
Write GraphViz graph footer with links.
Definition graphviz.c:335
void dot_node(FILE *fp, void *ptr, const char *name, const char *colour)
Write a simple GraphViz node.
Definition graphviz.c:388
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition list.c:123
#define STAILQ_HEAD_INITIALIZER(head)
Definition queue.h:324
Container for Accounts, Notifications.
Definition neomutt.h:41
struct AccountArray accounts
All Accounts.
Definition neomutt.h:50
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ 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 1157 of file graphviz.c.

1158{
1159 if (!pl)
1160 return;
1161 if (TAILQ_EMPTY(pl))
1162 return;
1163
1164 dot_object_header(fp, pl, "ParameterList", "#00ff00");
1165
1166 struct Parameter *np = NULL;
1167 TAILQ_FOREACH(np, pl, entries)
1168 {
1169 dot_type_string(fp, np->attribute, np->value, false);
1170 }
1171
1173}
#define TAILQ_FOREACH(var, head, field)
Definition queue.h:782
#define TAILQ_EMPTY(head)
Definition queue.h:778
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 )

Helper to add a boolean content flag to graphviz output

Definition at line 1175 of file graphviz.c.

1176{
1177 struct Buffer *buf = buf_pool_get();
1178
1179 dot_object_header(fp, cont, "Content", "#800080");
1180
1181 dot_type_number(fp, "hibin", cont->hibin);
1182 dot_type_number(fp, "lobin", cont->lobin);
1183 dot_type_number(fp, "nulbin", cont->nulbin);
1184 dot_type_number(fp, "crlf", cont->crlf);
1185 dot_type_number(fp, "ascii", cont->ascii);
1186 dot_type_number(fp, "linemax", cont->linemax);
1187
1189#define ADD_BOOL(F) add_flag(buf, cont->F, #F)
1190 ADD_BOOL(space);
1191 ADD_BOOL(binary);
1192 ADD_BOOL(from);
1193 ADD_BOOL(dot);
1194 ADD_BOOL(cr);
1195#undef ADD_BOOL
1196
1198
1199 buf_pool_release(&buf);
1200}
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 1203 of file graphviz.c.

1204{
1205 if (!aptr)
1206 return;
1207
1208 dot_object_header(fp, aptr, "AttachPtr", "#ff0000");
1209
1210 dot_type_file(fp, "fp", aptr->fp);
1211
1212 dot_type_string(fp, "parent_type", name_content_type(aptr->parent_type), false);
1213
1214 dot_type_number(fp, "level", aptr->level);
1215 dot_type_number(fp, "num", aptr->num);
1216
1217 dot_type_bool(fp, "unowned", aptr->unowned);
1218 dot_type_bool(fp, "collapsed", aptr->collapsed);
1219 dot_type_bool(fp, "decrypted", aptr->decrypted);
1220
1222
1223 dot_add_link(links, aptr->body, aptr, "AttachPtr->body", NULL, true, NULL);
1224}
const char * name_content_type(enum ContentType type)
Get the name of a content type.
Definition names.c:154
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,
const struct Body * b,
struct ListHead * links,
bool link_next )

Helper to add a boolean body flag to graphviz output

Definition at line 1226 of file graphviz.c.

1227{
1228 struct Buffer *buf = buf_pool_get();
1229
1230 dot_object_header(fp, b, "Body", "#2020ff");
1231
1232 char file[256];
1233 dot_path_fs(file, sizeof(file), b->filename);
1234 dot_type_string(fp, "file", file, false);
1235
1236 dot_type_string(fp, "charset", b->charset, false);
1237 dot_type_string(fp, "description", b->description, false);
1238 dot_type_string(fp, "d_filename", b->d_filename, false);
1239 dot_type_string(fp, "form_name", b->form_name, false);
1240 dot_type_string(fp, "language", b->language, false);
1241 dot_type_string(fp, "subtype", b->subtype, false);
1242 dot_type_string(fp, "xtype", b->xtype, false);
1243
1244 dot_type_string(fp, "type", name_content_type(b->type), true);
1245 dot_type_string(fp, "encoding", name_content_encoding(b->encoding), true);
1246 dot_type_string(fp, "disposition", name_content_disposition(b->disposition), true);
1247
1248 if (b->stamp != 0)
1249 {
1250 char arr[64];
1251 dot_type_date(arr, sizeof(arr), b->stamp);
1252 dot_type_string(fp, "stamp", arr, true);
1253 }
1254
1256#define ADD_BOOL(F) add_flag(buf, b->F, #F)
1257 ADD_BOOL(attach_qualifies);
1258 ADD_BOOL(badsig);
1259 ADD_BOOL(deleted);
1260 ADD_BOOL(force_charset);
1261 ADD_BOOL(goodsig);
1262#ifdef USE_AUTOCRYPT
1263 ADD_BOOL(is_autocrypt);
1264#endif
1265 ADD_BOOL(noconv);
1266 ADD_BOOL(tagged);
1267 ADD_BOOL(unlink);
1268 ADD_BOOL(use_disp);
1269 ADD_BOOL(warnsig);
1270#undef ADD_BOOL
1271 dot_type_string(fp, "bools", buf_is_empty(buf) ? "[NONE]" : buf_string(buf), true);
1272
1273 dot_type_number(fp, "attach_count", b->attach_count);
1274 dot_type_number(fp, "hdr_offset", b->hdr_offset);
1275 dot_type_number(fp, "length", b->length);
1276 dot_type_number(fp, "offset", b->offset);
1277
1278 dot_ptr(fp, "aptr", b->aptr, "#3bcbc4");
1279
1280#ifdef GV_HIDE_BODY_CONTENT
1281 if (!TAILQ_EMPTY(&b->parameter))
1282 {
1283 struct Parameter *param = TAILQ_FIRST(&b->parameter);
1284 if (mutt_str_equal(param->attribute, "boundary"))
1285 {
1286 dot_type_string(fp, "boundary", param->value, false);
1287 }
1288 }
1289#endif
1290
1292
1293#ifndef GV_HIDE_BODY_CONTENT
1294 if (!TAILQ_EMPTY(&b->parameter))
1295 {
1296 dot_parameter_list(fp, "parameter", &b->parameter);
1297 dot_add_link(links, b, &b->parameter, "Body->mime_headers", NULL, false, NULL);
1298 }
1299#endif
1300
1301#ifndef GV_HIDE_ENVELOPE
1302 if (b->mime_headers)
1303 {
1304 dot_envelope(fp, b->mime_headers, links);
1305 dot_add_link(links, b, b->mime_headers, "Body->mime_headers", NULL, false, NULL);
1306 }
1307#endif
1308
1309 if (b->email)
1310 {
1311 dot_email(fp, b->email, links);
1312 dot_add_link(links, b, b->email, "Body->email", NULL, false, NULL);
1313 }
1314
1315 if (b->parts)
1316 {
1317 if (!b->email)
1318 dot_body(fp, b->parts, links, true);
1319 dot_add_link(links, b, b->parts, "Body->parts", NULL, false, "#ff0000");
1320 }
1321
1322 if (b->next && link_next)
1323 {
1324 char name[256] = { 0 };
1325 buf_reset(buf);
1326
1327 buf_addstr(buf, "{ rank=same ");
1328
1329 dot_ptr_name(name, sizeof(name), b);
1330 buf_add_printf(buf, "%s ", name);
1331
1332 for (; b->next; b = b->next)
1333 {
1334 dot_body(fp, b->next, links, false);
1335 dot_add_link(links, b, b->next, "Body->next", NULL, false, "#008000");
1336
1337 dot_ptr_name(name, sizeof(name), b->next);
1338 buf_add_printf(buf, "%s ", name);
1339 }
1340
1341 buf_addstr(buf, "}");
1342 mutt_list_insert_tail(links, buf_strdup(buf));
1343 }
1344 else
1345 {
1346#ifndef GV_HIDE_BODY_CONTENT
1347 if (b->content)
1348 {
1349 dot_content(fp, b->content, links);
1350 dot_add_link(links, b, b->content, "Body->content", NULL, false, NULL);
1351 }
1352#endif
1353
1354 // if (b->aptr)
1355 // {
1356 // dot_attach_ptr(fp, b->aptr, links);
1357 // dot_add_link(links, b, b->aptr, "Body->aptr", NULL, false, NULL);
1358 // }
1359 }
1360
1361 buf_pool_release(&buf);
1362}
const char * name_content_encoding(enum ContentEncoding enc)
Get the name of a content encoding.
Definition names.c:177
const char * name_content_disposition(enum ContentDisposition disp)
Get the name of a content disposition.
Definition names.c:197
void dot_parameter_list(FILE *fp, const char *name, const struct ParameterList *pl)
Definition graphviz.c:1157
void dot_content(FILE *fp, struct Content *cont, struct ListHead *links)
Definition graphviz.c:1175
void dot_email(FILE *fp, const struct Email *e, struct ListHead *links)
Definition graphviz.c:1463
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:662
#define TAILQ_FIRST(head)
Definition queue.h:780
char * language
content-language (RFC8255)
Definition body.h:78
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:73
LOFF_T offset
offset where the actual data begins
Definition body.h:52
signed short attach_count
Number of attachments.
Definition body.h:91
char * xtype
content-type if x-unknown
Definition body.h:62
time_t stamp
Time stamp of last encoding update.
Definition body.h:77
struct Envelope * mime_headers
Memory hole protected headers.
Definition body.h:76
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:79
struct ParameterList parameter
Parameters of the content-type.
Definition body.h:63
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition body.h:75
struct Email * email
header information for message/rfc822
Definition body.h:74
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:70
struct Body * next
next attachment in the list
Definition body.h:72
char * subtype
content-type subtype
Definition body.h:61
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition body.h:41
long hdr_offset
Offset in stream where the headers begin.
Definition body.h:81
char * form_name
Content-Disposition form-data name param.
Definition body.h:60
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:59
+ 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 1365 of file graphviz.c.

1366{
1367 if (!list || !name)
1368 return;
1369 if (STAILQ_EMPTY(list))
1370 return;
1371
1372 struct Buffer *buf = buf_pool_get();
1373
1374 struct ListNode *np = NULL;
1375 STAILQ_FOREACH(np, list, entries)
1376 {
1377 if (!buf_is_empty(buf))
1378 buf_addch(buf, ',');
1379 buf_addstr(buf, np->data);
1380 }
1381
1382 dot_type_string(fp, name, buf_string(buf), false);
1383 buf_pool_release(&buf);
1384}
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition buffer.c:241
#define STAILQ_EMPTY(head)
Definition queue.h:382
+ 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 1386 of file graphviz.c.

1388{
1389 if (!al)
1390 return;
1391 if (TAILQ_EMPTY(al))
1392 return;
1393
1394 struct Buffer *buf = buf_pool_get();
1395 mutt_addrlist_write(al, buf, true);
1396 dot_type_string(fp, name, buf_string(buf), false);
1397 buf_pool_release(&buf);
1398}
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition address.c:1210
+ Here is the call graph for this function:

◆ dump_graphviz_body()

void dump_graphviz_body ( const struct Body * b)

Definition at line 1586 of file graphviz.c.

1587{
1588 char name[256] = { 0 };
1589 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1590
1591 time_t now = time(NULL);
1592 mutt_date_localtime_format(name, sizeof(name), "%T-email.gv", now);
1593
1594 umask(022);
1595 FILE *fp = fopen(name, "w");
1596 if (!fp)
1597 return;
1598
1599 dot_graph_header(fp);
1600
1601 dot_body(fp, b, &links, true);
1602
1603 dot_graph_footer(fp, &links);
1604 fclose(fp);
1605 mutt_list_free(&links);
1606}
+ Here is the call graph for this function:

◆ dump_graphviz_email()

void dump_graphviz_email ( const struct Email * e,
const char * title )

Definition at line 1608 of file graphviz.c.

1609{
1610 char name[256] = { 0 };
1611 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1612
1613 if (!title)
1614 title = "email";
1615
1616 char format[64];
1617 snprintf(format, sizeof(format), "%%T-%s.gv", title);
1618
1619 time_t now = time(NULL);
1620 mutt_date_localtime_format(name, sizeof(name), format, now);
1621
1622 umask(022);
1623 FILE *fp = fopen(name, "w");
1624 if (!fp)
1625 return;
1626
1627 dot_graph_header(fp);
1628
1629 dot_email(fp, e, &links);
1630
1631 dot_graph_footer(fp, &links);
1632 fclose(fp);
1633 mutt_list_free(&links);
1634}
+ 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 1636 of file graphviz.c.

1637{
1638 if (!aptr)
1639 return;
1640
1641 dot_object_header(fp, aptr, "AttachPtr", "#3bcbc4");
1642
1643 dot_ptr(fp, "body", aptr->body, "#2020ff");
1644 dot_type_file(fp, "fp", aptr->fp);
1645
1646 dot_type_string(fp, "parent_type", name_content_type(aptr->parent_type), false);
1647 dot_type_number(fp, "level", aptr->level);
1648 dot_type_number(fp, "num", aptr->num);
1649 dot_type_bool(fp, "unowned", aptr->unowned);
1650 dot_type_bool(fp, "collapsed", aptr->collapsed);
1651 dot_type_bool(fp, "decrypted", aptr->decrypted);
1652
1653 // dot_type_string(fp, "tree", aptr->tree, false);
1654
1656}
+ 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 1658 of file graphviz.c.

1660{
1661 dot_object_header(fp, idx, "AttachCtx-&gt;idx", "#9347de");
1662
1663 dot_type_number(fp, "idxlen", idxlen);
1664 dot_type_number(fp, "idxmax", idxmax);
1665
1666 char arr[32];
1667 for (size_t i = 0; i < idxmax; i++)
1668 {
1669 snprintf(arr, sizeof(arr), "idx[%zu]", i);
1670 dot_ptr(fp, arr, idx[i], "#3bcbc4");
1671 }
1672
1674
1675 for (size_t i = 0; i < idxlen; i++)
1676 {
1677 dot_attach_ptr2(fp, idx[i], links);
1678 dot_add_link(links, idx, idx[i], "AttachCtx-&gt;idx", NULL, false, NULL);
1679 }
1680}
void dot_attach_ptr2(FILE *fp, struct AttachPtr *aptr, struct ListHead *links)
Definition graphviz.c:1636
+ 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 1682 of file graphviz.c.

1683{
1684 dot_object_header(fp, v2r, "AttachCtx-&gt;v2r", "#9347de");
1685
1686 dot_type_number(fp, "vcount", vcount);
1687
1688 char arr[32];
1689 for (size_t i = 0; i < vcount; i++)
1690 {
1691 snprintf(arr, sizeof(arr), "v2r[%zu]", i);
1692 dot_type_number(fp, arr, v2r[i]);
1693 }
1694
1696}
+ 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 1698 of file graphviz.c.

1700{
1701 dot_object_header(fp, fp_idx, "AttachCtx-&gt;fp_idx", "#f86e28");
1702
1703 dot_type_number(fp, "fp_len", fp_len);
1704 dot_type_number(fp, "fp_max", fp_max);
1705
1706 char arr[32];
1707 for (size_t i = 0; i < fp_max; i++)
1708 {
1709 snprintf(arr, sizeof(arr), "fp_idx[%zu]", i);
1710 dot_type_file(fp, arr, fp_idx[i]);
1711 }
1712
1714}
+ 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 1716 of file graphviz.c.

1718{
1719 dot_object_header(fp, body_idx, "AttachCtx-&gt;body_idx", "#4ff270");
1720
1721 dot_type_number(fp, "body_len", body_len);
1722 dot_type_number(fp, "body_max", body_max);
1723
1724 char arr[32];
1725 for (size_t i = 0; i < body_max; i++)
1726 {
1727 snprintf(arr, sizeof(arr), "body_idx[%zu]", i);
1728 dot_ptr(fp, arr, body_idx[i], "#2020ff");
1729 }
1730
1732
1733 for (size_t i = 0; i < body_max; i++)
1734 {
1735 if (!body_idx[i])
1736 continue;
1737 dot_body(fp, body_idx[i], links, true);
1738 dot_add_link(links, body_idx, body_idx[i], "AttachCtx->Body", NULL, false, "#008000");
1739 }
1740}
+ 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,
const struct AttachCtx * actx,
struct ListHead * links )

Definition at line 1742 of file graphviz.c.

1743{
1744 dot_object_header(fp, actx, "AttachCtx", "#9347de");
1745
1746 dot_ptr(fp, "email", actx->email, "#ff80ff");
1747 dot_type_file(fp, "fp_root", actx->fp_root);
1748
1750
1751 if (actx->idx)
1752 {
1753 dot_array_actx_idx(fp, actx->idx, actx->idxlen, actx->idxmax, links);
1754 dot_add_link(links, actx, actx->idx, "AttachCtx-&gt;idx", NULL, false, NULL);
1755 }
1756
1757 if (actx->v2r)
1758 {
1759 dot_array_actx_v2r(fp, actx->v2r, actx->vcount, links);
1760 dot_add_link(links, actx, actx->v2r, "AttachCtx-&gt;v2r", NULL, false, NULL);
1761 }
1762
1763 if (actx->fp_idx)
1764 {
1765 dot_array_actx_fp_idx(fp, actx->fp_idx, actx->fp_len, actx->fp_max, links);
1766 dot_add_link(links, actx, actx->fp_idx, "AttachCtx-&gt;fp_idx", NULL, false, NULL);
1767 }
1768
1769 if (actx->body_idx)
1770 {
1771 dot_array_actx_body_idx(fp, actx->body_idx, actx->body_len, actx->body_max, links);
1772 dot_add_link(links, actx, actx->body_idx, "AttachCtx-&gt;body_idx", NULL, false, NULL);
1773 }
1774}
void dot_array_actx_idx(FILE *fp, struct AttachPtr **idx, short idxlen, short idxmax, struct ListHead *links)
Definition graphviz.c:1658
void dot_array_actx_v2r(FILE *fp, short *v2r, short vcount, struct ListHead *links)
Definition graphviz.c:1682
void dot_array_actx_body_idx(FILE *fp, struct Body **body_idx, short body_len, short body_max, struct ListHead *links)
Definition graphviz.c:1716
void dot_array_actx_fp_idx(FILE *fp, FILE **fp_idx, short fp_len, short fp_max, struct ListHead *links)
Definition graphviz.c:1698
short vcount
The number of virtual attachments.
Definition attach.h:72
short body_len
Number of Body parts.
Definition attach.h:79
FILE * fp_root
Used by recvattach for updating.
Definition attach.h:65
short fp_max
Size of FILE array.
Definition attach.h:76
struct Email * email
Used by recvattach for updating.
Definition attach.h:64
struct AttachPtr ** idx
Array of attachments.
Definition attach.h:67
struct Body ** body_idx
Extra struct Body* used for decryption.
Definition attach.h:78
short fp_len
Number of FILE handles.
Definition attach.h:75
short body_max
Size of Body array.
Definition attach.h:80
FILE ** fp_idx
Extra FILE* used for decryption.
Definition attach.h:74
short idxmax
Size of attachment array.
Definition attach.h:69
short idxlen
Number of attachmentes.
Definition attach.h:68
short * v2r
Mapping from virtual to real attachment.
Definition attach.h:71
+ 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 ( const struct AttachCtx * actx)

Definition at line 1776 of file graphviz.c.

1777{
1778 char name[256] = { 0 };
1779 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1780
1781 time_t now = time(NULL);
1782 mutt_date_localtime_format(name, sizeof(name), "%T-actx.gv", now);
1783
1784 umask(022);
1785 FILE *fp = fopen(name, "w");
1786 if (!fp)
1787 return;
1788
1789 dot_graph_header(fp);
1790
1791 dot_attach_ctx(fp, actx, &links);
1792
1793 dot_graph_footer(fp, &links);
1794 fclose(fp);
1795 mutt_list_free(&links);
1796}
void dot_attach_ctx(FILE *fp, const struct AttachCtx *actx, struct ListHead *links)
Definition graphviz.c:1742
+ Here is the call graph for this function:

◆ pattern_type_name()

const char * pattern_type_name ( int type)

Definition at line 1798 of file graphviz.c.

1799{
1800 static struct Mapping PatternNames[] = {
1801 // clang-format off
1802 { "address", MUTT_PAT_ADDRESS },
1803 { "AND", MUTT_PAT_AND },
1804 { "bcc", MUTT_PAT_BCC },
1805 { "body", MUTT_PAT_BODY },
1806 { "broken", MUTT_PAT_BROKEN },
1807 { "cc", MUTT_PAT_CC },
1808 { "children", MUTT_PAT_CHILDREN },
1809 { "collapsed", MUTT_PAT_COLLAPSED },
1810 { "crypt_encrypt", MUTT_PAT_CRYPT_ENCRYPT },
1811 { "crypt_sign", MUTT_PAT_CRYPT_SIGN },
1812 { "crypt_verified", MUTT_PAT_CRYPT_VERIFIED },
1813 { "date", MUTT_PAT_DATE },
1814 { "date_received", MUTT_PAT_DATE_RECEIVED },
1815 { "driver_tags", MUTT_PAT_DRIVER_TAGS },
1816 { "duplicated", MUTT_PAT_DUPLICATED },
1817 { "from", MUTT_PAT_FROM },
1818 { "header", MUTT_PAT_HEADER },
1819 { "hormel", MUTT_PAT_HORMEL },
1820 { "id", MUTT_PAT_ID },
1821 { "id_external", MUTT_PAT_ID_EXTERNAL },
1822 { "list", MUTT_PAT_LIST },
1823 { "message", MUTT_PAT_MESSAGE },
1824 { "mimeattach", MUTT_PAT_MIMEATTACH },
1825 { "mimetype", MUTT_PAT_MIMETYPE },
1826 { "newsgroups", MUTT_PAT_NEWSGROUPS },
1827 { "OR", MUTT_PAT_OR },
1828 { "parent", MUTT_PAT_PARENT },
1829 { "personal_from", MUTT_PAT_PERSONAL_FROM },
1830 { "personal_recip", MUTT_PAT_PERSONAL_RECIP },
1831 { "pgp_key", MUTT_PAT_PGP_KEY },
1832 { "recipient", MUTT_PAT_RECIPIENT },
1833 { "reference", MUTT_PAT_REFERENCE },
1834 { "score", MUTT_PAT_SCORE },
1835 { "sender", MUTT_PAT_SENDER },
1836 { "serversearch", MUTT_PAT_SERVERSEARCH },
1837 { "size", MUTT_PAT_SIZE },
1838 { "subject", MUTT_PAT_SUBJECT },
1839 { "subscribed_list", MUTT_PAT_SUBSCRIBED_LIST },
1840 { "thread", MUTT_PAT_THREAD },
1841 { "to", MUTT_PAT_TO },
1842 { "unreferenced", MUTT_PAT_UNREFERENCED },
1843 { "whole_msg", MUTT_PAT_WHOLE_MSG },
1844 { "xlabel", MUTT_PAT_XLABEL },
1845 { NULL, 0 },
1846 // clang-format on
1847 };
1848
1849 return mutt_map_get_name(type, PatternNames);
1850}
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:157
@ MUTT_PAT_WHOLE_MSG
Pattern matches raw email text.
Definition lib.h:159
@ MUTT_PAT_BROKEN
Message is part of a broken thread.
Definition lib.h:153
@ MUTT_PAT_ID_EXTERNAL
Message-Id is among results from an external query.
Definition lib.h:155
@ MUTT_PAT_OR
Either pattern can match.
Definition lib.h:139
@ MUTT_PAT_CHILDREN
Pattern matches a child email.
Definition lib.h:142
@ MUTT_PAT_PARENT
Pattern matches parent.
Definition lib.h:141
@ MUTT_PAT_REFERENCE
Pattern matches 'References:' or 'In-Reply-To:' field.
Definition lib.h:164
@ MUTT_PAT_FROM
Pattern matches 'From:' field.
Definition lib.h:148
@ MUTT_PAT_DRIVER_TAGS
Pattern matches message tags.
Definition lib.h:177
@ MUTT_PAT_COLLAPSED
Thread is collapsed.
Definition lib.h:146
@ MUTT_PAT_CRYPT_VERIFIED
Message is crypographically verified.
Definition lib.h:172
@ MUTT_PAT_HORMEL
Pattern matches email's spam score.
Definition lib.h:158
@ MUTT_PAT_SUBJECT
Pattern matches 'Subject:' field.
Definition lib.h:147
@ MUTT_PAT_LIST
Email is on mailing list.
Definition lib.h:166
@ MUTT_PAT_NEWSGROUPS
Pattern matches newsgroup.
Definition lib.h:180
@ MUTT_PAT_PERSONAL_RECIP
Email is addressed to the user.
Definition lib.h:168
@ MUTT_PAT_CC
Pattern matches 'Cc:' field.
Definition lib.h:144
@ MUTT_PAT_SUBSCRIBED_LIST
Email is on subscribed mailing list.
Definition lib.h:167
@ MUTT_PAT_SERVERSEARCH
Server-side pattern matches.
Definition lib.h:176
@ MUTT_PAT_RECIPIENT
User is a recipient of the email.
Definition lib.h:165
@ MUTT_PAT_CRYPT_ENCRYPT
Message is encrypted.
Definition lib.h:173
@ MUTT_PAT_UNREFERENCED
Message is unreferenced in the thread.
Definition lib.h:152
@ MUTT_PAT_CRYPT_SIGN
Message is signed.
Definition lib.h:171
@ MUTT_PAT_MESSAGE
Pattern matches message number.
Definition lib.h:161
@ MUTT_PAT_AND
Both patterns must match.
Definition lib.h:138
@ MUTT_PAT_DATE
Pattern matches 'Date:' field.
Definition lib.h:149
@ MUTT_PAT_XLABEL
Pattern matches keyword/label.
Definition lib.h:175
@ MUTT_PAT_SCORE
Pattern matches email's score.
Definition lib.h:162
@ MUTT_PAT_MIMEATTACH
Pattern matches number of attachments.
Definition lib.h:178
@ MUTT_PAT_DUPLICATED
Duplicate message.
Definition lib.h:151
@ MUTT_PAT_PERSONAL_FROM
Email is from the user.
Definition lib.h:169
@ MUTT_PAT_TO
Pattern matches 'To:' field.
Definition lib.h:143
@ MUTT_PAT_BCC
Pattern matches 'Bcc:' field.
Definition lib.h:145
@ MUTT_PAT_SENDER
Pattern matches sender.
Definition lib.h:160
@ MUTT_PAT_DATE_RECEIVED
Pattern matches date received.
Definition lib.h:150
@ MUTT_PAT_ADDRESS
Pattern matches any address field.
Definition lib.h:170
@ MUTT_PAT_MIMETYPE
Pattern matches MIME type.
Definition lib.h:179
@ MUTT_PAT_PGP_KEY
Message has PGP key.
Definition lib.h:174
@ MUTT_PAT_ID
Pattern matches email's Message-Id.
Definition lib.h:154
@ MUTT_PAT_THREAD
Pattern matches email thread.
Definition lib.h:140
@ MUTT_PAT_SIZE
Pattern matches email's size.
Definition lib.h:163
@ MUTT_PAT_BODY
Pattern matches email's body.
Definition lib.h:156
Mapping between user-readable string and a constant.
Definition mapping.h:33
+ 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 1852 of file graphviz.c.

1853{
1854 struct Buffer *buf = buf_pool_get();
1855 dot_object_header(fp, pat, "Pattern", "#c040c0");
1856
1857 dot_type_string(fp, "op", pattern_type_name(pat->op), true);
1858 if ((pat->min != 0) || (pat->max != 0))
1859 {
1860 dot_type_number(fp, "min", pat->min);
1861 dot_type_number(fp, "max", pat->max);
1862 }
1863
1864#define ADD_BOOL(F) add_flag(buf, pat->F, #F)
1865 ADD_BOOL(pat_not);
1866 ADD_BOOL(all_addr);
1867 ADD_BOOL(string_match);
1869 ADD_BOOL(ign_case);
1870 ADD_BOOL(is_alias);
1871 ADD_BOOL(dynamic);
1872 ADD_BOOL(sendmode);
1873 ADD_BOOL(is_multi);
1874#undef ADD_BOOL
1875 dot_type_string(fp, "flags", buf_is_empty(buf) ? "[NONE]" : buf_string(buf), true);
1876
1877 if (pat->group_match)
1878 {
1879 // struct Group *group; ///< Address group if group_match is set
1880 }
1881 else if (pat->string_match)
1882 {
1883 dot_type_string(fp, "str", pat->p.str, true);
1884 }
1885 else if (pat->is_multi)
1886 {
1887 // struct ListHead multi_cases; ///< Multiple strings for ~I pattern
1888 }
1889 else
1890 {
1891 if (pat->p.regex)
1892 {
1893 dot_ptr(fp, "regex", pat->p.regex, NULL);
1894 dot_type_string(fp, "pattern", pat->raw_pattern, true);
1895 }
1896 }
1897
1899
1900 if (pat->child)
1901 {
1902 dot_patternlist(fp, pat->child, links);
1903 struct Pattern *first = SLIST_FIRST(pat->child);
1904 dot_add_link(links, pat, first, "Pattern->child", NULL, false, "#00ff00");
1905 }
1906 buf_pool_release(&buf);
1907}
bool group_match(struct Group *g, const char *str)
Does a string match an entry in a Group?
Definition group.c:161
const char * pattern_type_name(int type)
Definition graphviz.c:1798
void dot_patternlist(FILE *fp, const struct PatternList *pl, struct ListHead *links)
Definition graphviz.c:1909
#define SLIST_FIRST(head)
Definition queue.h:227
bool group_match
Check a group of Addresses.
Definition lib.h:83
union Pattern::@006112053024257132210207314205210350156165326341 p
struct PatternList * child
Arguments to logical operation.
Definition lib.h:91
long min
Minimum for range checks.
Definition lib.h:89
bool string_match
Check a string for a match.
Definition lib.h:82
regex_t * regex
Compiled regex, for non-pattern matching.
Definition lib.h:93
char * str
String, if string_match is set.
Definition lib.h:95
long max
Maximum for range checks.
Definition lib.h:90
short op
Operation, e.g. MUTT_PAT_SCORE.
Definition lib.h:79
bool is_multi
Multiple case (only for ~I pattern now)
Definition lib.h:88
+ 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 1935 of file graphviz.c.

1936{
1937 char name[256] = { 0 };
1938 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
1939
1940 time_t now = time(NULL);
1941 mutt_date_localtime_format(name, sizeof(name), "%T-pattern.gv", now);
1942
1943 umask(022);
1944 FILE *fp = fopen(name, "w");
1945 if (!fp)
1946 return;
1947
1948 dot_graph_header(fp);
1949
1950 dot_patternlist(fp, pl, &links);
1951
1952 dot_graph_footer(fp, &links);
1953 fclose(fp);
1954 mutt_list_free(&links);
1955}
+ Here is the call graph for this function:

◆ dot_format()

void dot_format ( FILE * fp,
struct ExpandoFormat * fmt )

Definition at line 1957 of file graphviz.c.

1958{
1959 if (!fmt)
1960 return;
1961
1962 dot_type_number(fp, "min_cols", fmt->min_cols);
1963 dot_type_number(fp, "max_cols", fmt->max_cols);
1964
1965 char *just = "UNKNOWN";
1966 switch (fmt->justification)
1967 {
1968 case JUSTIFY_LEFT:
1969 just = "JUSTIFY_LEFT";
1970 break;
1971 case JUSTIFY_CENTER:
1972 just = "JUSTIFY_CENTER";
1973 break;
1974 case JUSTIFY_RIGHT:
1975 just = "JUSTIFY_RIGHT";
1976 break;
1977 }
1978 dot_type_string(fp, "justification", just, true);
1979 dot_type_char(fp, "leader", fmt->leader);
1980}
@ JUSTIFY_RIGHT
Right justify the text.
Definition format.h:36
@ JUSTIFY_LEFT
Left justify the text.
Definition format.h:34
@ JUSTIFY_CENTER
Centre the text.
Definition format.h:35
char leader
Leader character, 0 or space.
Definition node.h:57
enum FormatJustify justification
Justification: left, centre, right.
Definition node.h:56
int min_cols
Minimum number of screen columns.
Definition node.h:54
int max_cols
Maximum number of screen columns.
Definition node.h:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_empty()

void dot_expando_node_empty ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 1982 of file graphviz.c.

1983{
1984 dot_object_header(fp, node, "Empty", "#ffffff");
1985 // dot_type_string(fp, "type", "ENT_EMPTY", true);
1987}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_text()

void dot_expando_node_text ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 1989 of file graphviz.c.

1990{
1991 struct Buffer *buf = buf_pool_get();
1992 dot_object_header(fp, node, "Text", "#ffff80");
1993 // dot_type_string(fp, "type", "ENT_TEXT", true);
1994 dot_type_string(fp, "text", node->text, false);
1995
1997
1998 buf_pool_release(&buf);
1999}
const char * text
Node-specific text.
Definition node.h:73
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_pad()

void dot_expando_node_pad ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2001 of file graphviz.c.

2002{
2003 struct Buffer *buf = buf_pool_get();
2004 dot_object_header(fp, node, "Pad", "#80ffff");
2005 // dot_type_string(fp, "type", "ENT_PADDING", true);
2006
2007 struct NodePaddingPrivate *priv = node->ndata;
2008 char *pad = "UNKNOWN";
2009 switch (priv->pad_type)
2010 {
2011 case EPT_FILL_EOL:
2012 pad = "EPT_FILL_EOL";
2013 break;
2014 case EPT_HARD_FILL:
2015 pad = "EPT_HARD_FILL";
2016 break;
2017 case EPT_SOFT_FILL:
2018 pad = "EPT_SOFT_FILL";
2019 break;
2020 }
2021 dot_type_string(fp, "type", pad, true);
2022 dot_type_string(fp, "char", node->text, false);
2023
2025
2026 struct ExpandoNode *left = node_get_child((struct ExpandoNode *) node, ENP_LEFT);
2027 if (left)
2028 {
2029 dot_expando_node(fp, left, links);
2030 dot_add_link(links, node, left, "Pad->left", "left", false, "#80ff80");
2031 }
2032
2033 struct ExpandoNode *right = node_get_child((struct ExpandoNode *) node, ENP_RIGHT);
2034 if (right)
2035 {
2036 dot_expando_node(fp, right, links);
2037 dot_add_link(links, node, right, "Pad->right", "right", false, "#ff8080");
2038 }
2039
2040 buf_pool_release(&buf);
2041}
void dot_expando_node(FILE *fp, const struct ExpandoNode *node, struct ListHead *links)
Definition graphviz.c:2183
struct ExpandoNode * node_get_child(const struct ExpandoNode *node, int index)
Get a child of an ExpandoNode.
Definition node.c:91
@ ENP_LEFT
Index of Left-Hand Nodes.
@ ENP_RIGHT
Index of Right-Hand Nodes.
@ EPT_FILL_EOL
Fill to the end-of-line.
@ EPT_SOFT_FILL
Soft-fill: right-hand-side will be truncated.
@ EPT_HARD_FILL
Hard-fill: left-hand-side will be truncated.
Basic Expando Node.
Definition node.h:67
void * ndata
Private node data.
Definition node.h:77
Private data for a Padding Node -.
enum ExpandoPadType pad_type
Padding type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_condition()

void dot_expando_node_condition ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2043 of file graphviz.c.

2044{
2045 struct Buffer *buf = buf_pool_get();
2046 dot_object_header(fp, node, "Condition", "#ff8080");
2047 // dot_type_string(fp, "type", "ENT_CONDITION", true);
2048 dot_type_string(fp, "text", node->text, false);
2049 dot_format(fp, node->format);
2050
2052
2053 struct ExpandoNode *node_cond = node_get_child(node, ENC_CONDITION);
2054 struct ExpandoNode *node_true = node_get_child(node, ENC_TRUE);
2055 struct ExpandoNode *node_false = node_get_child(node, ENC_FALSE);
2056
2057 dot_expando_node(fp, node_cond, links);
2058 dot_add_link(links, node, node_cond, "Condition->condition", "condition", false, "#ff80ff");
2059 if (node_true)
2060 {
2061 dot_expando_node(fp, node_true, links);
2062 dot_add_link(links, node, node_true, "Condition->true", "true", false, "#80ff80");
2063 }
2064 if (node_false)
2065 {
2066 dot_expando_node(fp, node_false, links);
2067 dot_add_link(links, node, node_false, "Condition->false", "false", false, "#ff8080");
2068 }
2069
2070 buf_pool_release(&buf);
2071}
void dot_format(FILE *fp, struct ExpandoFormat *fmt)
Definition graphviz.c:1957
@ ENC_CONDITION
Index of Condition Node.
@ ENC_FALSE
Index of False Node.
@ ENC_TRUE
Index of True Node.
struct ExpandoFormat * format
Formatting info.
Definition node.h:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_conditional_bool()

void dot_expando_node_conditional_bool ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2073 of file graphviz.c.

2075{
2076 struct Buffer *buf = buf_pool_get();
2077 dot_object_header(fp, node, "CondBool", "#c0c0ff");
2078 // dot_type_string(fp, "type", "ENT_CONDBOOL", true);
2079 dot_type_string(fp, "did", name_expando_domain(node->did), true);
2080 dot_type_string(fp, "uid", name_expando_uid(node->did, node->uid), true);
2081 dot_type_string(fp, "text", node->text, false);
2082
2084
2085 buf_pool_release(&buf);
2086}
const char * name_expando_uid(enum ExpandoDomain did, int uid)
Get the name of an email expando field.
const char * name_expando_domain(enum ExpandoDomain did)
Get the name of an expando domain.
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition node.h:70
int did
Domain ID, e.g. ED_EMAIL.
Definition node.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_conditional_date()

void dot_expando_node_conditional_date ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2088 of file graphviz.c.

2090{
2091 struct Buffer *buf = buf_pool_get();
2092 dot_object_header(fp, node, "CondDate", "#c0c0ff");
2093 // dot_type_string(fp, "type", "ENT_CONDDATE", true);
2094 dot_type_string(fp, "did", name_expando_domain(node->did), true);
2095 dot_type_string(fp, "uid", name_expando_uid(node->did, node->uid), true);
2096 dot_type_string(fp, "text", node->text, false);
2097
2098 struct NodeCondDatePrivate *priv = node->ndata;
2099 if (priv)
2100 {
2101 dot_type_number(fp, "count", priv->count);
2102 dot_type_char(fp, "period", priv->period);
2103 }
2104
2106
2107 buf_pool_release(&buf);
2108}
Private data for a Conditional Date -.
int count
Number of 'units' to count.
char period
Units, e.g. 'd' Day or 'm' Month.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_container()

void dot_expando_node_container ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2110 of file graphviz.c.

2111{
2112 dot_object_header(fp, node, "Container", "#80ffff");
2113 // dot_type_string(fp, "type", "ENT_CONTAINER", true);
2114 dot_type_number(fp, "children", ARRAY_SIZE(&node->children));
2115 dot_format(fp, node->format);
2117
2118 struct ExpandoNode **enp = NULL;
2119 enp = ARRAY_FIRST(&node->children);
2120 if (!enp)
2121 return;
2122
2123 struct ExpandoNode *child = *enp;
2124 dot_add_link(links, node, child, "Node->children", "children", false, "#80ff80");
2125
2126 char name[256] = { 0 };
2127 struct Buffer *rank = buf_pool_get();
2128 buf_addstr(rank, "{ rank=same ");
2129
2130 struct ExpandoNode *prev = NULL;
2131 ARRAY_FOREACH(enp, &node->children)
2132 {
2133 child = *enp;
2134
2135 dot_expando_node(fp, child, links);
2136 if (prev)
2137 {
2138 dot_add_link(links, prev, child, "Node->next", "next", false, "#80ff80");
2139 }
2140 prev = child;
2141
2142 dot_ptr_name(name, sizeof(name), child);
2143 buf_add_printf(rank, "%s ", name);
2144 }
2145
2146 buf_addstr(rank, "}");
2147 mutt_list_insert_tail(links, buf_strdup(rank));
2148 buf_pool_release(&rank);
2149}
struct ExpandoNodeArray children
Children nodes.
Definition node.h:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_expando()

void dot_expando_node_expando ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2151 of file graphviz.c.

2152{
2153 struct Buffer *buf = buf_pool_get();
2154 dot_object_header(fp, node, "Expando", "#80ff80");
2155
2156 // dot_type_number(fp, "type", node->type);
2157 dot_type_string(fp, "did", name_expando_domain(node->did), true);
2158 dot_type_string(fp, "uid", name_expando_uid(node->did, node->uid), true);
2159 dot_type_string(fp, "text", node->text, false);
2160
2161 dot_format(fp, node->format);
2162
2164
2165 buf_pool_release(&buf);
2166}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dot_expando_node_unknown()

void dot_expando_node_unknown ( FILE * fp,
const struct ExpandoNode * node,
struct ListHead * links )

Definition at line 2168 of file graphviz.c.

2169{
2170 struct Buffer *buf = buf_pool_get();
2171 dot_object_header(fp, node, "UNKNOWN", "#ff0000");
2172
2173 dot_type_number(fp, "type", node->type);
2174 dot_type_number(fp, "did", node->did);
2175 dot_type_number(fp, "uid", node->uid);
2176 dot_type_string(fp, "text", node->text, false);
2177
2179
2180 buf_pool_release(&buf);
2181}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_graphviz_expando_node()

void dump_graphviz_expando_node ( const struct ExpandoNode * node)

Definition at line 2217 of file graphviz.c.

2218{
2219 char name[256] = { 0 };
2220 struct ListHead links = STAILQ_HEAD_INITIALIZER(links);
2221
2222 time_t now = time(NULL);
2223 mutt_date_localtime_format(name, sizeof(name), "%T-expando.gv", now);
2224
2225 umask(022);
2226 FILE *fp = fopen(name, "w");
2227 if (!fp)
2228 return;
2229
2230 dot_graph_header(fp);
2231
2232 dot_expando_node(fp, node, &links);
2233
2234 dot_graph_footer(fp, &links);
2235 fclose(fp);
2236 mutt_list_free(&links);
2237}
+ Here is the call graph for this function: