NeoMutt  2021-02-05-666-ge300cd
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 197 of file flags.c.

198 {
199  for (int i = 0; Flags[i].tag; i++)
200  if (Flags[i].tag == tag)
201  return &Flags[i];
202  return NULL;
203 }
const struct PatternFlags Flags[]
Lookup table for all patterns.
Definition: flags.c:41
int tag
Character used to represent this operation, e.g. &#39;A&#39; for &#39;~A&#39;.
Definition: private.h:51
+ 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 210 of file flags.c.

211 {
212  for (int i = 0; Flags[i].tag; i++)
213  if (Flags[i].op == op)
214  return (&Flags[i]);
215  return NULL;
216 }
const struct PatternFlags Flags[]
Lookup table for all patterns.
Definition: flags.c:41
int tag
Character used to represent this operation, e.g. &#39;A&#39; for &#39;~A&#39;.
Definition: private.h:51
+ Here is the caller graph for this function:

Variable Documentation

◆ Flags

const struct PatternFlags Flags[]

Lookup table for all patterns.

Definition at line 41 of file flags.c.