~ubuntu-branches/ubuntu/intrepid/htop/intrepid

« back to all changes in this revision

Viewing changes to RichString.c

  • Committer: Bazaar Package Importer
  • Author(s): Bartosz Fenski
  • Date: 2008-04-26 13:57:14 UTC
  • mfrom: (1.1.10 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080426135714-teunz1rh1mda44w1
Tags: 0.7-1
* New upstrem version. (Closes: #452634)
* Move URL to homepage header.
* Bumped Standards-Version (no changes needed).
* Fixed watch file. (Closes: #449631)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#define MIN(a,b) ((a)<(b)?(a):(b))
27
27
#endif
28
28
 
29
 
void RichString_write(RichString* this, int attrs, char* data) {
30
 
   RichString_init(this);
31
 
   RichString_append(this, attrs, data);
32
 
}
33
 
 
34
 
inline void RichString_append(RichString* this, int attrs, char* data) {
35
 
   RichString_appendn(this, attrs, data, strlen(data));
36
 
}
37
 
 
38
29
inline void RichString_appendn(RichString* this, int attrs, char* data, int len) {
39
30
   int last = MIN(RICHSTRING_MAXLEN - 1, len + this->len);
40
31
   for (int i = this->len, j = 0; i < last; i++, j++)
43
34
   this->len = last;
44
35
}
45
36
 
 
37
inline void RichString_append(RichString* this, int attrs, char* data) {
 
38
   RichString_appendn(this, attrs, data, strlen(data));
 
39
}
 
40
 
 
41
void RichString_write(RichString* this, int attrs, char* data) {
 
42
   RichString_init(this);
 
43
   RichString_append(this, attrs, data);
 
44
}
 
45
 
46
46
void RichString_setAttr(RichString *this, int attrs) {
47
47
   chtype* ch = this->chstr;
48
48
   for (int i = 0; i < this->len; i++) {