Fix for UBSan build
[platform/upstream/doxygen.git] / src / marshal.cpp
1 #include <qfile.h>
2 #include <assert.h>
3
4 #include "sortdict.h"
5 #include "marshal.h"
6 #include "entry.h"
7 #include "section.h"
8 #include "memberlist.h"
9 #include "definition.h"
10 #include "groupdef.h"
11 #include "example.h"
12 #include "arguments.h"
13
14 #define HEADER ('D'<<24)+('O'<<16)+('X'<<8)+'!'
15
16 void marshalInt(StorageIntf *s,int v)
17 {
18   uchar b[4];
19   b[0]=((uint)v)>>24;
20   b[1]=(((uint)v)>>16)&0xff;
21   b[2]=(((uint)v)>>8)&0xff;
22   b[3]=v&0xff;
23   s->write((const char *)b,4);
24 }
25
26 void marshalUInt(StorageIntf *s,uint v)
27 {
28   uchar b[4];
29   b[0]=v>>24;
30   b[1]=(v>>16)&0xff;
31   b[2]=(v>>8)&0xff;
32   b[3]=v&0xff;
33   s->write((const char *)b,4);
34 }
35
36 void marshalBool(StorageIntf *s,bool b)
37 {
38   char c = b;
39   s->write(&c,sizeof(char));
40 }
41
42 void marshalQCString(StorageIntf *s,const QCString &str)
43 {
44   uint l=str.length();
45   marshalUInt(s,l);
46   if (l>0) s->write(str.data(),l);
47 }
48
49 void marshalQGString(StorageIntf *s,const QGString &str)
50 {
51   uint l=str.length();
52   marshalUInt(s,l);
53   if (l>0) s->write(str.data(),l);
54 }
55
56 void marshalArgumentList(StorageIntf *s,ArgumentList *argList)
57 {
58   ArgumentList::marshal(s,argList);
59 }
60
61 void marshalArgumentLists(StorageIntf *s,QList<ArgumentList> *argLists)
62 {
63   if (argLists==0)
64   {
65     marshalUInt(s,NULL_LIST); // null pointer representation
66   }
67   else
68   {
69     marshalUInt(s,argLists->count());
70     QListIterator<ArgumentList> ali(*argLists);
71     ArgumentList *al;
72     for (ali.toFirst();(al=ali.current());++ali)
73     {
74       marshalArgumentList(s,al);
75     }
76   }
77 }
78
79 void marshalBaseInfoList(StorageIntf *s, QList<BaseInfo> *baseList)
80 {
81   if (baseList==0)
82   {
83     marshalUInt(s,NULL_LIST); // null pointer representation
84   }
85   else
86   {
87     marshalUInt(s,baseList->count());
88     QListIterator<BaseInfo> bli(*baseList);
89     BaseInfo *bi;
90     for (bli.toFirst();(bi=bli.current());++bli)
91     {
92       marshalQCString(s,bi->name);
93       marshalInt(s,(int)bi->prot);
94       marshalInt(s,(int)bi->virt);
95     }
96   }
97 }
98
99 void marshalGroupingList(StorageIntf *s, QList<Grouping> *groups)
100 {
101   if (groups==0)
102   {
103     marshalUInt(s,NULL_LIST); // null pointer representation
104   }
105   else
106   {
107     marshalUInt(s,groups->count());
108     QListIterator<Grouping> gli(*groups);
109     Grouping *g;
110     for (gli.toFirst();(g=gli.current());++gli)
111     {
112       marshalQCString(s,g->groupname);
113       marshalInt(s,(int)g->pri);
114     }
115   }
116 }
117
118 void marshalSectionInfoList(StorageIntf *s, QList<SectionInfo> *anchors)
119 {
120   if (anchors==0)
121   {
122     marshalUInt(s,NULL_LIST); // null pointer representation
123   }
124   else
125   {
126     marshalUInt(s,anchors->count());
127     QListIterator<SectionInfo> sli(*anchors);
128     SectionInfo *si;
129     for (sli.toFirst();(si=sli.current());++sli)
130     {
131       marshalQCString(s,si->label);
132       marshalQCString(s,si->title);
133       marshalQCString(s,si->ref);
134       marshalInt(s,(int)si->type);
135       marshalQCString(s,si->fileName);
136       marshalInt(s,si->level);
137     }
138   }
139 }
140
141 void marshalItemInfoList(StorageIntf *s, QList<ListItemInfo> *sli)
142 {
143   if (sli==0)
144   {
145     marshalUInt(s,NULL_LIST); // null pointer representation
146   }
147   else
148   {
149     marshalUInt(s,sli->count());
150     QListIterator<ListItemInfo> liii(*sli);
151     ListItemInfo *lii;
152     for (liii.toFirst();(lii=liii.current());++liii)
153     {
154       marshalQCString(s,lii->type);
155       marshalInt(s,lii->itemId);
156     }
157   }
158 }
159
160 void marshalObjPointer(StorageIntf *s,void *obj)
161 {
162   char *b = (char *)&obj;
163   s->write(b,sizeof(void *));
164 }
165
166 void marshalSectionDict(StorageIntf *s,SectionDict *sections)
167 {
168   if (sections==0)
169   {
170     marshalUInt(s,NULL_LIST); // null pointer representation
171   }
172   else
173   {
174     marshalUInt(s,sections->count());
175     SDict<SectionInfo>::IteratorDict sli(*sections);
176     SectionInfo *si;
177     for (sli.toFirst();(si=sli.current());++sli)
178     {
179       marshalQCString(s,sli.currentKey());
180       marshalObjPointer(s,si);
181     }
182   }
183 }
184
185 void marshalMemberSDict(StorageIntf *s,MemberSDict *memberSDict)
186 {
187   if (memberSDict==0)
188   {
189     marshalUInt(s,NULL_LIST); // null pointer representation
190   }
191   else
192   {
193     marshalUInt(s,memberSDict->count());
194     //printf("  marshalMemberSDict: items=%d\n",memberSDict->count());
195     SDict<MemberDef>::IteratorDict mdi(*memberSDict);
196     MemberDef *md;
197     int count=0;
198     for (mdi.toFirst();(md=mdi.current());++mdi)
199     {
200       //printf("  marshalMemberSDict: %d: key=%s value=%p\n",count,mdi.currentKey().data(),md);
201       marshalQCString(s,mdi.currentKey());
202       marshalObjPointer(s,md);
203       count++;
204     }
205     assert(count==memberSDict->count());
206   }
207 }
208
209 void marshalDocInfo(StorageIntf *s,DocInfo *docInfo)
210 {
211   if (docInfo==0)
212   {
213     marshalUInt(s,NULL_LIST); // null pointer representation
214   }
215   else
216   {
217     marshalUInt(s,1); 
218     marshalQCString(s,docInfo->doc);
219     marshalInt(s,docInfo->line);
220     marshalQCString(s,docInfo->file);
221   }
222 }
223
224 void marshalBriefInfo(StorageIntf *s,BriefInfo *briefInfo)
225 {
226   if (briefInfo==0)
227   {
228     marshalUInt(s,NULL_LIST); // null pointer representation
229   }
230   else
231   {
232     marshalUInt(s,1); 
233     marshalQCString(s,briefInfo->doc);
234     marshalQCString(s,briefInfo->tooltip);
235     marshalInt(s,briefInfo->line);
236     marshalQCString(s,briefInfo->file);
237   }
238 }
239
240 void marshalBodyInfo(StorageIntf *s,BodyInfo *bodyInfo)
241 {
242   if (bodyInfo==0)
243   {
244     marshalUInt(s,NULL_LIST); // null pointer representation
245   }
246   else
247   {
248     marshalUInt(s,1); 
249     marshalInt(s,bodyInfo->startLine);
250     marshalInt(s,bodyInfo->endLine);
251     marshalObjPointer(s,bodyInfo->fileDef);
252   }
253 }
254
255 void marshalGroupList(StorageIntf *s,GroupList *groupList)
256 {
257   if (groupList==0)
258   {
259     marshalUInt(s,NULL_LIST); // null pointer representation
260   }
261   else
262   {
263     marshalUInt(s,groupList->count());
264     QListIterator<GroupDef> gli(*groupList);
265     GroupDef *gd=0;
266     for (gli.toFirst();(gd=gli.current());++gli)
267     {
268       marshalObjPointer(s,gd);
269     }
270   }
271 }
272
273 void marshalMemberList(StorageIntf *s,MemberList *ml)
274 {
275   if (ml==0)
276   {
277     marshalUInt(s,NULL_LIST); // null pointer representation
278   }
279   else
280   {
281     marshalUInt(s,ml->count());
282     MemberListIterator mli(*ml);
283     MemberDef *md;
284     uint count=0;
285     for (mli.toFirst();(md=mli.current());++mli)
286     {
287       marshalObjPointer(s,md);
288       count++;
289     }
290     assert(count==ml->count());
291
292     ml->marshal(s);
293   }
294 }
295
296 void marshalExampleSDict(StorageIntf *s,ExampleSDict *ed)
297 {
298   if (ed==0)
299   {
300     marshalUInt(s,NULL_LIST); // null pointer representation
301   }
302   else
303   {
304     marshalUInt(s,ed->count());
305     //printf("  marshalMemberSDict: items=%d\n",memberSDict->count());
306     SDict<Example>::IteratorDict edi(*ed);
307     Example *e;
308     for (edi.toFirst();(e=edi.current());++edi)
309     {
310       //printf("  marshalMemberSDict: %d: key=%s value=%p\n",count,mdi.currentKey().data(),md);
311       marshalQCString(s,edi.currentKey());
312       marshalQCString(s,e->anchor);
313       marshalQCString(s,e->name);
314       marshalQCString(s,e->file);
315     }
316   }
317 }
318
319 void marshalMemberLists(StorageIntf *s,SDict<MemberList> *mls)
320 {
321   if (mls==0)
322   {
323     marshalUInt(s,NULL_LIST); // null pointer representation
324   }
325   else
326   {
327     marshalUInt(s,mls->count());
328     //printf("  marshalMemberSDict: items=%d\n",memberSDict->count());
329     SDict<MemberList>::IteratorDict mli(*mls);
330     MemberList *ml;
331     for (mli.toFirst();(ml=mli.current());++mli)
332     {
333       //printf("  marshalMemberSDict: %d: key=%s value=%p\n",count,mdi.currentKey().data(),md);
334       marshalQCString(s,mli.currentKey());
335       marshalObjPointer(s,ml); // assume we are not owner of the list
336     }
337   }
338 }
339
340 void marshalEntry(StorageIntf *s,Entry *e)
341 {
342   marshalUInt(s,HEADER);
343   marshalQCString(s,e->name);
344   marshalQCString(s,e->type);
345   marshalInt(s,e->section);
346   marshalInt(s,(int)e->protection);
347   marshalInt(s,(int)e->mtype);
348   marshalInt(s,e->spec);
349   marshalInt(s,e->initLines);
350   marshalBool(s,e->stat);
351   marshalBool(s,e->explicitExternal);
352   marshalBool(s,e->proto);
353   marshalBool(s,e->subGrouping);
354   marshalBool(s,e->callGraph);
355   marshalBool(s,e->callerGraph);
356   marshalInt(s,(int)e->virt);
357   marshalQCString(s,e->args);
358   marshalQCString(s,e->bitfields);
359   marshalArgumentList(s,e->argList);
360   marshalArgumentLists(s,e->tArgLists);
361   marshalQGString(s,e->program);
362   marshalQGString(s,e->initializer);
363   marshalQCString(s,e->includeFile);
364   marshalQCString(s,e->includeName);
365   marshalQCString(s,e->doc);
366   marshalInt(s,e->docLine);
367   marshalQCString(s,e->docFile);
368   marshalQCString(s,e->brief);
369   marshalInt(s,e->briefLine);
370   marshalQCString(s,e->briefFile);
371   marshalQCString(s,e->inbodyDocs);
372   marshalInt(s,e->inbodyLine);
373   marshalQCString(s,e->inbodyFile);
374   marshalQCString(s,e->relates);
375   marshalInt(s,e->relatesType);
376   marshalQCString(s,e->read);
377   marshalQCString(s,e->write);
378   marshalQCString(s,e->inside);
379   marshalQCString(s,e->exception);
380   marshalArgumentList(s,e->typeConstr);
381   marshalInt(s,e->bodyLine);
382   marshalInt(s,e->endBodyLine);
383   marshalInt(s,e->mGrpId);
384   marshalBaseInfoList(s,e->extends);
385   marshalGroupingList(s,e->groups);
386   marshalSectionInfoList(s,e->anchors);
387   marshalQCString(s,e->fileName);
388   marshalInt(s,e->startLine);
389   marshalItemInfoList(s,e->sli);
390   marshalInt(s,(int)e->lang);
391   marshalBool(s,e->hidden);
392   marshalBool(s,e->artificial);
393   marshalInt(s,(int)e->groupDocType);
394 }
395
396 void marshalEntryTree(StorageIntf *s,Entry *e)
397 {
398   marshalEntry(s,e);
399   marshalUInt(s,e->children()->count());
400   QListIterator<Entry> eli(*e->children());
401   Entry *child;
402   for (eli.toFirst();(child=eli.current());++eli)
403   {
404     marshalEntryTree(s,child);
405   }
406 }
407
408 //------------------------------------------------------------------
409
410 int unmarshalInt(StorageIntf *s)
411 {
412   uchar b[4];
413   s->read((char *)b,4);
414   int result=(int)((((uint)b[0])<<24)+((uint)b[1]<<16)+((uint)b[2]<<8)+(uint)b[3]);
415   //printf("unmarshalInt: %x %x %x %x: %x offset=%llx\n",b[0],b[1],b[2],b[3],result,f.pos());
416   return result;
417 }
418
419 uint unmarshalUInt(StorageIntf *s)
420 {
421   uchar b[4];
422   s->read((char *)b,4);
423   uint result=(((uint)b[0])<<24)+((uint)b[1]<<16)+((uint)b[2]<<8)+(uint)b[3];
424   //printf("unmarshalUInt: %x %x %x %x: %x offset=%llx\n",b[0],b[1],b[2],b[3],result,f.pos());
425   return result;
426 }
427
428 bool unmarshalBool(StorageIntf *s)
429 {
430   char result;
431   s->read(&result,sizeof(result));
432   //printf("unmarshalBool: %x offset=%llx\n",result,f.pos());
433   return result;
434 }
435
436 QCString unmarshalQCString(StorageIntf *s)
437 {
438   uint len = unmarshalUInt(s);
439   //printf("unmarshalQCString: len=%d offset=%llx\n",len,f.pos());
440   QCString result(len+1);
441   result.at(len)='\0';
442   if (len>0)
443   {
444     s->read(result.data(),len);
445   }
446   //printf("unmarshalQCString: result=%s\n",result.data());
447   return result;
448 }
449
450 QGString unmarshalQGString(StorageIntf *s)
451 {
452   uint len = unmarshalUInt(s);
453   //printf("unmarshalQCString: len=%d offset=%llx\n",len,f.pos());
454   QGString result(len+1);
455   result.at(len)='\0';
456   if (len>0)
457   {
458     s->read(result.data(),len);
459   }
460   //printf("unmarshalQCString: result=%s\n",result.data());
461   return result;
462 }
463
464 ArgumentList *unmarshalArgumentList(StorageIntf *s)
465 {
466   return ArgumentList::unmarshal(s);
467 }
468
469 QList<ArgumentList> *unmarshalArgumentLists(StorageIntf *s)
470 {
471   uint i;
472   uint count = unmarshalUInt(s);
473   if (count==NULL_LIST) return 0; // null list
474   QList<ArgumentList> *result = new QList<ArgumentList>;
475   result->setAutoDelete(TRUE);
476   assert(count<1000000);
477   //printf("unmarshalArgumentLists: %d\n",count);
478   for (i=0;i<count;i++)
479   {
480     result->append(unmarshalArgumentList(s));
481   }
482   return result;
483 }
484
485 QList<BaseInfo> *unmarshalBaseInfoList(StorageIntf *s)
486 {
487   uint i;
488   uint count = unmarshalUInt(s);
489   if (count==NULL_LIST) return 0; // null list
490   QList<BaseInfo> *result = new QList<BaseInfo>;
491   result->setAutoDelete(TRUE);
492   assert(count<1000000);
493   for (i=0;i<count;i++)
494   {
495     QCString name   = unmarshalQCString(s);
496     Protection prot = (Protection)unmarshalInt(s);
497     Specifier virt  = (Specifier)unmarshalInt(s);
498     result->append(new BaseInfo(name,prot,virt));
499   }
500   return result;
501 }
502
503 QList<Grouping> *unmarshalGroupingList(StorageIntf *s)
504 {
505   uint i;
506   uint count = unmarshalUInt(s);
507   if (count==NULL_LIST) return 0; // null list
508   QList<Grouping> *result = new QList<Grouping>;
509   result->setAutoDelete(TRUE);
510   assert(count<1000000);
511   for (i=0;i<count;i++)
512   {
513     QCString name = unmarshalQCString(s);
514     Grouping::GroupPri_t prio = (Grouping::GroupPri_t)unmarshalInt(s);
515     result->append(new Grouping(name,prio));
516   }
517   return result;
518 }
519
520 QList<SectionInfo> *unmarshalSectionInfoList(StorageIntf *s)
521 {
522   uint i;
523   uint count = unmarshalUInt(s);
524   if (count==NULL_LIST) return 0; // null list
525   QList<SectionInfo> *result = new QList<SectionInfo>;
526   result->setAutoDelete(TRUE);
527   assert(count<1000000);
528   for (i=0;i<count;i++)
529   { 
530     QCString label = unmarshalQCString(s);
531     QCString title = unmarshalQCString(s);
532     QCString ref   = unmarshalQCString(s);
533     SectionInfo::SectionType type = (SectionInfo::SectionType)unmarshalInt(s);
534     QCString fileName = unmarshalQCString(s);
535     int level = unmarshalInt(s);
536     result->append(new SectionInfo(fileName,label,title,type,level,ref));
537   }
538   return result;
539 }
540
541 QList<ListItemInfo> *unmarshalItemInfoList(StorageIntf *s)
542 {
543   uint i;
544   uint count = unmarshalUInt(s);
545   if (count==NULL_LIST) return 0; // null list
546   QList<ListItemInfo> *result = new QList<ListItemInfo>;
547   result->setAutoDelete(TRUE);
548   assert(count<1000000);
549   for (i=0;i<count;i++)
550   { 
551     ListItemInfo *lii = new ListItemInfo;
552     lii->type   = unmarshalQCString(s);
553     lii->itemId = unmarshalInt(s);
554     result->append(lii);
555   }
556   return result;
557 }
558
559 void *unmarshalObjPointer(StorageIntf *s)
560 {
561   void *result;
562   s->read((char *)&result,sizeof(void*));
563   return result;
564 }
565
566 SectionDict *unmarshalSectionDict(StorageIntf *s)
567 {
568   uint i;
569   uint count = unmarshalUInt(s);
570   //printf("unmarshalSectionDict count=%d\n",count);
571   if (count==NULL_LIST) return 0; // null list
572   SectionDict *result = new SectionDict(17);
573   assert(count<1000000);
574   for (i=0;i<count;i++)
575   {
576     QCString key    = unmarshalQCString(s);
577     SectionInfo *si = (SectionInfo *)unmarshalObjPointer(s);
578     //printf("  unmarshalSectionDict i=%d key=%s si=%s\n",count,key.data(),si->label.data());
579     result->append(key,si);
580   }
581   return result;
582 }
583
584 MemberSDict *unmarshalMemberSDict(StorageIntf *s)
585 {
586   uint i;
587   uint count = unmarshalUInt(s);
588   //printf("--- unmarshalMemberSDict count=%d\n",count);
589   if (count==NULL_LIST) 
590   {
591     //printf("--- end unmarshalMemberSDict\n");
592     return 0; // null list
593   }
594   MemberSDict *result = new MemberSDict;
595   assert(count<1000000);
596   //printf("Reading %d key-value pairs\n",count);
597   for (i=0;i<count;i++)
598   {
599     //printf("  unmarshaling pair %d\n",i);
600     QCString key    = unmarshalQCString(s);
601     //printf("  unmarshaling key %s\n",key.data());
602     MemberDef *md = (MemberDef *)unmarshalObjPointer(s);
603     //printf("  unmarshalMemberSDict i=%d key=%s md=%p\n",i,key.data(),md);
604     result->append(key,md); 
605   }
606
607   //printf("--- end unmarshalMemberSDict\n");
608   return result;
609 }
610
611 DocInfo *unmarshalDocInfo(StorageIntf *s)
612 {
613   uint count = unmarshalUInt(s); 
614   if (count==NULL_LIST) return 0;
615   DocInfo *result = new DocInfo;
616   result->doc  = unmarshalQCString(s);
617   result->line = unmarshalInt(s);
618   result->file = unmarshalQCString(s);
619   return result;
620 }
621
622 BriefInfo *unmarshalBriefInfo(StorageIntf *s)
623 {
624   uint count = unmarshalUInt(s); 
625   if (count==NULL_LIST) return 0;
626   BriefInfo *result = new BriefInfo;
627   result->doc     = unmarshalQCString(s);
628   result->tooltip = unmarshalQCString(s);
629   result->line    = unmarshalInt(s);
630   result->file    = unmarshalQCString(s);
631   return result;
632 }
633
634 BodyInfo *unmarshalBodyInfo(StorageIntf *s)
635 {
636   uint count = unmarshalUInt(s); 
637   if (count==NULL_LIST) return 0;
638   BodyInfo *result = new BodyInfo;
639   result->startLine = unmarshalInt(s);
640   result->endLine   = unmarshalInt(s);
641   result->fileDef   = (FileDef*)unmarshalObjPointer(s);
642   return result;
643 }
644
645 GroupList *unmarshalGroupList(StorageIntf *s)
646 {
647   uint i;
648   uint count = unmarshalUInt(s);
649   if (count==NULL_LIST) return 0; // null list
650   assert(count<1000000);
651   GroupList *result = new GroupList;
652   for (i=0;i<count;i++)
653   {
654     GroupDef *gd = (GroupDef *)unmarshalObjPointer(s);
655     result->append(gd);
656   }
657   return result;
658 }
659
660 MemberList *unmarshalMemberList(StorageIntf *s)
661 {
662   uint i;
663   uint count = unmarshalUInt(s); 
664   if (count==NULL_LIST) return 0;
665   MemberList *result = new MemberList;
666   assert(count<1000000);
667   for (i=0;i<count;i++)
668   {
669     MemberDef *md = (MemberDef*)unmarshalObjPointer(s);
670     result->append(md);
671   }
672   result->unmarshal(s);
673   return result;
674 }
675
676 ExampleSDict *unmarshalExampleSDict(StorageIntf *s)
677 {
678   uint i;
679   uint count = unmarshalUInt(s); 
680   if (count==NULL_LIST) return 0;
681   ExampleSDict *result = new ExampleSDict;
682   assert(count<1000000);
683   for (i=0;i<count;i++)
684   {
685     QCString key = unmarshalQCString(s);
686     Example *e = new Example;
687     e->anchor = unmarshalQCString(s);
688     e->name   = unmarshalQCString(s);
689     e->file   = unmarshalQCString(s);
690     result->inSort(key,e);
691   }
692   return result;
693 }
694
695 SDict<MemberList> *unmarshalMemberLists(StorageIntf *s)
696 {
697   uint i;
698   uint count = unmarshalUInt(s); 
699   if (count==NULL_LIST) return 0;
700   SDict<MemberList> *result = new SDict<MemberList>(7);
701   assert(count<1000000);
702   for (i=0;i<count;i++)
703   {
704     QCString key = unmarshalQCString(s);
705     MemberList *ml = (MemberList *)unmarshalObjPointer(s);
706     result->append(key,ml);
707   }
708   return result;
709 }
710
711 Entry * unmarshalEntry(StorageIntf *s)
712 {
713   Entry *e = new Entry;
714   uint header=unmarshalUInt(s);
715   ASSERT(header==HEADER);
716   e->name             = unmarshalQCString(s);
717   e->type             = unmarshalQCString(s);
718   e->section          = unmarshalInt(s);
719   e->protection       = (Protection)unmarshalInt(s);
720   e->mtype            = (MethodTypes)unmarshalInt(s);
721   e->spec             = unmarshalInt(s);
722   e->initLines        = unmarshalInt(s);
723   e->stat             = unmarshalBool(s);
724   e->explicitExternal = unmarshalBool(s);
725   e->proto            = unmarshalBool(s);
726   e->subGrouping      = unmarshalBool(s);
727   e->callGraph        = unmarshalBool(s);
728   e->callerGraph      = unmarshalBool(s);
729   e->virt             = (Specifier)unmarshalInt(s);
730   e->args             = unmarshalQCString(s);
731   e->bitfields        = unmarshalQCString(s);
732   delete e->argList;
733   e->argList          = unmarshalArgumentList(s);
734   e->tArgLists        = unmarshalArgumentLists(s);
735   e->program          = unmarshalQGString(s);
736   e->initializer      = unmarshalQGString(s);
737   e->includeFile      = unmarshalQCString(s);
738   e->includeName      = unmarshalQCString(s);
739   e->doc              = unmarshalQCString(s);
740   e->docLine          = unmarshalInt(s);
741   e->docFile          = unmarshalQCString(s);
742   e->brief            = unmarshalQCString(s);
743   e->briefLine        = unmarshalInt(s);
744   e->briefFile        = unmarshalQCString(s);
745   e->inbodyDocs       = unmarshalQCString(s);
746   e->inbodyLine       = unmarshalInt(s);
747   e->inbodyFile       = unmarshalQCString(s);
748   e->relates          = unmarshalQCString(s);
749   e->relatesType      = (RelatesType)unmarshalInt(s);
750   e->read             = unmarshalQCString(s);
751   e->write            = unmarshalQCString(s);
752   e->inside           = unmarshalQCString(s);
753   e->exception        = unmarshalQCString(s);
754   e->typeConstr       = unmarshalArgumentList(s);
755   e->bodyLine         = unmarshalInt(s);
756   e->endBodyLine      = unmarshalInt(s);
757   e->mGrpId           = unmarshalInt(s);
758   delete e->extends;
759   e->extends          = unmarshalBaseInfoList(s);
760   delete e->groups;
761   e->groups           = unmarshalGroupingList(s);
762   delete e->anchors;
763   e->anchors          = unmarshalSectionInfoList(s);
764   e->fileName         = unmarshalQCString(s);
765   e->startLine        = unmarshalInt(s);
766   e->sli              = unmarshalItemInfoList(s);
767   e->lang             = (SrcLangExt)unmarshalInt(s);
768   e->hidden           = unmarshalBool(s);
769   e->artificial       = unmarshalBool(s);
770   e->groupDocType     = (Entry::GroupDocType)unmarshalInt(s);
771   return e;
772 }
773
774 Entry * unmarshalEntryTree(StorageIntf *s)
775 {
776   Entry *e = unmarshalEntry(s);
777   uint count = unmarshalUInt(s);
778   uint i;
779   for (i=0;i<count;i++)
780   {
781     e->addSubEntry(unmarshalEntryTree(s));
782   }
783   return e;
784 }