NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
group.h File Reference

Parse Group/Lists Commands. More...

#include "core/lib.h"
+ Include dependency graph for group.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  GroupState { GS_NONE , GS_RX , GS_ADDR }
 Type of email address group. More...
 

Functions

int parse_grouplist (struct GroupList *gl, struct Buffer *buf, struct Buffer *s, struct Buffer *err, struct HashTable *groups)
 Parse a group context.
 
enum CommandResult parse_group (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'group' and 'ungroup' commands - Implements Command::parse() -.
 
enum CommandResult parse_lists (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'lists' command - Implements Command::parse() -.
 
enum CommandResult parse_subscribe (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'subscribe' command - Implements Command::parse() -.
 
enum CommandResult parse_unlists (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'unlists' command - Implements Command::parse() -.
 
enum CommandResult parse_unsubscribe (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'unsubscribe' command - Implements Command::parse() -.
 

Detailed Description

Parse Group/Lists Commands.

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 group.h.

Enumeration Type Documentation

◆ GroupState

enum GroupState

Type of email address group.

Enumerator
GS_NONE 

Group is missing an argument.

GS_RX 

Entry is a regular expression.

GS_ADDR 

Entry is an address.

Definition at line 37 of file group.h.

38{
39 GS_NONE,
40 GS_RX,
41 GS_ADDR,
42};
@ GS_RX
Entry is a regular expression.
Definition group.h:40
@ GS_NONE
Group is missing an argument.
Definition group.h:39
@ GS_ADDR
Entry is an address.
Definition group.h:41

Function Documentation

◆ parse_grouplist()

int parse_grouplist ( struct GroupList * gl,
struct Buffer * token,
struct Buffer * line,
struct Buffer * err,
struct HashTable * groups )

Parse a group context.

Parameters
glGroupList to add to
tokenTemporary Buffer space
lineBuffer containing string to be parsed
errBuffer for error messages
groupsGroups HashTable
Return values
0Success
-1Error

Definition at line 56 of file group.c.

58{
59 while (mutt_istr_equal(token->data, "-group"))
60 {
61 if (!MoreArgs(line))
62 {
63 buf_strcpy(err, _("-group: no group name"));
64 return -1;
65 }
66
68
69 grouplist_add_group(gl, groups_get_group(groups, token->data));
70
71 if (!MoreArgs(line))
72 {
73 buf_strcpy(err, _("out of arguments"));
74 return -1;
75 }
76
78 }
79
80 return 0;
81}
struct Group * groups_get_group(struct HashTable *groups, const char *name)
Get a Group by its name.
Definition group.c:291
void grouplist_add_group(struct GroupList *gl, struct Group *g)
Add a Group to a GroupList.
Definition group.c:183
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
int parse_extract_token(struct Buffer *dest, struct Buffer *line, TokenFlags flags)
Extract one token from a string.
Definition extract.c:49
#define MoreArgs(buf)
Definition extract.h:31
#define TOKEN_NO_FLAGS
No flags are set.
Definition extract.h:45
#define _(a)
Definition message.h:28
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:674
char * data
Pointer to data.
Definition buffer.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function: