"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/examples/backward.cc" between
bed-3.0.3.src.tar.xz and bed-3.1.0.src.tar.xz

About: bed is an adjustable data format binary editor.

backward.cc  (bed-3.0.3.src.tar.xz):backward.cc  (bed-3.1.0.src.tar.xz)
skipping to change at line 34 skipping to change at line 34
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "../filter.h" #include "../filter.h"
#include "../screenpart.h" #include "../screenpart.h"
#include "../dialog.h" #include "../dialog.h"
#include "../screen.h" #include "../screen.h"
extern char *filtername(Backward) ; extern char *filtername(Backward) ;
class Backward: public Filter { class Backward: public Filter {
Filter *subfil; Filter *subfil;
char *convstring; mutable char *convstring;
public: public:
Backward(Filter *fil) : Filter(fil->bytesscreen,fil->bytesfile) { Backward(Filter *fil) : Filter(fil->bytesscreen,fil->bytesfile) {
subfil=fil; subfil=fil;
setlabel(); setlabel();
} }
Backward(int fb,int sb,const char *conv,ScreenPart *p) : Filter(fb,sb,fil tername(Backward)) { Backward(int fb,int sb,const char *conv,ScreenPart *p) : Filter(fb,sb,fil tername(Backward)) {
const char *end=strchr(conv, ':'); const char *end=strchr(conv, ':');
if(!end) { if(!end) {
err=1; err=1;
skipping to change at line 77 skipping to change at line 77
strcpy(label,"Backward("); strcpy(label,"Backward(");
memcpy(label+9,subfil->label,len); memcpy(label+9,subfil->label,len);
label[len+9]=')'; label[len+9]=')';
label[len+10]='\0'; label[len+10]='\0';
} }
virtual int setpart(ScreenPart *p) override { virtual int setpart(ScreenPart *p) override {
part=p; part=p;
return subfil->setpart(p); return subfil->setpart(p);
} }
virtual char *convstr(void) override { virtual char *convstr(void) const override {
char *conv=subfil->convstr(); char *conv=subfil->convstr();
int lenconv=strlen(conv); int lenconv=strlen(conv);
int lenname=strlen(subfil->name);; int lenname=strlen(subfil->name);;
if(convstring) if(convstring)
delete[] convstring; delete[] convstring;
convstring=new char[lenconv+lenname+2]; convstring=new char[lenconv+lenname+2];
memcpy(convstring,subfil->name,lenname); memcpy(convstring,subfil->name,lenname);
convstring[lenname]=':'; convstring[lenname]=':';
memcpy(convstring+lenname+1,conv,lenconv+1); memcpy(convstring+lenname+1,conv,lenconv+1);
return convstring; return convstring;
skipping to change at line 116 skipping to change at line 116
bytesfile=subfil->bytesscreen; bytesfile=subfil->bytesscreen;
return bytesfile; return bytesfile;
} }
virtual int fromfile(const unsigned char * const input,unsigned char *con st output) const override { virtual int fromfile(const unsigned char * const input,unsigned char *con st output) const override {
return subfil->tofile(input,output); return subfil->tofile(input,output);
} }
virtual int tofile(const unsigned char * const input,unsigned char * cons t output) override { virtual int tofile(const unsigned char * const input,unsigned char * cons t output) override {
return subfil->fromfile(input,output); return subfil->fromfile(input,output);
} }
virtual int equal(Filter *fil) override { virtual int equal(const Filter *fil) const override {
if(!Filter::equal(fil)) if(!Filter::equal(fil))
return 0; return 0;
Backward *sk=(Backward *) fil; Backward *sk=(Backward *) fil;
if(!subfil->equal(sk->subfil)) if(!subfil->equal(sk->subfil))
return 0; return 0;
return 1; return 1;
} }
virtual int screen2filepos(int pos) override { virtual int screen2filepos(int pos) override {
return subfil->file2screenpos(pos); return subfil->file2screenpos(pos);
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)