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

Parse Group/Lists Commands. More...

#include "config.h"
#include <stdio.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "core/lib.h"
#include "group.h"
#include "parse/lib.h"
#include "module_data.h"
+ Include dependency graph for group.c:

Go to the source code of this file.

Functions

int parse_grouplist (struct GroupList *gl, struct Buffer *token, struct Buffer *line, 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
  • Michael R. Elkins
  • g10 Code GmbH
  • Richard Russon
  • Aditya De Saha
  • Matthew Hughes
  • R Primus
  • Pietro Cerutti
  • Marco Sirabella
  • Dennis Schön

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

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: