Parse the 'set' command. More...
#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "mutt.h"
#include "set.h"
#include "commands.h"
#include "extract.h"
#include "globals.h"
#include "muttlib.h"
Go to the source code of this file.
Functions | |
static void | command_set_expand_value (uint32_t type, struct Buffer *value) |
Expand special characters. | |
static enum CommandResult | command_set_set (struct Buffer *name, struct Buffer *value, struct Buffer *err) |
Set a variable to the given value. | |
static enum CommandResult | command_set_increment (struct Buffer *name, struct Buffer *value, struct Buffer *err) |
Increment a variable by a value. | |
static enum CommandResult | command_set_decrement (struct Buffer *name, struct Buffer *value, struct Buffer *err) |
Decrement a variable by a value. | |
static enum CommandResult | command_set_unset (struct Buffer *name, struct Buffer *err) |
Unset a variable. | |
static enum CommandResult | command_set_reset (struct Buffer *name, struct Buffer *err) |
Reset a variable. | |
static enum CommandResult | command_set_toggle (struct Buffer *name, struct Buffer *err) |
Toggle a boolean, quad, or number variable. | |
static enum CommandResult | command_set_query (struct Buffer *name, struct Buffer *err) |
Query a variable. | |
enum CommandResult | parse_set (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'set' family of commands - Implements Command::parse() -. | |
Parse the 'set' command.
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 set.c.
|
static |
Expand special characters.
type | Type of the value, see note below | |
[in,out] | value | Buffer containing the value, will also contain the final result |
Expand any special characters in paths, mailboxes or commands. e.g. ~
($HOME), +
($folder)
The type influences which expansions are done.
Definition at line 59 of file set.c.
|
static |
Set a variable to the given value.
[in] | name | Name of the config; must not be NULL |
[in] | value | Value the config should be set to |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "set foo = bar" command where "bar" is present.
Definition at line 100 of file set.c.
|
static |
Increment a variable by a value.
[in] | name | Name of the config; must not be NULL |
[in] | value | Value the config should be incremented by |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "set foo += bar" command where "bar" is present.
Definition at line 160 of file set.c.
|
static |
Decrement a variable by a value.
[in] | name | Name of the config; must not be NULL |
[in] | value | Value the config should be decremented by |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "set foo -= bar" command where "bar" is present.
Definition at line 221 of file set.c.
|
static |
Unset a variable.
[in] | name | Name of the config variable to be unset |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "unset foo"
Definition at line 257 of file set.c.
|
static |
Reset a variable.
[in] | name | Name of the config variable to be reset |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "reset foo" (foo being any config variable) and "reset all".
Definition at line 302 of file set.c.
|
static |
Toggle a boolean, quad, or number variable.
[in] | name | Name of the config variable to be toggled |
[out] | err | Buffer for error messages |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "toggle foo".
Definition at line 362 of file set.c.
|
static |
Query a variable.
[in] | name | Name of the config variable to queried |
[out] | err | Buffer where the pretty printed result will be written to. On failure contains the error message. |
CommandResult | Result e.g. MUTT_CMD_SUCCESS |
This implements "set foo?". The buffer err will contain something like "set foo = bar".
Definition at line 408 of file set.c.