"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/readhelp.cpp" between
bed-3.0.0.src.tar.xz and bed-3.0.1.src.tar.xz

About: bed is an adjustable data format binary editor.

readhelp.cpp  (bed-3.0.0.src.tar.xz):readhelp.cpp  (bed-3.0.1.src.tar.xz)
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#define __GNU_VISIBLE 1 //#define __GNU_VISIBLE 1
#define _GNU_SOURCE 1
#include <string.h> #include <string.h>
char start='#'; char start='#';
#define prodef(x) #x, #define prodef(x) #x,
#define prodefname(name,pr) #name, #define prodefname(name,pr) #name,
#include "getlabel.h" #include "getlabel.h"
const char *procnames[]={ const char *procnames[]={
#include "procedures.h" #include "procedures.h"
}; };
#undef prodef #undef prodef
skipping to change at line 48 skipping to change at line 49
return -1; return -1;
} }
} while(buf[0]!=start); } while(buf[0]!=start);
names=fopen("helptext.h","w"); names=fopen("helptext.h","w");
indexs=fopen("helpindex.h","w"); indexs=fopen("helpindex.h","w");
help=fopen("helpdata.h","w"); help=fopen("helpdata.h","w");
do { do {
char *name=buf+1; char *name=buf+1;
int ind[100],nr=0; int ind[100],nr=0;
int startpos,i,iline,procedure; int startpos,i,iline,procedure;
#ifdef HAVE_STRCHRNUL
*strchrnul(name,'\n')='\0'; /*Ok fgets instead of gets*/ *strchrnul(name,'\n')='\0'; /*Ok fgets instead of gets*/
#else
{
;
if(char *ptr=strchr(name,'\n'))
*ptr='\0'; /*Ok fgets instead of gets*/
}
#endif
procedure=getlabel(procnames,procnamesnr,name); procedure=getlabel(procnames,procnamesnr,name);
if(procedure>=0) { if(procedure>=0) {
if(procproc[procedure]) if(procproc[procedure])
fprintf(help,"{helpprocname(%s,%s),",name,procpro c[procedure]); fprintf(help,"{helpprocname(%s,%s),",name,procpro c[procedure]);
else else
fprintf(help,"{helpname(%s),",name); fprintf(help,"{helpname(%s),",name);
fprintf(names,"char %sname[]=\"",name); fprintf(names,"char %sname[]=\"",name);
fprintf(indexs,"short %sind[]={",name); fprintf(indexs,"short %sind[]={",name);
} }
skipping to change at line 97 skipping to change at line 107
getret=getliner(buf); getret=getliner(buf);
} while(getret&&buf[0]!=start); } while(getret&&buf[0]!=start);
if(procedure>=0) { if(procedure>=0) {
fprintf(help,"%d},\n",nr); fprintf(help,"%d},\n",nr);
fprintf(names,"\";\n"); fprintf(names,"\";\n");
for(i=0;i<(nr-1);i++) { for(i=0;i<(nr-1);i++) {
fprintf(indexs,"%d,",ind[i]); fprintf(indexs,"%d,",ind[i]);
} }
fprintf(indexs,"};\n"); fprintf(indexs,"};\n");
} }
} while(getret>0); } while(getret);
fclose(names); fclose(names);
fclose(help); fclose(help);
fclose(indexs); fclose(indexs);
return 0; return 0;
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 12 lines changed or added

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