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

Parse Ifdef Commands. More...

#include "config.h"
#include <stdbool.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "ifdef.h"
#include "color/lib.h"
#include "key/lib.h"
#include "parse/lib.h"
#include "store/lib.h"
#include "version.h"
+ Include dependency graph for ifdef.c:

Go to the source code of this file.

Functions

static bool is_function (const char *name)
 Is the argument a neomutt function?
 
static bool is_color_object (const char *name)
 Is the argument a neomutt colour?
 
enum CommandResult parse_ifdef (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'ifdef' and 'ifndef' commands - Implements Command::parse() -.
 
enum CommandResult parse_finish (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
 Parse the 'finish' command - Implements Command::parse() -.
 

Detailed Description

Parse Ifdef 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 ifdef.c.

Function Documentation

◆ is_function()

static bool is_function ( const char * name)
static

Is the argument a neomutt function?

Parameters
nameCommand name to be searched for
Return values
trueFunction found
falseFunction not found

Definition at line 56 of file ifdef.c.

57{
58 int op = km_get_op(name);
59
60 return (op != OP_NULL);
61}
int km_get_op(const char *func)
Get the OpCode for a Function.
Definition menu.c:184
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_color_object()

static bool is_color_object ( const char * name)
static

Is the argument a neomutt colour?

Parameters
nameColour name to be searched for
Return values
trueFunction found
falseFunction not found

Definition at line 69 of file ifdef.c.

70{
71 int cid = mutt_map_get_value(name, ColorFields);
72
73 return (cid > 0);
74}
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition commands.c:54
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
Definition mapping.c:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function: