NeoMutt  2025-01-09-144-gb44c67
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
objects.c File Reference

Parse objects. More...

#include "config.h"
#include <stddef.h>
#include "mutt/lib.h"
#include "objects.h"
+ Include dependency graph for objects.c:

Go to the source code of this file.

Functions

static void sa_clear (struct StringArray *sa)
 Empty a StringArray.
 
static void cli_shared_clear (struct CliShared *shared)
 Clear a CliShared.
 
static void cli_info_clear (struct CliInfo *info)
 Clear a CliInfo.
 
static void cli_send_clear (struct CliSend *send)
 Clear a CliSend.
 
static void cli_tui_clear (struct CliTui *tui)
 Clear a CliTui.
 
struct CommandLinecommand_line_new (void)
 Create a new CommandLine.
 
void command_line_free (struct CommandLine **ptr)
 Free a CommandLine.
 

Detailed Description

Parse 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 objects.c.

Function Documentation

◆ sa_clear()

static void sa_clear ( struct StringArray *  sa)
static

Empty a StringArray.

Parameters
saString Array
Note
The Array itself isn't freed

Definition at line 40 of file objects.c.

41{
42 char **cp = NULL;
43 ARRAY_FOREACH(cp, sa)
44 {
45 FREE(cp);
46 }
47
48 ARRAY_FREE(sa);
49}
#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
#define FREE(x)
Definition: memory.h:55
+ Here is the caller graph for this function:

◆ cli_shared_clear()

static void cli_shared_clear ( struct CliShared shared)
static

Clear a CliShared.

Parameters
sharedCliShared to clear

Definition at line 55 of file objects.c.

56{
57 buf_dealloc(&shared->log_file);
58 buf_dealloc(&shared->log_level);
59 buf_dealloc(&shared->mbox_type);
60
61 sa_clear(&shared->commands);
62 sa_clear(&shared->user_files);
63}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:377
static void sa_clear(struct StringArray *sa)
Empty a StringArray.
Definition: objects.c:40
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cli_info_clear()

static void cli_info_clear ( struct CliInfo info)
static

Clear a CliInfo.

Parameters
infoCliInfo to clear

Definition at line 69 of file objects.c.

70{
71 sa_clear(&info->alias_queries);
72 sa_clear(&info->queries);
73}
struct StringArray queries
-Q Query a config option
Definition: objects.h:87
struct StringArray alias_queries
-A Lookup an alias
Definition: objects.h:86
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cli_send_clear()

static void cli_send_clear ( struct CliSend send)
static

Clear a CliSend.

Parameters
sendCliSend to clear

Definition at line 79 of file objects.c.

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}
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cli_tui_clear()

static void cli_tui_clear ( struct CliTui tui)
static

Clear a CliTui.

Parameters
tuiCliTui to clear

Definition at line 95 of file objects.c.

96{
97 buf_dealloc(&tui->folder);
99}
struct Buffer nntp_server
-g Open this NNTP Mailbox
Definition: objects.h:123
struct Buffer folder
-f Open this Mailbox
Definition: objects.h:122
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_line_new()

struct CommandLine * command_line_new ( void  )

Create a new CommandLine.

Return values
ptrNew CommandLine

Definition at line 105 of file objects.c.

106{
107 return MUTT_MEM_CALLOC(1, struct CommandLine);
108}
#define MUTT_MEM_CALLOC(n, type)
Definition: memory.h:40
Command Line options.
Definition: objects.h:130
+ Here is the caller graph for this function:

◆ command_line_free()

void command_line_free ( struct CommandLine **  ptr)

Free a CommandLine.

Parameters
ptrCommandLine to free

Definition at line 114 of file objects.c.

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}
static void cli_shared_clear(struct CliShared *shared)
Clear a CliShared.
Definition: objects.c:55
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
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function: