Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

out.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      out.h
00004  *
00005  *      Copyright (C) 1999-2002 Sebastian Biallas (sb@web-productions.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef OUT_H
00022 #define OUT_H
00023 
00024 #include "analy.h"
00025 #include "common.h"
00026 #include "global.h"
00027 #include "htdata.h"
00028 
00029 class OutLine: public Object {
00030 public:
00031         int             textlen;
00032         byte            *text;
00033         int             bytes;                    // bytes of line in file
00034                         OutLine(byte *Text, int Textlen, int Bytes);
00035                         ~OutLine();
00036 };
00037 
00038 
00039 class OutAddr: public Object {
00040 public:
00041         Address *addr;
00042         UINT            time;
00043         ht_clist  *lines;
00044         int             size;                     // size in memory
00045         int             bytes;                    // bytes of address in file
00046         
00047                         OutAddr(Address *Addr, UINT Time);
00048                         ~OutAddr();
00049         void      appendLine(OutLine *l);
00050         void            clear();
00051         OutLine  *getLine(int i);
00052         void            updateTime(UINT Time);
00053 };
00054 
00055 /*
00056  *      max. length of a generated line is 1024
00057  */
00058 #define WORKBUF_LEN 1024
00059 
00060 #define ELEMENT_TYPE_PRE_COMMENT 0
00061 #define ELEMENT_TYPE_COMMENT 1
00062 #define ELEMENT_TYPE_POST_COMMENT 2
00063 #define ELEMENT_TYPE_LABEL 3
00064 #define ELEMENT_TYPE_DATA_CODE 4
00065 #define ELEMENT_TYPE_HIGHLIGHT_DATA_CODE 5
00066 #define ELEMENT_TYPE_INDENT_XREF 6
00067 
00068 #define EXTERNAL_LINK_SHOW_XREFS 0
00069 #define EXTERNAL_LINK_SHOW_COMMENTS 1
00070 
00071 #define OUTPUT_GENERATE_ERR_OK 0
00072 #define OUTPUT_GENERATE_ERR_INVAL 1
00073 #define OUTPUT_GENERATE_ERR_ANALYSER_NOT_FINISHED 2
00074 #define OUTPUT_GENERATE_ERR_STREAM 3
00075 
00076 /*
00077  *
00078  */
00079 class AnalyserOutput: public Object {
00080 public:
00081         Analyser        *analy;
00082         Address   *addr;
00083         int             line;
00084         Location  *cur_addr;
00085         OutAddr *cur_out_addr;
00086         int             bytes_line;               // bytes of current line in file
00087         int             bytes_addr;               // bytes of current addr in file
00088                 
00089         ht_dtree        *out_addrs;
00090 
00091         byte            *work_buffer_start;
00092         byte            *work_buffer;
00093 
00094         byte            *temp_buffer;
00095                 
00096         UINT            current_time;
00097         int             size;
00098                 
00099         int             dis_style;
00100                 
00101                         void                    init(Analyser *analy);
00102         virtual void                    done();
00103         virtual void                    beginAddr();
00104         virtual void                    beginLine();
00105         virtual void                    changeConfig();
00106         virtual int                     elementLength(const char *s);
00107         virtual void                    endAddr();
00108         virtual void                    endLine();
00109         virtual char *          externalLink(char *s, int type1, int type2, int type3, int type4, void *special);
00110         virtual void                    footer();
00111                         void                    generateAddr(Address *Addr, OutAddr *oa);
00112                         int                     generateFile(Address *from, Address *to);
00113         virtual ht_stream *     getGenerateStream();
00114                         void                    generatePage(Address *from, int lines);
00115                         OutAddr *               getAddr(Address *Addr);
00116                         OutLine *               getLine(Address *Addr, int line);
00117                         bool                    getLineString(char *buf, int maxlen, Address *Addr, int line);
00118                         bool                    getLineByteLength(int &len, Address *Addr, int line);
00119                         int                     getLineCount(Address *Addr);
00120                         int                     getAddrByteLength(Address *Addr);
00121         virtual void                    header();
00122                         void                    invalidateCache();
00123         virtual char *          link(char *s, Address *Addr);
00124                         int                     nextLine(Address *&Addr, int &line, int n, Address *max);
00125                         int                     prevLine(Address *&Addr, int &line, int n, Address *min);
00126         virtual void                    putElement(int element_type, const char *element);
00127                         void                    reset();
00128                         void                    write(const char *s);
00129                         void                    write(const char *s, int n);
00130 };
00131 
00132 #endif

Generated on Fri May 7 21:15:41 2004 by doxygen 1.3.5