OpenOCD
nvp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-2-Clause-Views */
2 
3 /*
4  * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
5  * Copyright 2005 Clemens Hintze <c.hintze@gmx.net>
6  * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net>
7  * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com
8  * Copyright 2008 Andrew Lunn <andrew@lunn.ch>
9  * Copyright 2008 Duane Ellis <openocd@duaneellis.com>
10  * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de>
11  * Copyright 2008 Steve Bennett <steveb@workware.net.au>
12  * Copyright 2009 Nico Coesel <ncoesel@dealogic.nl>
13  * Copyright 2009 Zachary T Welch zw@superlucidity.net
14  * Copyright 2009 David Brownell
15  * Copyright (c) 2005-2011 Jim Tcl Project. All rights reserved.
16  *
17  * This file is extracted from jim-nvp.h, originally part of jim TCL code.
18  */
19 
20 #ifndef OPENOCD_HELPER_NVP_H
21 #define OPENOCD_HELPER_NVP_H
22 
23 #include <helper/compiler.h>
24 
61 struct nvp {
62  const char *name;
63  int value;
64 };
65 
66 struct command_invocation;
67 
68 /* Name Value Pairs Operations */
69 const struct nvp *nvp_name2value(const struct nvp *nvp_table, const char *name)
71 const struct nvp *nvp_value2name(const struct nvp *nvp_table, int v)
73 
74 void nvp_unknown_command_print(struct command_invocation *cmd, const struct nvp *nvp,
75  const char *param_name, const char *param_value);
76 
77 #endif /* OPENOCD_HELPER_NVP_H */
const char * name
Definition: armv4_5.c:76
#define __returns_nonnull
Definition: compiler.h:28
#define __nonnull(params)
Definition: compiler.h:50
void nvp_unknown_command_print(struct command_invocation *cmd, const struct nvp *nvp, const char *param_name, const char *param_value)
Definition: nvp.c:49
const struct nvp * nvp_value2name(const struct nvp *nvp_table, int v) __returns_nonnull __nonnull((1))
Definition: nvp.c:39
const struct nvp * nvp_name2value(const struct nvp *nvp_table, const char *name) __returns_nonnull __nonnull((1))
Definition: nvp.c:29
When run_command is called, a new instance will be created on the stack, filled with the proper value...
Definition: command.h:76
Name Value Pairs, aka: NVP.
Definition: nvp.h:61
int value
Definition: nvp.h:63
const char * name
Definition: nvp.h:62
uint8_t cmd
Definition: vdebug.c:1