NeoMutt  2025-01-09-144-gb44c67
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
objects.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include "mutt/lib.h"
32#include "objects.h"
33
40static void sa_clear(struct StringArray *sa)
41{
42 char **cp = NULL;
43 ARRAY_FOREACH(cp, sa)
44 {
45 FREE(cp);
46 }
47
48 ARRAY_FREE(sa);
49}
50
55static void cli_shared_clear(struct CliShared *shared)
56{
60
63}
64
69static void cli_info_clear(struct CliInfo *info)
70{
73}
74
79static void cli_send_clear(struct CliSend *send)
80{
81 sa_clear(&send->addresses);
82 sa_clear(&send->attach);
83 sa_clear(&send->bcc_list);
84 sa_clear(&send->cc_list);
85
86 buf_dealloc(&send->draft_file);
87 buf_dealloc(&send->include_file);
88 buf_dealloc(&send->subject);
89}
90
95static void cli_tui_clear(struct CliTui *tui)
96{
99}
100
106{
107 return MUTT_MEM_CALLOC(1, struct CommandLine);
108}
109
115{
116 if (!ptr || !*ptr)
117 return;
118
119 struct CommandLine *cl = *ptr;
120
121 // cl->help - nothing to do
123 cli_info_clear(&cl->info);
124 cli_send_clear(&cl->send);
125 cli_tui_clear(&cl->tui);
126
127 FREE(ptr);
128}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:214
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:204
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:377
#define FREE(x)
Definition: memory.h:55
#define MUTT_MEM_CALLOC(n, type)
Definition: memory.h:40
Convenience wrapper for the library headers.
static bool send(struct Notify *source, struct Notify *current, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:120
static void cli_shared_clear(struct CliShared *shared)
Clear a CliShared.
Definition: objects.c:55
struct CommandLine * command_line_new(void)
Create a new CommandLine.
Definition: objects.c:105
void command_line_free(struct CommandLine **ptr)
Free a CommandLine.
Definition: objects.c:114
static void sa_clear(struct StringArray *sa)
Empty a StringArray.
Definition: objects.c:40
static void cli_send_clear(struct CliSend *send)
Clear a CliSend.
Definition: objects.c:79
static void cli_tui_clear(struct CliTui *tui)
Clear a CliTui.
Definition: objects.c:95
static void cli_info_clear(struct CliInfo *info)
Clear a CliInfo.
Definition: objects.c:69
Parse the Command Line.
Info Mode Command Line options.
Definition: objects.h:79
struct StringArray queries
-Q Query a config option
Definition: objects.h:87
struct StringArray alias_queries
-A Lookup an alias
Definition: objects.h:86
Send Mode Command Line options.
Definition: objects.h:94
Shared Command Line options.
Definition: objects.h:49
struct Buffer log_level
-d Debug log level
Definition: objects.h:58
struct Buffer log_file
-l Debug log file
Definition: objects.h:59
struct StringArray commands
-e Run these commands
Definition: objects.h:55
struct StringArray user_files
-F Use these user config files
Definition: objects.h:52
struct Buffer mbox_type
-m Set the default Mailbox type
Definition: objects.h:56
TUI Mode Command Line options.
Definition: objects.h:113
struct Buffer nntp_server
-g Open this NNTP Mailbox
Definition: objects.h:123
struct Buffer folder
-f Open this Mailbox
Definition: objects.h:122
Command Line options.
Definition: objects.h:130
struct CliSend send
Send Mode command line options.
Definition: objects.h:134
struct CliShared shared
Shared command line options.
Definition: objects.h:131
struct CliInfo info
Info Mode command line options.
Definition: objects.h:133
struct CliTui tui
Tui Mode command line options.
Definition: objects.h:135