To keep Interface API small, compact and readable, but versatile
[openocd/libswd.git] / src / interface / feature.h
blobf9bb7740ab05103436a70c4863c7fd8cdbdbf947
1 /*
2 * Copyright (C) 2012 Tomasz Boleslaw CEDRO
3 * cederom@tlen.pl, http://www.tomek.cedro.info
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef OOCD_FEATURE_H
21 #define OOCD_FEATURE_H
23 #define OOCD_FEATURE_NAME_MAXLEN 50
24 #define OOCD_FEATURE_DESCRIPTION_MAXLEN 80
25 #define OOCD_FEATURE_ARM_DAP "oocd_feature_arm_dap"
27 typedef struct oocd_feature {
28 /** Feature name. */
29 char name[OOCD_FEATURE_NAME_MAXLEN];
31 /** Description is a one line feature summary. */
32 char description[OOCD_FEATURE_DESCRIPTION_MAXLEN];
34 /** Body points to feature contents. */
35 void *body;
37 /** Next points to next feature on the list. */
38 struct oocd_feature *next;
40 } oocd_feature_t;
42 int oocd_feature_add(oocd_feature_t *features, oocd_feature_t *feature);
43 int oocd_feature_del(oocd_feature_t *features, char *name);
44 int oocd_feature_update(oocd_feature_t *features, oocd_feature_t *feature);
45 oocd_feature_t *oocd_feature_find(oocd_feature_t *features, char *name);
47 #endif