diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-31 11:31:27 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-31 11:31:27 +0000 |
commit | 0de78ed02c7e2caaf96eafb814c6059ceb9582b2 (patch) | |
tree | 1ad865a8a728eb17794be5d8589d0c26326bd348 /src/target/target.h | |
parent | 17fa4de8541ac12fad2ce836aa61d22dbf1642c8 (diff) |
Add target_get_name wrapper:
- replaces all accesses to target->type->name.
- add documentation in target_s to warn not to access field directly.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1966 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/target.h')
-rw-r--r-- | src/target/target.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h index 3d9d8e9f..91dd1b15 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -107,6 +107,10 @@ typedef struct working_area_s typedef struct target_type_s { + /** + * Name of the target. Do @b not access this field directly, use + * target_get_name() instead. + */ char *name; /** @@ -395,6 +399,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); +/** + * Get the target name. + * + * This routine is a wrapper for the target->type->name field. + */ +extern const char *target_get_name(struct target_s *target); + /// @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. |