g0mb4

expando_callback_color

Feb 14th, 2024
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. static void simple_s(const struct ExpandoNode *node, void *data,
  2.                      MuttFormatFlags flags, struct Buffer *buf)
  3. {
  4.   assert(node->type == ENT_EXPANDO);
  5.  
  6.   const struct SimpleExpandoData *sd = data;
  7.   struct ExpandoExpandoPrivate *p = node->ndata;
  8.  
  9.   p->color = MT_COLOR_INDEX_SUBJECT;
  10.  
  11.   const char *s = NONULL(sd->s);
  12.   buf_strcpy(buf, s);
  13. }
  14.  
  15. static void simple_C(const struct ExpandoNode *node, void *data,
  16.                      MuttFormatFlags flags, struct Buffer *buf)
  17. {
  18.   assert(node->type == ENT_EXPANDO);
  19.  
  20.   const struct SimpleExpandoData *sd = data;
  21.   struct ExpandoExpandoPrivate *p = node->ndata;
  22.  
  23.   p->color = MT_COLOR_INDEX_NUMBER;
  24.  
  25.   const int num = sd->C;
  26.   buf_printf(buf, "%d", num);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment