summaryrefslogtreecommitdiff
path: root/src/target/target.h
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:38:43 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:38:43 +0000
commit9cb3af610a1d7cc2d8c1433f54077938d0268a8f (patch)
tree7429d8f73b1fba650f6674227291da316477b126 /src/target/target.h
parentfbe8cf72a5e6c80fed5fba8754d790ca63ad2b65 (diff)
downloadopenocd_libswd-9cb3af610a1d7cc2d8c1433f54077938d0268a8f.tar.gz
openocd_libswd-9cb3af610a1d7cc2d8c1433f54077938d0268a8f.tar.bz2
openocd_libswd-9cb3af610a1d7cc2d8c1433f54077938d0268a8f.tar.xz
openocd_libswd-9cb3af610a1d7cc2d8c1433f54077938d0268a8f.zip
Add wrappers for target->type->examined:
- replace all checks of target->type->examined with target_was_examined(). - replace all setting of target->type->examined with target_set_examined(). - replace clearing of target->type->examined with target_reset_examined(). - add documentation in target_s to warn not to access field directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1962 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r--src/target/target.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h
index c319a25b..662c95b9 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -109,6 +109,12 @@ typedef struct target_type_s
{
char *name;
+ /**
+ * Indicates whether this target has been examined.
+ *
+ * Do @b not access this field directly, use target_was_examined()
+ * target_set_examined(), and target_reset_examined().
+ */
int examined;
/* poll current target status */
@@ -383,6 +389,13 @@ extern target_t* get_current_target(struct command_context_s *cmd_ctx);
extern int get_num_by_target(target_t *query_target);
extern target_t *get_target(const char *id);
+/// @returns @c true if the target has been examined.
+extern bool target_was_examined(struct target_s *target);
+/// Sets the @c examined flag for the given target.
+extern void target_set_examined(struct target_s *target);
+/// Reset the @c examined flag for the given target.
+extern void target_reset_examined(struct target_s *target);
+
/**
* Run an algorithm on the @a target given.
*