summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-07-06 00:52:36 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-07-06 00:52:36 +0000
commit5d21c672af07fa461ae6e0e989d2a866aff509b0 (patch)
treec0762c8e0af859079898f6442488d8f929e8e5d8 /src/lib
parent995097894f775112942bbe13549c9ef8ab6ef3e4 (diff)
Moved debugging structure away from CPUs only and attached to all
devices. Debugger now creates one for each device. C++-ified most debugger operations to hang off the debugging class, and updated most callers. This still needs a little cleanup, but it fixes most issues introduced when the CPUs were moved to their own devices. Got rid of cpu_count, cpu_first, cpu_next, etc. as they were badly broken. Also removed cpu_is_executing, cpu_is_suspended, cpu_get_local_time, and cpu_abort_timeslice. Some minor name changes: state_value() -> state() state_set_value() -> set_state()
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/astring.c11
-rw-r--r--src/lib/util/astring.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c
index d6f20d7aae8..3b9542cef00 100644
--- a/src/lib/util/astring.c
+++ b/src/lib/util/astring.c
@@ -232,6 +232,17 @@ void astring_free(astring *str)
#endif
+/*-------------------------------------------------
+ astring_expand - expand an astring to
+ guarantee the given amount of space
+-------------------------------------------------*/
+
+void astring_expand(astring *str, int length)
+{
+ ensure_room(str, length);
+}
+
+
/***************************************************************************
INLINE ASTRING CHANGES
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h
index 0252cb59d75..e41466536a0 100644
--- a/src/lib/util/astring.h
+++ b/src/lib/util/astring.h
@@ -82,6 +82,9 @@ astring *astring_alloc(void);
/* free an astring */
void astring_free(astring *str);
+/* free an astring */
+void astring_expand(astring *str, int length);
+
/* ----- inline astring changes ----- */
@@ -315,7 +318,9 @@ public:
astring &operator=(const astring &string) { return cpy(string); }
astring &reset() { return cpy(""); }
+ astring &expand(int length) { astring_expand(this, length); return *this; }
+ operator char *() { return this->text; }
operator const char *() const { return astring_c(this); }
const char *cstr() const { return astring_c(this); }
int len() const { return astring_len(this); }