commit e49a67ae9a3d0c4166ad8475a9b30d2328c3944c parent c2460281a13ca908cfdfc97b4ee1e91ce43f5085 Author: Nathaniel Chappelle <nathaniel@chappelle.dev> Date: Wed, 28 Jan 2026 23:35:21 -0800 threading fields and structs Diffstat:
| M | json.h | | | 10 | ++++++++++ |
| M | stamail.h | | | 20 | ++++++++++++++++++++ |
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/json.h b/json.h @@ -1,12 +1,22 @@ #ifndef JSON_H #define JSON_H +#include <time.h> + struct message { const char *id; int id_len; const char *from; int from_len; const char *subject;int subject_len; const char *date; int date_len; const char *body; int body_len; + + /* Threading fields */ + const char *in_reply_to; + int in_reply_to_len; + const char *references; + int references_len; + + time_t timestamp; }; /* Called for every message found */ diff --git a/stamail.h b/stamail.h @@ -8,4 +8,24 @@ struct message_node { struct message_node *next; }; +/* Thread tree node */ +struct thread_node { + struct message *msg; + + struct thread_node *parent; + struct thread_node *child; + struct thread_node *sibling; + + int depth; + int num_children; +}; + +/* Thread Root */ +struct thread { + struct thread_node *root; + char *subject; + time_t latest; + int message_count; +}; + #endif