00074 {
00075 CurRunLengthItem **itemref;
00076 unsigned allocsize;
00077
00078 #ifdef XMILL
00079 runlencount=0;
00080 #endif
00081
00082 totallen=len;
00083
00084 itemref=&items;
00085
00086
00087
00088
00089 while(*itemref!=NULL)
00090 {
00091 (*itemref)->len = ((*itemref)->size < len) ? (*itemref)->size : len;
00092
00093 mymemcpy((*itemref)->GetStrPtr(),(char *)str,(*itemref)->len);
00094
00095 str+=(*itemref)->len;
00096 len-=(*itemref)->len;
00097
00098 itemref=&((*itemref)->next);
00099
00100 if(len==0)
00101
00102
00103 {
00104 while(*itemref!=NULL)
00105 {
00106 (*itemref)->len=0;
00107 itemref=&((*itemref)->next);
00108 }
00109 break;
00110 }
00111 }
00112
00113 if(len>0)
00114
00115
00116 {
00117 if(len<RUNLENGTH_ITEM_MINSIZE)
00118 allocsize=RUNLENGTH_ITEM_MINSIZE;
00119 else
00120 allocsize=((len-1)|3)+1;
00121
00122 *itemref=(CurRunLengthItem *)blockmem.GetByteBlock(sizeof(CurRunLengthItem)+allocsize);
00123
00124 (*itemref)->size=allocsize;
00125 (*itemref)->len=len;
00126
00127 mymemcpy((*itemref)->GetStrPtr(),(char *)str,len);
00128
00129 (*itemref)->next=NULL;
00130 }
00131 }