blackmagic/src/include/command.h
Jeremy Elson 3235fa2005 Improve parsing of commands that require enable or disable arguments:
* Accept prefixes of the words 'enable' and 'disable'
* Prevent silent failures on parse errors
* Print status after flag changes
* Fix missing includes
2019-03-19 12:56:44 -07:00

40 lines
1.3 KiB
C

/*
* This file is part of the Black Magic Debug project.
*
* Copyright (C) 2011 Black Sphere Technologies Ltd.
* Written by Gareth McMullin <gareth@blacksphere.co.nz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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/>.
*/
#ifndef __COMMAND_H
#define __COMMAND_H
#include <stdbool.h>
#include "target.h"
int command_process(target *t, char *cmd);
/*
* Attempts to parse a string as either being "enable" or "disable".
* If the parse is successful, returns true and sets the out param to
* indicate what was parsed. If not successful, emits a warning to the
* gdb port, returns false and leaves out untouched.
*/
bool parse_enable_or_disable(const char *s, bool *out);
#endif