/*------------------------------------------------------------------*/ static void analyze_root (void) { uint32 nb_roots, i, slen; nb_roots = rlong(); fprintf(mfp, "Number of roots is %d\n", nb_roots); for (i = 0; i < nb_roots; i++) { fprintf(mfp, "Root class/feature name: "); slen = rlong(); while (slen--) { fprintf (mfp, "%c", rchar()); ++i; } fprintf (mfp,"\nRoot class routine ID: %d\n", rlong ()); /* Root type computation */ (void) rlong (); /* Read dynamic type of ANY. */ fprintf (mfp,"Root type description: "); { short t; fprintf (mfp, "{"); while ((t = rshort())!=-1) { fprintf (mfp, "%d, ", (int) t); } fprintf (mfp, "-1}"); fprintf (mfp, "\n"); } fprintf (mfp,"Root class arguments : %d\n", rlong ()); } }
ParametersIPtr ParametersI::grp(Ice::Long id) { if (0 == this->theFilter) { this->theFilter = new omero::sys::Filter(); } this->theFilter->groupId = rlong(id); return this; }
static void analyze_file (void) { if (rchar ()) { fprintf (mfp, "Needs update : YES\n"); } else { fprintf (mfp,"Needs update : NO\n"); return; } print_line (); if (rchar ()) { fprintf (mfp, "Non-IEEE comparison for floating points\n"); } else { fprintf (mfp, "IEEE comparison for floating points\n"); } fprintf (mfp,"Nr. of class types : %d\n", rlong ()); fprintf (mfp,"Nr. of classes : %d\n", rlong ()); fprintf (mfp,"Nr. of original routine bodies : %d\n", rlong ()); print_line (); fprintf (mfp,"Profile level : %d\n", rlong ()); print_line (); analyze_cnodes (); read_byte_code (); analyze_parents (); analyze_options (); analyze_routinfo (); analyze_desc (); analyze_root (); print_line (); }
ParametersIPtr ParametersI::addLongs(const std::string& name, omero::sys::LongList longs) { omero::RListPtr list = rlist(); omero::sys::LongList::const_iterator beg = longs.begin(); omero::sys::LongList::const_iterator end = longs.end(); while (beg != end) { list->add(rlong(*beg)); beg++; } this->map[name] = list; return this; }
ParametersIPtr ParametersI::addLong(const std::string& name, Ice::Long l) { return add(name, rlong(l)); }
ParametersIPtr ParametersI::addId(Ice::Long id) { return add("id", rlong(id)); }
static void analyze_desc (void) { long count, tid, info, type, offset, i, j; short org_count, info_count, org_id; short *dinfo; char c; printf ("Analyzing Desc\n"); fprintf (mfp,"Descriptors : (desc_tab)\n"); while ((count = rlong()) != -1L) { while (count-- > 0) { tid = (long) rshort (); org_count = rshort (); while (org_count-- > 0) { org_id = rshort (); fprintf (mfp,"Origin_id %5d Dtype_id %8ld\n", (int) org_id, tid); info_count = rshort (); dinfo = NULL; if (info_count < 0) { panic(); } else if (info_count > 0) { dinfo = (short *) malloc (3*info_count * sizeof (short)); if (dinfo == (short *) 0) { fprintf (stderr,"Out of memory\n"); panic (); } } i = 0; j = info_count; while (j--) { c = rchar(); type = (long) rshort(); if (c && (type != -1)) { while (rshort() != -1) { } } info = (long) rbody_index (); offset = (long) ruint32 (); dinfo [i++] = (short) info; dinfo [i++] = (short) offset; dinfo [i++] = (short) type; } fprintf (mfp, "desc_tab [%d][%ld] = ", org_id, tid-1); for (i = 0; i < info_count; ++i) { if ((i % 8) == 0) { fprintf (mfp, "\n "); } fprintf (mfp, "%ld: (%d,%d,%d) ", i, dinfo [3*i], dinfo [3*i+1], dinfo [3 * i + 2]); } fprintf (mfp, "\n"); if (dinfo != (short *) 0) { free ((char *) dinfo); } } } } print_line (); }
static void read_byte_code (void) { long body_id, bsize; int i; printf ("Analyzing Byte code\n"); bfp = fopen ("bytecode.eif", "wb"); if (bfp == (FILE *) 0) { fprintf (stderr,"Cannot open file <%s>\n", "bytecode.eif"); panic (); } msize = rlong (); melt = (char **) malloc (msize * sizeof (char *)); if (melt == (char **) 0) { fprintf (stderr,"Out of memory (read_byte_code)\n"); panic (); } /* Write dynamic type names */ if (fwrite (&dtype_max, sizeof (int), 1, bfp) != 1) { fprintf (stderr,"Write error\n"); panic (); } for (i = 0; i <= dtype_max; ++i) { if (dtype_names [i] != (char *) 0) fprintf (bfp, "%s%c", dtype_names [i], '\0'); else fprintf (bfp, "%c", '\0'); } /* Write classtypes names */ if (fwrite (&ctype_max, sizeof (int), 1, bfp) != 1) { fprintf (stderr,"Write error\n"); panic (); } for (i = 0; i <= ctype_max; ++i) { if (ctype_names [i] != (char *) 0) fprintf (bfp, "%s%c", ctype_names [i], '\0'); else fprintf (bfp, "%c", '\0'); } for (;;) { body_id = rlong (); if (fwrite (&body_id, sizeof (int), 1, bfp) != 1) { fprintf (stderr,"Write error\n"); panic (); } if (body_id == -1) break; fprintf (mfp," Body id : %ld\n", body_id); bsize = rlong (); fprintf (mfp," Size : %ld\n", bsize); fprintf (mfp," Pattern id : %d\n", rlong ()); melt [body_id] = rbuf ((int) bsize); if (fwrite (&bsize, sizeof (int), 1, bfp) != 1) { fprintf (stderr,"Write error\n"); panic (); } if (fwrite (melt [body_id], sizeof (char), bsize, bfp) != (size_t) bsize) { fprintf (stderr,"Write error\n"); panic (); } free ((char *) (melt [body_id])); } free ((char *) melt); print_line (); }
static void analyze_cnodes (void) { long count, acount, pers_acount, i; short slen, dtype; char *dname; printf ("Analyzing Cnodes\n"); count = rlong (); fprintf (mfp,"Cnode update entries : %ld\n", count); if (!count) print_line (); while (count--) { dtype = rshort (); fprintf (mfp,"Dynamic class type : %d\n", (int) dtype); fprintf (mfp,"Generating class : "); slen = rshort (); dname = malloc (slen + 2); if (dname == (char *) 0) { fprintf (stderr, "Out of memory\n"); panic (); } i = 0; while (slen--) { dname [i] = rchar (); fprintf (mfp,"%c", dname [i]); ++i; } dname [i] = '\0'; fprintf (mfp,"\n"); acount = rlong (); pers_acount = rlong (); fprintf (mfp,"Nr. of attributes : %ld\n", acount); fprintf (mfp,"Nr. of persistent attributes : %ld\n", pers_acount); i = acount; while (i--) { fprintf (mfp," Attribute name : "); slen = rshort (); while (slen--) fprintf (mfp,"%c", rchar ()); fprintf (mfp,"\n"); } i = acount; while (i--) { fprintf (mfp," Attribute type : "); print_dtype (ruint32()); fprintf (mfp, "\n"); } /* Read attribute flags. */ i = acount; while (i--) { fprintf (mfp," Attribute flags: "); fprintf (mfp, "%d ", (int) rshort()); } fprintf (mfp, "\n"); i = acount; while (i--) { fprintf (mfp," Full Attribute type : "); if (rshort ()) { short t; fprintf (mfp, "{"); while ((t = rshort())!=-1) fprintf (mfp, "%d, ", (int) t); fprintf (mfp, "-1}"); } fprintf (mfp, "\n"); } fprintf (mfp,"Skeleton flags are : 0x%x\n", (int) rshort ()); fprintf (mfp,"Attribute ids : %ld\n", acount); i = acount; while (i--) { fprintf (mfp," Id : %d\n", ruint32 ()); } fprintf (mfp,"Reference number : %d\n", rlong ()); fprintf (mfp,"Node size : %d\n", rlong ()); fprintf (mfp,"Routine creation id: %d\n", ruint32 ()); fprintf (mfp,"Version : "); slen = rshort (); if (slen) { while (slen--) { fprintf (mfp,"%c", rchar ()); } } else { fprintf (mfp, "NULL"); } fprintf (mfp, "\n"); print_line (); } }
static void prepare_types (void) { long count, acount, i; short slen, dtype; char *dname; (void) rchar (); /* Is there something to read */ (void) rchar (); /* Are we biding to IEEE arithmetic .*/ (void) rlong (); /* class types count */ (void) rlong (); /* class count */ (void) rlong (); /* number of original routine bodies */ (void) rlong (); /* prof enabled */ dtype_size = MAX_TYPE; dtype_max = -1; dtype_names = (char **) malloc (dtype_size * sizeof (char *)); if (dtype_names == (char **) 0) { fprintf (stderr, "Out of memory\n"); panic (); } else { memset (dtype_names, 0, dtype_size * sizeof (char *)); } ctype_size = MAX_TYPE; ctype_max = -1; ctype_names = (char **) malloc (ctype_size * sizeof (char *)); if (ctype_names == (char **) 0) { fprintf (stderr, "Out of memory\n"); panic (); } else { memset (ctype_names, 0, ctype_size * sizeof (char *)); } count = rlong (); /* Number of feature table update. */ if (count < 0) { panic (); } while (count--) { dtype = rshort (); if (dtype < 0) { panic (); } slen = rshort (); dname = malloc (slen + 2); if (dname == (char *) 0) { fprintf (stderr, "Out of memory\n"); panic (); } i = 0; while (slen--) { dname [i] = rchar (); ++i; } dname [i] = '\0'; if (dtype > dtype_max) dtype_max = dtype; if (dtype >= dtype_size) { int old_size = dtype_size; dtype_size = dtype + 256; dtype_names = (char **) realloc ((char *) dtype_names, dtype_size * sizeof (char *)); if (dtype_names == (char **) 0) { fprintf (stderr, "Out of memory\n"); panic (); } else { memset (dtype_names + old_size, 0, (dtype_size - old_size) * sizeof (char *)); } } dtype_names [dtype] = dname; acount = rlong (); /* Number of attributes. */ (void) rlong (); /* Number of persistent attributes. */ i = acount; /* Read attribute name. */ while (i--) { slen = rshort (); while (slen--) (void) rchar (); } i = acount; /* Read attribute types. */ while (i--) { (void) ruint32 (); } i = acount; /* Read attribute flags. */ while (i--) { (void) rshort (); } i = acount; /* Read attribute full types. */ while (i--) { while (rshort() != -1) ; } (void) rshort(); /* Skeleton flags */ i = acount; /* Read attribute routine ID array. */ while (i--) (void) ruint32 (); (void) rlong (); /* Number of references. */ (void) rlong (); /* Size of node. */ (void) ruint32 (); /* Creation Routine ID. */ /* Read Version info if any. */ slen = rshort (); while (slen--) { (void) rchar (); } } }