NeoMutt  2023-03-22-27-g3cb248
Teaching an old dog new tricks
DOXYGEN
flags.c File Reference

Pattern definitions. More...

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

Go to the source code of this file.

Functions

const struct PatternFlagslookup_tag (char tag)
 Lookup a pattern modifier. More...
 
const struct PatternFlagslookup_op (int op)
 Lookup the Pattern Flags for an op. More...
 

Variables

const struct PatternFlags Flags []
 Lookup table for all patterns. More...
 

Detailed Description

Pattern definitions.

Authors
  • Michael R. Elkins
  • Pietro Cerutti

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

Function Documentation

◆ lookup_tag()

const struct PatternFlags * lookup_tag ( char  tag)

Lookup a pattern modifier.

Parameters
tagLetter, e.g. 'b' for pattern '~b'
Return values
ptrPattern data

Definition at line 200 of file flags.c.

201{
202 for (int i = 0; Flags[i].tag; i++)
203 if (Flags[i].tag == tag)
204 return &Flags[i];
205 return NULL;
206}
const struct PatternFlags Flags[]
Lookup table for all patterns.
Definition: flags.c:40
int tag
Character used to represent this operation, e.g. 'A' for '~A'.
Definition: private.h:61
+ Here is the caller graph for this function:

◆ lookup_op()

const struct PatternFlags * lookup_op ( int  op)

Lookup the Pattern Flags for an op.

Parameters
opOperation, e.g. MUTT_PAT_SENDER
Return values
ptrPatternFlags

Definition at line 213 of file flags.c.

214{
215 for (int i = 0; Flags[i].tag; i++)
216 if (Flags[i].op == op)
217 return (&Flags[i]);
218 return NULL;
219}
+ Here is the caller graph for this function:

Variable Documentation

◆ Flags

const struct PatternFlags Flags[]

Lookup table for all patterns.

Definition at line 40 of file flags.c.