VOID LIClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif LONG number = pmsg.OL_Cnt[pmsg.OL_Level]; struct ArgList args[] = { { "VALUE", &number, ARG_NUMBER, NULL }, { NULL, NULL, 0, NULL } }; ScanArgs(pmsg.Locked, args); if(pmsg.OpenCounts[tag_OL]) { if(pmsg.OL_Level < 3) { Number = number++; pmsg.OL_Cnt[pmsg.OL_Level] = number; } } TreeClass::Parse(pmsg); }
static void PrintGeoTags(GTIF *gt, GTIFPrintMethod print,void *aux) { double *data; int count; tiff_t *tif=gt->gt_tif; if( tif == NULL ) return; if ((gt->gt_methods.get)(tif, GTIFF_TIEPOINTS, &count, &data )) PrintTag(GTIFF_TIEPOINTS,count/3, data, 3, print, aux); if ((gt->gt_methods.get)(tif, GTIFF_PIXELSCALE, &count, &data )) PrintTag(GTIFF_PIXELSCALE,count/3, data, 3, print, aux); if ((gt->gt_methods.get)(tif, GTIFF_TRANSMATRIX, &count, &data )) PrintTag(GTIFF_TRANSMATRIX,count/4, data, 4, print, aux); }
void AMXStackFramePrinter::PrintArgument(const AMXStackFrame &frame, const AMXDebugSymbol &arg, int index) { if (arg.IsReference()) { stream_ << "&"; } PrintTag(arg); stream_ << arg.GetName(); if (!arg.IsVariable()) { std::vector<AMXDebugSymbolDim> dims = arg.GetDims(); if (arg.IsArray() || arg.IsArrayRef()) { for (std::size_t i = 0; i < dims.size(); ++i) { if (dims[i].GetSize() == 0) { stream_ << "[]"; } else { std::string tag = debug_info_.GetTagName(dims[i].GetTag()) + ":"; if (tag == "_:") tag.clear(); stream_ << "[" << tag << dims[i].GetSize() << "]"; } } } } stream_ << "="; PrintArgumentValue(frame, arg, index); }
void AMXStackFramePrinter::PrintCallerName(const AMXStackFrame &frame) { if (IsMain(frame.amx(), frame.caller_address())) { stream_ << "main"; return; } if (debug_info_.IsLoaded()) { AMXDebugSymbol caller = debug_info_.GetExactFunction(frame.caller_address()); if (caller) { if (IsPublicFunction(frame.amx(), caller.GetCodeStart()) && !IsMain(frame.amx(), caller.GetCodeStart())) { stream_ << "public "; } PrintTag(caller); stream_ << caller.GetName(); return; } } const char *name = 0; if (frame.caller_address() != 0) { name = frame.amx().FindPublic(frame.caller_address()); } if (name != 0) { stream_ << "public " << name; } else { stream_ << "??"; } }
VOID AttrClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.AdvancedNextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif }
Box2di cWindowXmlEditor::Draw(Pt2di aP0,cElXMLTree * aTree,int aLev,cElXMLTree * aFilter) { Box2di aBoxNone(aP0,aP0); if (! mSelector->SelectTree(aTree)) return aBoxNone; if (aTree->Profondeur() <= 1) { return PrintTag(aP0,aTree,0,aLev,aFilter); } aP0.y +=mSpaceTag; Box2di aRes = PrintTag(aP0,aTree,1,aLev,aFilter); for ( std::list<cElXMLTree *>::iterator itF= aTree->Fils().begin(); itF != aTree->Fils().end(); itF++ ) { cElXMLTree * aFilsFilter = aFilter ? aFilter->GetOneOrZero((*itF)->ValTag()) : 0; if ((aFilter==0) || (aFilsFilter!=0)) { Box2di aBox = Draw(Pt2di(aP0.x+mDecalX,aRes._p1.y),*itF,aLev+1,aFilsFilter); aRes = Sup(aRes,aBox); } } Box2di aBoxFerm = PrintTag(Pt2di(aP0.x,aRes._p1.y),aTree,-1,aLev,aFilter); aRes = Sup(aBoxFerm,aRes); if (mXmlMode) { mW.draw_rect(Pt2dr(aRes._p0),Pt2dr(EndXOfLevel(aLev),aRes._p1.y),mW.pdisc()(P8COL::red)); } aRes._p1.y += mSpaceTag; return aRes; }
VOID DummyClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif TreeClass::Parse(pmsg); }
void AMXStackFramePrinter::PrintCallerName(const AMXStackFrame &frame, const AMXDebugSymbol &caller) { bool is_public = IsPublicFunction(frame.amx(), caller.GetCodeStart()); bool is_main = IsMain(frame.amx(), caller.GetCodeStart()); if (is_public && !is_main) { *stream_ << "public "; } PrintTag(caller); *stream_ << caller.GetName(); }
VOID TextAreaClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif BOOL disabled = FALSE, readonly = FALSE; struct ArgList args[] = { { "NAME", &Name, ARG_STRING, NULL }, { "DISABLED", &disabled, ARG_SWITCH, NULL }, { "READONLY", &readonly, ARG_SWITCH, NULL }, { "COLS", &Columns, ARG_NUMBER, NULL }, { "ROWS", &Rows, ARG_NUMBER, NULL }, { NULL, NULL, 0, NULL } }; Rows = 10; Columns = 40; ScanArgs(pmsg.Locked, args); if(disabled) Flags |= FLG_TextArea_Disabled; if(readonly) Flags |= FLG_TextArea_ReadOnly; pmsg.SetLock(); pmsg.NextStartBracket(); Contents = new (std::nothrow) char[pmsg.Current-pmsg.Locked+1]; if (!Contents) return; STRPTR src = pmsg.Locked, dst = Contents; while(*src != '<' && *src) { struct EntityInfo *entity; if(*src == '&' && (entity = GetEntityInfo(src+1))) { *dst++ = entity->ByteCode; src += strlen(entity->Name)+1; if(*src == ';') src++; } else { *dst++ = *src++; } } *dst = '\0'; Flags |= FLG_AllElementsPresent | FLG_ArgumentsRead;; pmsg.Gadgets = TRUE; }
VOID NoFramesClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif pmsg.NoFrames = TRUE; TreeClass::Parse(pmsg); pmsg.NoFrames = FALSE; }
VOID OLClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif STRPTR type = NULL; LONG start = 1; struct ArgList args[] = { { "TYPE", &type, ARG_STRING, NULL }, { "START", &start, ARG_NUMBER, NULL }, { NULL, NULL, 0, NULL } }; ScanArgs(pmsg.Locked, args); if(type) { switch(*type) { case 'a': Type = OL_LowerAlpha; break; case 'A': Type = OL_UpperAlpha; break; case 'i': Type = OL_LowerRoman; break; case 'I': Type = OL_UpperRoman; break; } delete type; } APTR handle; if((handle = Backup(pmsg, 1, tag_LI))) { if(++pmsg.OL_Level < 3) pmsg.OL_Cnt[pmsg.OL_Level] = start; TreeClass::Parse(pmsg); pmsg.OL_Level--; Restore(pmsg.OpenCounts, 1, handle); } }
VOID MapClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif struct ArgList args[] = { { "NAME", &Name, ARG_URL, NULL }, { NULL, NULL, 0, NULL } }; ScanArgs(pmsg.Locked, args); TreeClass::Parse(pmsg); }
VOID FontClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif STRPTR font = NULL; struct ArgList args[] = { { "COLOR", &FontRGB, ARG_COLOUR, NULL }, { "SIZE", &font, ARG_STRING, NULL }, { NULL, NULL, 0, NULL } }; ScanArgs(pmsg.Locked, args); LONG size = Font_None; if(font && sscanf(font, "%*[+-]%ld", &size) == 1) { switch(*font) { case '+': size = Font_H4 - ((size > 3) ? 3 : size); break; case '-': size = Font_H4 + ((size > 2) ? 2 : size); break; default: size = Font_Fixed - ((size > 6) ? 6 : size); break; } } // if(font) printf("Converted: %d (%s)\n", size, font); delete font; Font = size; TreeClass::Parse(pmsg); }
VOID PClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif struct ArgList args[] = { { "ALIGN", &Alignment, ARG_KEYWORD, AlignKeywords }, { NULL, NULL, 0, NULL } }; Alignment = (ULONG)-1; ScanArgs(pmsg.Locked, args); Alignment++; TreeClass::Parse(pmsg); }
/* * Read the next TIFF directory from a file * and convert it to the internal format. * We read directories sequentially. */ static uint32 ReadDirectory(int fd, unsigned ix, uint32 off) { register TIFFDirEntry *dp; register int n; TIFFDirEntry *dir = 0; uint16 dircount; int space; uint32 nextdiroff = 0; if (off == 0) /* no more directories */ goto done; if (lseek(fd, (off_t) off, 0) != off) { Fatal("Seek error accessing TIFF directory"); goto done; } if (read(fd, (char*) &dircount, sizeof (uint16)) != sizeof (uint16)) { ReadError("directory count"); goto done; } if (swabflag) TIFFSwabShort(&dircount); dir = (TIFFDirEntry *)_TIFFmalloc(dircount * sizeof (TIFFDirEntry)); if (dir == NULL) { Fatal("No space for TIFF directory"); goto done; } n = read(fd, (char*) dir, dircount*sizeof (*dp)); if (n != dircount*sizeof (*dp)) { n /= sizeof (*dp); Error( "Could only read %u of %u entries in directory at offset %#lx", n, dircount, (unsigned long) off); dircount = n; } if (read(fd, (char*) &nextdiroff, sizeof (uint32)) != sizeof (uint32)) nextdiroff = 0; if (swabflag) TIFFSwabLong(&nextdiroff); printf("Directory %u: offset %lu (%#lx) next %lu (%#lx)\n", ix, (unsigned long) off, (unsigned long) off, (unsigned long) nextdiroff, (unsigned long) nextdiroff); for (dp = dir, n = dircount; n > 0; n--, dp++) { if (swabflag) { TIFFSwabArrayOfShort(&dp->tdir_tag, 2); TIFFSwabArrayOfLong(&dp->tdir_count, 2); } PrintTag(stdout, dp->tdir_tag); putchar(' '); PrintType(stdout, dp->tdir_type); putchar(' '); printf("%lu<", (unsigned long) dp->tdir_count); if (dp->tdir_type >= NWIDTHS) { printf(">\n"); continue; } space = dp->tdir_count * datawidth[dp->tdir_type]; if (space <= 4) { switch (dp->tdir_type) { case TIFF_FLOAT: case TIFF_UNDEFINED: case TIFF_ASCII: { unsigned char data[4]; _TIFFmemcpy(data, &dp->tdir_offset, 4); if (swabflag) TIFFSwabLong((uint32*) data); PrintData(stdout, dp->tdir_type, dp->tdir_count, data); break; } case TIFF_BYTE: PrintByte(stdout, bytefmt, dp); break; case TIFF_SBYTE: PrintByte(stdout, sbytefmt, dp); break; case TIFF_SHORT: PrintShort(stdout, shortfmt, dp); break; case TIFF_SSHORT: PrintShort(stdout, sshortfmt, dp); break; case TIFF_LONG: PrintLong(stdout, longfmt, dp); break; case TIFF_SLONG: PrintLong(stdout, slongfmt, dp); break; } } else { unsigned char *data = (unsigned char *)_TIFFmalloc(space); if (data) { if (TIFFFetchData(fd, dp, data)) if (dp->tdir_count > maxitems) { PrintData(stdout, dp->tdir_type, maxitems, data); printf(" ..."); } else PrintData(stdout, dp->tdir_type, dp->tdir_count, data); _TIFFfree(data); } else Error("No space for data for tag %u", dp->tdir_tag); } printf(">\n"); } done: if (dir) _TIFFfree((char *)dir); return (nextdiroff); }
VOID TableClass::Parse(struct ParseMessage &pmsg) { pmsg.SetLock(); pmsg.NextEndBracket(); #ifdef OUTPUT PrintTag(pmsg.Locked); #endif APTR handle; UBYTE group = pmsg.OpenGroups[group_Tablecell]; pmsg.OpenGroups[group_Tablecell] = 0; if((handle = Backup(pmsg, 11, tag_DD, tag_DL, tag_DT, tag_LI, tag_P, tag_TD, tag_TH, tag_TR, tag_FONT, tag_CENTER, tag_B))) { struct ArgList args[] = { { "BACKGROUND", &Source, ARG_URL, NULL }, { "BGCOLOR", &BackgroundRGB, ARG_COLOUR, NULL }, { "BORDER", &BorderSize, ARG_NUMBER, NULL }, { "WIDTH", &GivenWidth, ARG_VALUE, NULL }, { "CELLSPACING", &Spacing, ARG_NUMBER, NULL }, { "CELLPADDING", &Padding, ARG_NUMBER, NULL }, { "ALIGN", &Alignment, ARG_KEYWORD, AlignKeywords }, { NULL, NULL, 0, NULL } }; Spacing = Padding = 2; Alignment = -1; ScanArgs(pmsg.Locked, args); Alignment++; UBYTE *old_opens = new (std::nothrow) UBYTE [tag_NumberOf + group_NumberOf]; if (!old_opens) return; memcpy(old_opens, pmsg.OpenCounts, tag_NumberOf + group_NumberOf); memset(old_opens, 0, tag_NumberOf + group_NumberOf); UBYTE old_align = pmsg.CellAlignment; UBYTE old_valign = pmsg.CellVAlignment; pmsg.CellAlignment = 0; pmsg.CellVAlignment = Align_Middle; BackFillClass::Parse(pmsg); pmsg.CellAlignment = old_align; pmsg.CellVAlignment = old_valign; memcpy(pmsg.OpenCounts, old_opens, tag_NumberOf + group_NumberOf); delete[] old_opens; Restore(pmsg.OpenCounts, 8, handle); struct ChildsList *prev = (struct ChildsList *)&FirstChild, *first = FirstChild; while(first) { if(first->Obj->id() != tag_TR) { if(first->Obj->id() == tag_COMMENT || first->Obj->id() == tag_Text) { prev->Next = first->Next; delete first->Obj; delete first; first = prev->Next; } else { class TRClass *tr = new (std::nothrow) class TRClass(); if (!tr) return; tr->setId(tag_TR); tr->setFlags(tr->flags() | FLG_ArgumentsRead); tr->AddChild(first->Obj); tr->Verify(); first->Obj = tr; prev = first; first = first->Next; while(first && first->Obj->group() == group_Tablecell) { tr->AddChild(first->Obj); prev->Next = first->Next; delete first; first = prev->Next; } } } else { prev = first; first = first->Next; } } RealFirstChild = FirstChild; } pmsg.OpenGroups[group_Tablecell] = group; }