Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
A_Event.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file A_Event.cc
1 #include "A_Event.h"
2 
3 #include "EventTypes.h"
4 
5 #include "packet_collection.h"
6 
7 #include "packet.h"
8 #include "Cframe.h"
9 #include "framePackets.h"
10 #include "dataBlock.h"
11 
12 #include "frameRoutines.h"
13 #include "frameHdr.h"
14 
15 
16 // the constructor first ----------------
18 {
19  // set the framlist pointer to 0 just in case.
20  framelist = 0;
21 
22 
23  hasMap = 0;
24  // we always make a pointer-based event.
25  is_data_type = 0;
26  errorcode = 0;
27 
28  // cast the pointer to the EventData pointer
29  EventData = (evtdata_ptr) data;
31  {
32  errorcode=1;
33  }
34  else
35  {
37  }
38 }
39 
41 {
42  // set the framlist pointer to 0 just in case.
43  framelist = 0;
44 
45  hasMap = 0;
46  // we always make a pointer-based event.
47  errorcode = 0;
48  is_data_type = 0;
49 
50  // cast the pointer to the EventData pointer
51  EventData = (evtdata_ptr) data;
53  {
54  errorcode=1;
55  }
56  else
57  {
59  }
60 
61 }
62 
64 {
65  delete [] framelist;
66  if (is_data_type) delete [] (PHDWORD *) EventData;
67  pmap.clear();
68 
69 }
70 
71 
72 // the info-type calls
73 unsigned int
75 {
76  return EventData->evt_length;
77 }
78 
79 int
81 {
82  return EventData->evt_type;
83 }
84 
85 int
87 {
88  return EventData->evt_sequence;
89 }
90 
91 int
93 {
94  return EventData->run_number;
95 }
96 
97 #ifdef WIN32
98 const ULONGLONG ticOffset = 35067168000000000UL;
99 const ULONGLONG ticFactor = 10000000;
100 #else
101 const unsigned long long ticOffset = 35067168000000000ULL;
102 const unsigned long long ticFactor = 10000000;
103 #endif
104 
105 
106 time_t A_Event::getTime() const
107 {
108  if ( EventData->time == -1)
109  {
110  return (time_t) EventData->date;
111  }
112  else
113  {
114 
115  unsigned long long x,y,z;
116  x = (unsigned int) EventData->time;
117  y = (unsigned int) EventData->date;
118  z = y | ( x<<32 );
119  time_t t = (z - ticOffset) / ticFactor;
120  return t;
121  }
122 }
123 
124 
125 void A_Event::listFrame ( const int id, OSTREAM &os) const
126 {
127  PHDWORD *fp;
128  PHDWORD *pp;
129  int i = 0;
130  int j = 0;
131 
132  if (id == 0)
133  {
134 
135  while ( ( fp = framelist[i++]) )
136  {
137  dumpFrame(fp, os);
138  //os << "Frame " << ++j << "align length: "<< getFrameAlignLength(fp) << std::endl;
139  }
140  }
141  else // find the frame for a given packet
142  {
143 
144  while ( (fp = framelist[i++]) )
145  {
146  j++;
147  if ( ( pp = findFramePacketId (fp, id) ) != ptrFailure)
148  {
149  dumpFrame(fp, os);
150  //os << "Frame " << j << "align length: "<< getFrameAlignLength(fp) << std::endl;
151  return;
152  }
153  }
154  }
155 }
156 
157 void
158 A_Event::listHistory(const int id, OSTREAM &os) const
159 {
160  os << "History Block: " << std::endl;
161 
162  int i = 0;
163  if (id == 0)
164  {
165  while ( PHDWORD* fp = framelist[i++] )
166  {
167  PHDWORD* h_ptr = findFrameHistoryStart(fp);
168  UINT len = getFrameHistoryLength(fp);
169  dumpBlock(h_ptr, len, os);
170  }
171  }
172  else // find the frame for a given packet
173  {
174  int j = 0;
175  while ( PHDWORD* fp = framelist[i++] )
176  {
177  j++;
178  if ( findFramePacketId(fp, id) != ptrFailure )
179  {
180  PHDWORD* h_ptr = findFrameHistoryStart(fp);
181  UINT len = getFrameHistoryLength(fp);
182  dumpBlock(h_ptr, len, os);
183  return;
184  }
185  }
186  }
187  return;
188 }
189 
190 void
191 A_Event::listError( const int id, OSTREAM& os ) const
192 {
193  os << "Error Block: " << std::endl;
194  int i = 0;
195  if (id == 0)
196  {
197  while ( PHDWORD* fp = framelist[i++] )
198  {
199  PHDWORD* ptr = findFrameErrorStart(fp);
200  UINT len = getFrameErrorLength(fp);
201  dumpBlock(ptr, len, os);
202  dumpErrorBlock(fp,os);
203  }
204  }
205  else // find the frame for a given packet
206  {
207  int j = 0;
208  while ( PHDWORD* fp = framelist[i++] )
209  {
210  j++;
211  if ( findFramePacketId(fp, id) != ptrFailure )
212  {
213  PHDWORD* ptr = findFrameErrorStart(fp);
214  UINT len = getFrameErrorLength(fp);
215  dumpBlock(ptr, len, os);
216  return;
217  }
218  }
219  }
220 }
221 
223 {
224  // DLW: for SEQ number and code, there is no corresponding routine in Cframe.h,
225  // so I directly unpack the field. This will break if the frame format ever changes...
226  //
227  os << "Frame length: " << std::dec << getFrameLength(fp) << std::endl;
228  os << "Frame mark: " << std::hex << getFrameMark(fp) << std::dec << std::endl;
229  os << "Frame Hdr version: " << getFrameHdrVersion(fp) << std::endl;
230  os << "Frame Hdr length: " << getFrameHdrLength(fp) << std::endl ;
231  os << "Frame Status: " << getFrameStatus(fp) << std::endl;
232  os << "Frame Seq Number: " << (((*(fp+3))&0xff000000)>>24) << std::endl;
233  os << "Frame Seq Code: " << (((*(fp+3))&0x00ff0000)>>24) << std::endl;
234  os << "Frame Source id: " << getFrameSourceId(fp) << std::endl;
235  os << "Frame data type: " << getFrameDataType(fp) << std::endl;
236  os << "Frame type: " << getFrameType(fp) << std::endl;
237  os << "Frame Error Length: " << getFrameErrorLength(fp) << std::endl;
238  os << "Frame Hist Length: " << getFrameHistoryLength(fp) << std::endl;
239  os << "Frame align length: " << getFrameAlignLength(fp) << std::endl;
240  os << "Frame padding: " << getFramePadding(fp) << std::endl;
241  unsigned int i = 0;
243  for (i = 0; i< getFrameAlignLength(fp); i++ )
244  {
245  os << " - Alignment word " << SETW(2) << i << ": 0x" ;
246 
247  os.fill('0');
248  os << SETW(8) << std::hex << *p++ << std::dec << std::endl;
249  os.fill (' ');
250  }
251  os << std::endl;
252 }
253 
254 void
256 {
257  PHDWORD* ptr = findFrameErrorStart(fp);
258  UINT len = getFrameErrorLength(fp);
259  UINT nerr = calcNumErrorsV1(len);
260  if ( nerr == 0 ) return;
261 
262  errorEntryV1* p = reinterpret_cast<errorEntryV1*>(ptr);
263  for (UINT i=0; i<nerr; ++i)
264  {
265  errorEntryV1& e = *p;
266  os << "ErrorEntry " << i << ": ";
267  os << "severity: " << (int) e.severity << " "
268  << "deviceType: " << (int)e.deviceType << " "
269  << "deviceId: " << std::dec << e.deviceId << " "
270  << "errorCode: " << e.errorCode << " "
271  << "detectCode: " << e.detectCode << " "
272  << "addData: (" << std::hex << e.addData[0] << "," << std::hex << e.addData[1] << ")"
273  << std::dec
274  << std::endl;
275  p++;
276  }
277  os << std::endl;
278 }
279 
280 void
281 A_Event::dumpBlock(PHDWORD* p, UINT len, OSTREAM& os, const int how)
282 {
283  if ( len == 0 ) {
284  os << " (empty)\n" << std::endl;
285  return;
286  }
287 
288  unsigned int j;
289  switch (how)
290  {
291  case (EVT_HEXADECIMAL):
292  j = 0;
293  while (1)
294  {
295  os << SETW(5) << j << " | ";
296  for ( UINT l=0; l<4; l++ )
297  {
298  if ( j >= len ) break;
299  os << std::hex << SETW(8) << p[j++] << " " ;
300  }
301  if ( j >= len ) break;
302  os << std::dec << std::endl;
303  }
304  break;
305 
306  case (EVT_DECIMAL):
307  j = 0;
308  while (1)
309  {
310  os << std::dec << SETW(5) << j << " | ";
311 
312  for ( UINT l=0; l<6; l++ )
313  {
314  os << SETW(10) << p[j++] << " ";
315  if ( j >= len ) break;
316  }
317  if ( j >= len ) break;
318  os << std::endl;
319  }
320  break;
321 
322  default:
323  break;
324  }
325  os << std::endl << std::endl;
326 
327 }
328 
329 unsigned int A_Event::getFrameEntry(const char *what, const int id, const int index) const
330 {
331 
332  PHDWORD *fp;
333  PHDWORD *pp;
334  int i = 0;
335  int j = 0;
336 
337  if (id == 0)
338  {
339 
340  while ( ( fp = framelist[i++]) )
341  {
342  return getFrameValue( what,fp,index);
343  }
344  }
345  else // find the frame for a given packet
346  {
347 
348  while ( (fp = framelist[i++]) )
349  {
350  j++;
351  if ( ( pp = findFramePacketId (fp, id) ) != ptrFailure)
352  {
353  return getFrameValue( what,fp,index);
354  }
355  }
356  }
357  return 0;
358 }
359 
360 
361 
362 
363 unsigned int A_Event::getFrameValue(const char *what, PHDWORD *fp, const unsigned int index) const
364 {
365 
366  if ( strcmp(what,"FRAMELENGTH") == 0) return getFrameLength(fp);
367  else if ( strcmp(what,"FRAMEMARK") ==0) return getFrameMark(fp);
368  else if ( strcmp(what,"FRAMEHDRVERSION") == 0) return getFrameHdrVersion(fp);
369  else if ( strcmp(what,"FRAMEHDRLENGTH") == 0) return getFrameHdrLength(fp);
370  else if ( strcmp(what,"FRAMESTATUS") == 0) return getFrameStatus(fp);
371  else if ( strcmp(what,"FRAMESOURCEID") ==0 )return getFrameSourceId(fp);
372  else if ( strcmp(what,"FRAMEDATATYPE") == 0) return getFrameDataType(fp);
373  else if ( strcmp(what,"FRAMETYPE") == 0) return getFrameType(fp);
374  else if ( strcmp(what,"FRAMEALIGNLENGTH") == 0) return getFrameAlignLength(fp);
375  else if ( strcmp(what,"FRAMEALIGNMENTWORD") == 0)
376  {
378  if ( index >= getFrameAlignLength(fp) ) return 0;
379  return p[index];
380  }
381 
382  return 0;
383 }
384 
385 
386 // getSubevent (int)
387 Packet*
388 A_Event::getPacket (const int id)
389 {
390  return getPacket(id,0);
391 }
392 
393 #if !defined(SunOS) && !defined(OSF1)
394 
396 {
397  int i = 0;
398  PHDWORD *fp;
399  PHDWORD *pp;
400 
401  if ( ! framelist )
402  {
403  errorcode = -3;
404  }
405 
406  if (errorcode) return 0;
407 
408  unsigned int pos_in_event;
409 
410  if (!hasMap)
411  {
412 
413  while ( (fp = framelist[i++]) )
414  {
415  pp = findFramePacketIndex (fp, 0);
416 
417 
418  while ( pp != ptrFailure)
419  {
420 
421  pos_in_event = ( int )( pp - ( PHDWORD *) EventData );
422 
423  // std::cout << "pos in event = " << pos_in_event <<
424  // " packet length = " << *pp << " ev. length= " << getEvtLength() << std::endl;
425 
426  if (pp && *pp > getEvtLength() - pos_in_event )
427  {
428  std::cout << "Found wrong packet length " << *pp
429  << std::hex << "(0x" << *pp << ")" << std::dec
430  << " packet Id: " << getPacketId(pp)
431  << " Event: " << getEvtSequence()
432  << " EvtLength: " << getEvtLength()
433  << " PosInEvent: " << pos_in_event
434  << std::endl;
435  errorcode =-2;
436  break;
437  }
438  if ( pp != 0 && *pp == 0)
439  {
440  std::cout << "found 0-length packet" << std::endl;
441  errorcode =-1;
442  break;
443  }
444 
445 
446  pmap[getPacketId(pp)] = pp;
447  // std::cout << "Packet id " << getPacketId(pp) << std::endl;
448 
449  pp = findNextFramePacket(fp, pp);
450 
451  }
452  }
453  hasMap = 1;
454  }
455  return 0;
456 }
457 
458 
459 Packet*
460 A_Event::getPacket (const int id, const int hitFormat)
461 {
462 
463  PHDWORD *pp;
464 
465 
466  if (!hasMap) createMap();
467  if ( errorcode) return 0;
468 
469 
470  pp = pmap[id];
471  if (!pp) return 0;
472 
473  return makePacket(pp,hitFormat);
474 }
475 
476 #else
477 
478 // the STL-Free solaris version
479 
480 Packet*
481 A_Event::getPacket (const int id, const int hitFormat)
482 {
483 
484  int i = 0;
485  PHDWORD *fp;
486  PHDWORD *pp;
487  UINT ids = id;
488  int wanted_hitformat;
489 
490  while ( fp = framelist[i++] )
491  {
492  if ( ( pp = findFramePacketId (fp, ids) ) != ptrFailure)
493  {
494  return makePacket(pp,hitFormat);
495  }
496  }
497  return 0;
498 }
499 #endif
500 
501 int
502 A_Event::getPacketList( Packet* sl[], const int ne)
503 {
504  int i = 0;
505  PHDWORD *fp;
506  PHDWORD *pp;
507 
508  if (!hasMap) createMap();
509  if ( errorcode) return 0;
510 
511  int entries = 0;
512 
513  while ( (fp = framelist[i++]) )
514  {
515 
516  pp = findFramePacketIndex (fp, 0);
517 
518  while ( pp != ptrFailure)
519  {
520  if (getPacketStructure(pp) == Unstructured)
521  {
522  sl[entries++] = makePacket(pp,0);
523  // sl[entries-1]->identify();
524 
525  }
526 
527  if (entries >= ne) return ne;
528  if ( (pp = findNextFramePacket(fp, pp)) == ptrFailure)
529  {
530  break;
531  }
532  if (*pp > getEvtLength())
533  {
534  std::cout << "Found wrong packet length " << *pp << std::endl;
535  break;
536  }
537  if ( pp != 0 && *pp == 0)
538  {
539  std::cout << "found 0-length packet" << std::endl;
540  // PHDWORD *x = pp - 10;
541  // std::cout << "--------------------------" << std::endl;
542  // for (i=0; i< 20; i++)
543  // {
544  // std::cout << i << " " << x << " " << std::hex <<*x++ << std::dec << std::endl;
545  // }
546  // std::cout << "--------------------------" << std::endl;
547 
548 
549  break;
550  }
551  }
552  }
553  return entries;
554 }
555 
556 
557 
558 
559 Packet *A_Event::makePacket(PHDWORD *pp, const int hitFormat)
560 {
561 
562  int wanted_hitformat;
563 
564  if (getPacketStructure(pp) != Unstructured) return 0;
565 
566 
567  if (hitFormat) wanted_hitformat = hitFormat;
568  else wanted_hitformat = getUnstructPacketHitFormat(pp);
569 
570  switch (wanted_hitformat)
571  {
572 
573  // pbsc "32 channel format"
574 
575  case 50400:
576  case IDHBD_FPGA:
577  case IDHBD_FPGA0SUP:
578  case IDFOCAL_FPGATEST:
579  return new Packet_hbd_fpga(pp);
580  break;
581 
582  case IDHBD_FPGASHORT:
583  case IDHBD_FPGASHORT0SUP:
584  return new Packet_hbd_fpgashort(pp);
585  break;
586 
587  case IDFVTX_DCM0:
588  case IDFVTX_SIM:
589  return new Packet_fvtx_dcm0(pp);
590  break;
591 
592  case IDCDEVPOLARIMETER:
593  return new Packet_cdevpolarimeter(pp);
594  break;
595 
597  return new Packet_cdevpoltarget(pp);
598  break;
599 
600  case IDCDEVIR:
601  return new Packet_cdevir(pp);
602  break;
603 
604  case IDCDEVWCMHISTORY:
605  return new Packet_cdevwcm(pp);
606  break;
607 
608  case IDCDEVBPM:
609  return new Packet_cdevbpm(pp);
610  break;
611 
612  case IDCDEVDVM:
613  return new Packet_cdevdvm(pp);
614  break;
615 
616  case IDCDEVRING:
617  return new Packet_cdevring(pp);
618  break;
619 
620  case IDCDEVRINGPOL:
621  return new Packet_cdevring(pp);
622  break;
623 
624  case IDCDEVRINGFILL:
625  return new Packet_cdevring(pp);
626  break;
627 
628  case IDCDEVRINGNOPOL:
629  return new Packet_cdevringnopol(pp);
630  break;
631 
632  case IDCDEVBUCKETS:
633  return new Packet_cdevbuckets(pp);
634  break;
635 
636  //mlp 10/27/03 added this - the SIS is a straight array of numbers.
637  case IDCDEVSIS:
638  return new Packet_id4evt(pp);
639  break;
640 
641  case IDCDEVMADCH:
642  return new Packet_cdevmadch(pp);
643  break;
644 
645  case ID4SCALER:
646  return new Packet_id4scaler(pp);
647  break;
648 
649  case IDDIGITIZER_12S:
650  case IDDIGITIZER_16S:
651  case IDDIGITIZER_31S:
652  return new Packet_iddigitizerv2(pp);
653  break;
654 
655  case IDDIGITIZERV3_2S:
656  case IDDIGITIZERV3_4S:
657  case IDDIGITIZERV3_6S:
658  case IDDIGITIZERV3_8S:
659  case IDDIGITIZERV3_12S:
660  case IDDIGITIZERV3_14S:
661  case IDDIGITIZERV3_18S:
662  case IDDIGITIZERV3_20S:
663  case IDDIGITIZERV3_22S:
664  case IDDIGITIZERV3_24S:
665  case IDDIGITIZERV3_26S:
666  case IDDIGITIZERV3_28S:
667  case IDDIGITIZERV3_30S:
668 
669  return new Packet_iddigitizerv3(pp);
670  break;
671 
672  case IDLL1_20S:
673  case IDLL1v2_20S:
674  return new Packet_idll1v1(pp);
675  break;
676 
677  case IDGL1P:
678  return new Packet_gl1p(pp);
679  break;
680 
681  case IDGL1_EVCLOCK:
682  return new Packet_gl1_evclocks(pp);
683  break;
684 
685  case IDGL1PSUM:
686  case IDGL1PSUMOBS:
687  return new Packet_gl1psum(pp);
688  break;
689 
690  case ID4EVT:
691  return new Packet_id4evt(pp);
692  break;
693 
694  case ID2EVT:
695  return new Packet_id2evt(pp);
696  break;
697 
698  case IDCSTR:
699  return new Packet_idcstr(pp);
700  break;
701 
702  case IDSTARSCALER:
703  return new Packet_starscaler(pp);
704  break;
705 
706  default:
707  switch (getUnstructPacketWordSize (pp))
708  {
709  case 1:
710  return new Packet_w1(pp);
711  break;
712  case 2:
713  return new Packet_w2(pp);
714  break;
715  case 4:
716  return new Packet_w4(pp);
717  break;
718  default:
719  return new Packet_w4(pp);
720  }
721  }
722 
723  return 0;
724 }
725 
726 
727 
728 void
730 {
731  os << " -- Event " << EventData->evt_sequence;
732 
733  os << " Run: " << SETW(5) << EventData->run_number;
734 
735  os << " length: " << SETW(5) <<EventData->evt_length;
736 
737  os << " frames: " << SETW(3) << NumberFrames;
738 
739  os << " type: " << SETW(2) << EventData->evt_type ;
740 
741  os << " (" << get_evt_mnemonic(EventData->evt_type );
742 
743 
744  if ( ( EventData->evt_type & CORRUPTEVENTMASK ) )
745  {
746  os << " *Corrupt* ";
747  }
748  os << ") ";
749 
750  time_t x = getTime();
751  os << x;
752 
753  os << std::endl;
754 
755 };
756 
757 
758 
759 int
760 A_Event::existPacket (const int id)
761 {
762 #if !defined(SunOS) && !defined(OSF1)
763 
764  PHDWORD *pp;
765 
766  if (!hasMap)
767  {
768  createMap();
769  }
770 
771  pp = pmap[id];
772 
773  if (!pp)
774  {
775  return 0;
776  }
777  return 1;
778 #else
779  return 0;
780 #endif
781 }
782 
783 
784 
785 // the Copy routine
786 int
787 A_Event::Copy (int * array, const unsigned int length, int *nw, const char *what)
788 {
789  if (length< getEvtLength() )
790  {
791  *nw = 0;
792  return -1;
793  }
794  char *to = (char *) array;
795  char *from;
796  unsigned int l;
797  if ( strcmp (what, "DATA") ==0 )
798  {
799  from= (char *) &EventData->data[0];
801  }
802  else
803  {
804  from= (char *) EventData;
805  l = getEvtLength();
806  }
807  // for (i=0; i<l ; i++) *to++ = *from++;
808  //
809  *nw = l;
810  memcpy (to, from, l*4);
811  return 0;
812 }
813 
815 {
816  if (is_data_type) return -1;
817 
818  PHDWORD *tmp;
819 
820  tmp = new PHDWORD[getEvtLength()];
821  PHDWORD *from= (PHDWORD *) EventData;
822  PHDWORD *to=tmp;
823  for (unsigned int k=0; k< getEvtLength(); k++)
824  {
825  *to++ = *from++;
826  }
827 
828  delete [] framelist;
829  EventData = (evtdata_ptr) tmp;
830  updateFramelist();
831 
832  is_data_type = 1;
833  pmap.clear();
834  hasMap = 0;
835  return 0;
836 
837 }
838 
840 {
841  if (is_data_type) return 0;
842  else return 1;
843 }
844 
845 
847 {
848  // go through the data and see how may,
849  // if any, frames we have got.
850  int max_index = EventData->evt_length - EVTHEADERLENGTH;
851  int index = 0;
852  int number_of_frames = 0;
853  int flength;
854  int cont;
855  int i;
856  // count the number of frames, and allocate a properly-sized vector
857  // with pointers to it.
858  cont = 1;
859  while (index < max_index && cont)
860  {
861  PHDWORD *f = &EventData->data[index];
862  // so here we believe that we point to a frame start
863  if ( validFrameHdr(f) )
864  {
865  number_of_frames++;
866  flength = getFrameLength (f);
867  index += flength;
868  }
869  else
870  {
871  COUT << "invalid frame header, frame nr " << number_of_frames << " index = " << index << std::endl; //mlpd
872  COUT << " -- Event*" << EventData->evt_sequence;
873 
874  COUT << " Run: " << SETW(5) << EventData->run_number;
875 
876  COUT << " length: " << SETW(5) <<EventData->evt_length;
877 
878  COUT << " type: " << SETW(2) << EventData->evt_type
879  << " (" << get_evt_mnemonic(EventData->evt_type) << ") ";
880  COUT << std::endl;
881 
882  for (i=0; i< 8; i++)
883  COUT << i << " " << std::hex << f[i] << std::dec << std::endl;
884 
885  return -1;
886 
887  // COUT << "I will continue anyway" << std::endl;
888  // cont = 0;
889  }
890  }
891 
892  // ok, so many frames. get the vector.
893  framelist = new PHDWORD *[number_of_frames +1];
894 
895  // NumberFrames is a class data member.
896  NumberFrames = number_of_frames;
897 
898  // now we go through once more and remember the pointers to where the
899  // frames start
900  index = 0;
901  int ifn = 0;
902  while (index < max_index && cont)
903  {
904  PHDWORD *f = &EventData->data[index];
905  if ( validFrameHdr(f) )
906  {
907  framelist[ifn++] = f;
908  flength = getFrameLength (f);
909  index += flength;
910  }
911  else
912  {
913  COUT << "invalid frame header, frame nr " << ifn << " index = " << index << std::endl; //mlpd
914  for (i=0; i< 8; i++)
915  COUT << i << " " << std::hex << f[i] << std::dec << std::endl;
916 
917 
918  cont = 0;
919  }
920  }
921 
922  //we terminate the list of frames with a 0.
923  framelist[ifn] = 0;
924  return 0;
925 }
926 
928 {
929 #if !defined(SunOS) && !defined(OSF1)
930  createMap();
931 #endif
932  return errorcode;
933 }