#include #include #include #include #include #include /*#include*/ #include /*==========================================================================;*/ /* MT:MultiFunction Tools.ver1.029 CopyRight MIYAMA.1999. VYE00525@nifty.ne.jp. http://home.interlink.or.jp/~kimijima/ http://www.vector.co.jp/vpack/browse/person/an010017.html(JPN page.)/ ;*/ /* 1)New Include files. 2-1):HANDS.out put txt files and else function. 2-2):EARES.input files to as header-Texts. 3)each functions list. 4)Main functions sequence. 5)functions pre declear. 6)Main ruitine (cmd promoter.) 7)Main(){} 8)end ============================================================================;*/ /*1)New Include files.;*/ //#include #include #include extern char globalchbuf[520],globalkeyword[258]; #include extern void readmegn(void);//existence on readmegn.c. /*6)Each CMD SEquences.*/ /* 01 mkodhead() to make header file odrformp.h to make order_form txt to operate. 02 pwinuj() to use odrform0/1.txt as ordr_form txt for 95/nt opration. ----------- 03 mkrmc() to make readmegn.c to make readme_txt as bilingal. 04 spreaduj() to create readme_txt 'readmeus/jp.txt/htm'. 05 spreaduj_html() to create readme_htm 'readmeus/jp.htm'. ---------- 06 mkorimd() to make original readmegn.txt/htm & odrformp.txt/htm. */ /*===== 01 MKODHEAD.TXT :Make odrformp.h.==================================;*/ void mkodhead(int fargc,char fargv1[258]) { if(fargc!=2) { printf("Usage: mt /moh filename.txt .\n"); exit(1); } FILE *read_fp; FILE *writefp; int i; char buf[258]; if((read_fp=fopen(fargv1,"r"))!=NULL) { writefp=fopen("odrformp.h","w"); /*===================================================;*/ fprintf(writefp,"void odrformp(void){\n"); fprintf(writefp,"FILE *writefp;\n"); fprintf(writefp,"writefp=fopen(\"odrformp.txt\",\"w\");\n"); while((fgets(buf,256,read_fp))!=NULL) { for (i=0;buf[i]!='\0';i++) { if (buf[i]=='\n'){buf[i]='\0';} } fprintf(writefp,"fprintf(writefp,\"%s\\n\");\n",buf); } fprintf(writefp,"fclose(writefp);\n"); fprintf(writefp,"}\n"); } else {printf("No exist %s.\n",fargv1);exit(1); } } /*=====02 PWINUJ.TXT :Make user operate table.=============================;*/ void pwinuj(int fargc,char fargv1[258]) { FILE *read_fp; FILE *writefp; int i,j; char jpus; char buf[258]; if(2\n"); fprintf(writefp,"void readmegn(void){\n"); fprintf(writefp,"FILE *writefp;\n"); fprintf(writefp,"writefp=fopen(\"readmegn.txt\",\"w\");\n"); while((fgets(buf,256,read_fp))!=NULL) { for (i=0;buf[i]!='\0';i++) { if (buf[i]=='\n'){buf[i]='\0';} } fprintf(writefp,"fprintf(writefp,\"%s\\n\");\n",buf); } fprintf(writefp,"fclose(writefp);\n"); fprintf(writefp,"}\n"); } else { printf("No exist %s.\n",fargv1);exit(1); } } /*===== 04 SPREADUJ.TXT :Make readmejp/us.txt =============================;*/ void spreaduj(void) { /*No need ARGC Check.;*/ FILE *read_fp; FILE *writefp; FILE *jpnreadme_fp; FILE *engreadme_fp; int i,j; char buf[258]; /*if (fargc!=1){printf("Input error.No need with Option.\n");exit(1);}*/ readmegn();/*make "readmegn.txt". gn=general.;*/ if((read_fp=fopen("readmegn.txt","r"))!=NULL) { writefp=fopen("outprmtx.txt","w"); jpnreadme_fp=fopen("readmejp.txt","w"); engreadme_fp=fopen("readmeus.txt","w"); while((fgets(buf,256,read_fp))!=NULL) { if ((buf[0]=='/')&&(buf[1]=='/')) { for(i=0+2;buf[i]!='\0';i++) { buf[i-2]=buf[i]; } buf[i-2]='\0'; if((discover1st(buf,"Hyper_Readme
\n");
	fprintf(engreadme_fp,"Hyper_Readme
\n");

	while((fgets(buf,256,read_fp))!=NULL)
		{
		if ((buf[0]=='/')&&(buf[1]=='/'))
			{
			for(i=0+2;buf[i]!='\0';i++)
				{
				buf[i-2]=buf[i];
				}
			buf[i-2]='\0';
			for (i=0;buf[i]!='\0';i++)
				{
				if (buf[i]=='\n')
					{
					buf[i]='\0';
					}
				}
			fprintf(engreadme_fp,"%s\n",buf);

			}
		else
			{
			for (i=0;buf[i]!='\0';i++)
				{
				if (buf[i]=='\n')
					{
					buf[i]='\0';
					}
				}
			fprintf(jpnreadme_fp,"%s\n",buf);
			}
		}

	fprintf(jpnreadme_fp,"
\n"); fprintf(engreadme_fp,"
\n"); fclose(read_fp); fclose(engreadme_fp); fclose(jpnreadme_fp); //fclose(writefp); remove("readmegn.txt"); remove("outprmtx.htm"); } else { printf("No exist Readmegn.htm.\n"); exit(1); } } /*=====06 ORIRMOD.TXT :Make Original Readme&Odrformp.txt with JP/US edition.;*/ void orirmod(void) { /*No need ARGC Check.;*/ readmegn(); //on readmegn.c odrformp(); //on odrformp.h } /*=========================================================================;*/ /* System CMD Function.;*/ /*=========================================================================;*/ /*===== 1 NEWTXTJP.TXT :Making YYMMDaa.txt(apeend mode).===================;*/ void newtxtjp(void) { /*No need ARGC check.;*/ FILE *days; char getdays[258],filename[258]; long nowtime; time(&nowtime); /*printf("%s",ctime(&nowtime));*/ strcpy(getdays,ctime(&nowtime)); /*printf(getdays); exit(1);*/ filename[0]=getdays[22]; filename[1]=getdays[23]; /*==JPN edition:April to March.=====;*/ if ((getdays[4]=='A')&&(getdays[5]=='p')){filename[2]='0';filename[3]='4';} if ((getdays[4]=='M')&&(getdays[6]=='y')){filename[2]='0';filename[3]='5';} if ((getdays[5]=='u')&&(getdays[6]=='n')){filename[2]='0';filename[3]='6';} if ((getdays[5]=='u')&&(getdays[6]=='l')){filename[2]='0';filename[3]='7';} if ((getdays[4]=='A')&&(getdays[5]=='u')){filename[2]='0';filename[3]='8';} if ((getdays[4]=='S')&&(getdays[5]=='e')){filename[2]='0';filename[3]='9';} if ((getdays[4]=='O')&&(getdays[5]=='c')){filename[2]='1';filename[3]='0';} if ((getdays[4]=='N')&&(getdays[5]=='o')){filename[2]='1';filename[3]='1';} if ((getdays[4]=='D')&&(getdays[5]=='e')){filename[2]='1';filename[3]='2';} if ((getdays[4]=='J')&&(getdays[5]=='a')){filename[2]='0';filename[3]='1';} if ((getdays[4]=='F')&&(getdays[5]=='e')){filename[2]='0';filename[3]='2';} if ((getdays[4]=='M')&&(getdays[6]=='r')){filename[2]='0';filename[3]='3';} filename[4]=getdays[8]; filename[5]=getdays[9]; filename[6]='a'; filename[7]='a'; filename[8]='.'; filename[9]='T'; filename[10]='X'; filename[11]='T'; filename[12]='\0'; /*sprintf(filename,"aa.TXT");*/ printf("%s",filename); days=fopen(filename,"a"); fprintf(days,"============================= HEADER. %s\n",getdays); fclose(days); } /*===== 2 TIME.TXT :APPEND TIME Stump as FOOTER.===========================;*/ void time(int fargc, char fargv1[258],char fargv2[258]) { FILE *timestump_fp; char getdays[258]; long nowtime; time(&nowtime); /*printf("%s",ctime(&nowtime));*/ strcpy(getdays,ctime(&nowtime)); if ((fargc<2)||(3 txtasm.tmp");/*Get TXT file List;*/ if((guidefp=fopen("txtasm.tmp","r"))==NULL) { printf("Error No Exist TXTASM.TMP as Temp-File for Operation.\n"); exit(1); };/*Open TXT file list;*/ writefp=fopen("sumtxt.txt","w");/*TXT assemble file open as append Mode;*/ while((fgets(guide,256,guidefp))!=NULL)/*Read TXT filelist to EOF;*/ { if(guide[9]=='T'){ if(guide[10]=='X'){ if(guide[11]=='T') { /*only "TXT" included line active.;*/ for (i=0;i<=11;i++) { filename[i]=guide[i]; if(guide[i]==' ')break; } filename[i]='.'; filename[i+1]='\0';/*To get trunk of filename.;*/ strcat(filename,"TXT"); read_fp=fopen(filename,"r");/*Open TXT by filename got.;*/ fprintf(writefp,"=====%s===========\n",filename); /*Type filename to SUM-TXT.;*/ while((fgets(buf,256,read_fp))!=NULL) { fputs(buf,writefp); } /*Copy filename-TXT to SUM-TXT as apend.;*/ fclose(read_fp);/*Bacuumed End farom filename-TXT.;*/ printf("%s Combined to Sumtxt.txt.\n",filename); }}}/*End of "TXT" hitted line case.;*/ } fclose(guidefp); fclose(writefp); remove("txtasm.tmp"); } /*===== 4 APPEND.TXT :Append file 2 to file1 with filename-tag.============;*/ void append(int fargc,char fargv1[258],char fargv2[258]) { if(fargc!=3) { printf("Usage: mt /apd headfile.txt backfile.txt .\n"); exit(1); } char buf[258]; FILE *read_fp; FILE *appendfp; if((read_fp=fopen(fargv1,"r"))==NULL) { printf("No exists %s.\nOpened as New file.\n",fargv1); fclose(read_fp); } if((read_fp=fopen(fargv2,"r"))!=NULL) { appendfp=fopen(fargv1,"a"); fprintf(appendfp,"== %s =====\n",fargv2); while(fgets(buf,256,read_fp)) { fputs(buf,appendfp); } fclose(appendfp); printf("Process succeeded.\n"); } else { printf("No exists %s. Cannot Copy to Append.\n",fargv2); } fclose(read_fp); } /*===== 5 BAK2TXT.TXT :Repair *.bat to output.txt.=========================;*/ void bak2txt(int fargc,char fargv1[258]) { if (fargc!=2) { printf("Usage: mt /b2t filename.bak .\n"); exit(1); } FILE *read_fp; FILE *writefp; if((read_fp=fopen(fargv1,"r"))!=NULL) { fclose(read_fp); writefp=fopen("output.txt","w"); fclose(writefp); remove("output.txt"); printf("%s changed to output.txt.\n",fargv1); rename(fargv1,"output.txt"); printf("Process succeeded.\n"); } else { printf("No exists %s.\n",fargv1); fclose(read_fp);} } /*===== 6 ADDCONT.TXT :addcont Add Contents to files.=====================;*/ /*ThisProgram have 3 step;*/ /*1)inputted original filename check;*/ /*2)Take contents.txt or new created and write.;*/ /*3)Read Original-txt read and write to work-file(temp.txt) with checking exist of Original-file-txt.;*/ /*4)File rename process for original-bak files.;*/ void addcont(int fargc,char fargv1[258]) { /* Miss input Check;*/ if (fargc!=2) { printf("Usage: mt /adc filename.txt .\n"); exit(1); } FILE *read_fp; FILE *writefp; char read_filename[258],buf[258]; strcpy(read_filename,fargv1); int i,j; /* *fargv1's \n code remove. ;*/ for(i=0;read_filename[i]!='\0';i++) { if(read_filename[i]=='\n') { read_filename[i]='\0'; } } writefp=fopen("addcont.txt","w");/* Open "temp.tmp" as OutputWrite.*/ if((read_fp=fopen("contents.txt","r"))==NULL)/*New make "contents.txt";*/ { fprintf(writefp,"~~Contents~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); /* Content zone Add to File Head;*/ for (j=0;j!=5-1;j++) { /* 5-lined \n;*/ fprintf(writefp,"\n"); } fprintf(writefp,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); /* '~' char-s for Contents Remover.;*/ fclose(read_fp); } else /*Take Old "contents.txt" and add to temp.txt;*/ { while(fgets(buf,256,read_fp)!=NULL) { fputs(buf,writefp); } fclose(read_fp); } /*Both cases, Togather same next process.==============================;*/ if((read_fp=fopen(read_filename,"r"))!=NULL) /*When Orignal-txt entirely exist.;*/ { /* copy original-txt to temp.txt.;*/ while((fgets(buf,256,read_fp))!=NULL) { fputs(buf,writefp); } fclose(read_fp); fclose(writefp);/*Two file Close.;*/ printf("ADD Contents Process Succeeded.\n"); filebackup(read_filename,"addcont.txt");/*Original-file Rename;*/ } else { printf("%s Text-File No exist.",read_filename); /*When Original-TXT Noexist;*/ remove("addcont.txt"); } /*process.end;*/ } /*===== 7 SEPCONT.TXT :Separation Contents from files.=====================;*/ void sepcont(int fargc,char fargv1[258]) { if (fargc!=2) { printf("Usage: mt /spc filename.txt .\n"); exit(1); } FILE *read_fp; FILE *writefp; char read_filename[258]; strcpy(read_filename,fargv1); int i; for(i=0;read_filename[i]=='\0';i++) /*\n code remove;*/ { if(read_filename[i]=='\n') { read_filename[i]='\0'; } } if((read_fp=fopen(read_filename,"r"))!=NULL)/*When file really exists.;*/ { char buf[258]; int flagwfp; flagwfp=0; fgets(buf,256,read_fp); /*1st line check Contents be or not;*/ if((buf[0]=='~')&&(buf[1]=='~')) { writefp=fopen("contents.txt","w"); flagwfp=1; fputs(buf,writefp); } else /*When Contents is nothing.;*/ { printf("This Text-file has No Contents.\n"); printf("Or 1st line's left side is not Correct.\n"); exit(1); } while((fgets(buf,256,read_fp))!=NULL)/*again roal of reading.*/ { fputs(buf,writefp); if((flagwfp==1)&&(buf[0]=='~')) /*Discover contents's end, Change Write file. for main-trunk.;*/ { flagwfp=-1; fclose(writefp); writefp=fopen("sepcont.txt","w"); } } fclose(writefp); /*Two file pointer ,close.;*/ fclose(read_fp); filebackup(read_filename,"sepcont.txt");/*Filename,backup.;*/ remove("sepcont.txt"); /*==Making Call editor batch.======================================;*/ writefp=fopen("contcall.bat","w"); char cmdstr[258]; fprintf(writefp,"start contents.txt\n"); strcpy(cmdstr,"start "); strcat(cmdstr,read_filename); fprintf(writefp,"%s\n",cmdstr); /*printf(cmdstr);*/ fclose(writefp); /*system("contcall");comentize beacuse of Made system error.*/ /*Please click "CONTCALL.BAT" Icon on UserSide.*/ } else { printf("Cannot file open.\n"); fclose(read_fp); } } /*===== 8 SEGMENT.TXT :Add line and Page Number to files.==================;*/ void segment(int fargc,char fargv1[258],char fargv2[258],char fargv3[258]) { long line_counter;int fix_line_number; /*line_counter is total line number without paged vacant.;*/ /*fix_line_number parameter inputted each-line number per pages.*/ int line_counter_page,page_counter; /*line counter on current pages.;*/ /*Page counter just page counter.*/ int i; char buf[258],keyword[258]; /*buf is read-line buffer.;*/ if ((fargc<3)||(4 newbufa\n + newbufb\n it is by refossil2-func. ^including 'keyword' repaired. well, bufa<=newbufa, bufb<=newbufb, and pass 'bufa' to many understream branch, after it, bufa < bufb renewal. Most first,bufa=='== Mather filename =====\n' Most EOF, bufa alone executed with out new bufb.; ===================================================;*/ bufbflag=0; again:; line_counter++; /*if read_bufb reach EOF, it skip trunk doing and pass old bufa to off springs branch.;*/ if((fgets(bufb,256,read_fp))==NULL) { /*printf("a");*/ printf("Throw Final- line into Process.\n"); bufbflag=-1; goto whenfileend; } //---------------------------------------------------------------------------- else { //printf("%ldth line readed.\n",line_counter+long 1); if(discover1st(bufb,"\n")==-1){strcpy(bufb,"\n");} /*globalchbuf,buffer to check.*/ strcpy(globalchbuf,bufa); strcat(globalchbuf,bufb); /*globalchbuf, it is include inner '\n';*/ /*call repair-function for keyword;*/ strcpy(globalkeyword,keyword); refossil2(); //real execute create globalchbuf for new bufa/b from globalchbuf. /*initialize buffer contents for new buffers.;*/ bufa[0]='\0'; bufb[0]='\0'; /*write before paragraph of (new)globalchbuf to bufa,;*/ for (i=0;globalchbuf[i]!='\0';i++) { /*printf("%c",globalchbuf[i]);*/ bufa[i]=globalchbuf[i]; if(globalchbuf[i]=='\n') { bufa[i+1]='\0'; goto nextisbufb; } } fprintf(writefp, "== %s Nothing Newline code in Buffering A of MT process.==\n",filename); fprintf(writefp, "== Now plus new_NewLine code and new bufa 254 char.s forcely. ==\n"); bufa[255]='\0'; strcat(bufa,"\n"); /*exit(1);*/ nextisbufb:; /*write back paragraph of (new) globalchbuf to bufb.;*/ m=i+1; for(j=m;globalchbuf[j]!='\0';j++) { bufb[j-m]=globalchbuf[j]; if(globalchbuf[j]=='\n') { bufb[j-m+1]='\0'; goto nextisescape; } } fprintf(writefp, "== %s Nothing Newline code in Buffering B of MT process.==\n" ,filename); fprintf(writefp, "== Now plus new_NewLine code and new bufb is 254 char.s forcely.==\n"); //goto whenerrorescape; for(i=254+1;bufb[i]!='\0';i++) { bufb[i-(254+1)]=bufb[i]; } i=i-1; bufb[i]='\0'; strcat(bufb,"\n"); /*exit(1);*/ nextisescape:; /*printf("bufa:%sbufb:%s\n",bufa,bufb);*/ } /*read_mather file show EOF, then jump to this, be alone bufa only,,with out bufb contents,*/ whenfileend:; //----------------------------------------------------------------------------- /*printf("b");*/ /*All brach functiones do to execute to bufa, as a New read file line.;*/ /*4)pass job to each functiones with write_filepointer.*/ /* cmd_realfunc._list; ref :natural write. ez :fclose just before keyword,just after keyword newfile for writting open.. pickup :with number_line bufa original.(without newline just_before keyword.) trans :only change keyword to keyword2. insert :just keyword after,file2 open and into all. ;*/ /*ref*/ if(strcmpi(opt,"/ref")==0) {*writefp=*refossil(writefp,bufa,line_counter,keyword,file2orkey2);} /*ez*/ /*if(strcmpi(opt,"/ez")==0) {*writefp= *enzyme(writefp,bufa,line_counter,keyword,file2orkey2);}*/ /*pik*/ if(strcmpi(opt,"/pik")==0) {*writefp= *pickup(writefp,bufa,line_counter,keyword,file2orkey2);} /*trs*/ if(strcmpi(opt,"/tr")==0) {*writefp= *trans(writefp,bufa,line_counter,keyword,file2orkey2);} /*tlup*/if(strcmpi(opt,"/tlup")==0) {*writefp=*translup(writefp,bufa,line_counter,keyword,file2orkey2);} /*ins*/ if(strcmpi(opt,"/ins")==0) {*writefp= *insert(writefp,bufa,line_counter,keyword,file2orkey2);} /*eachcmd's end;*/ /*5)Again ROOP.;*/ if(bufbflag==-1) { goto escape; }/*if EOF, then into end process.*/ else { strcpy(bufa,bufb);/*line generation layers update.;*/ goto again; }/*again read read_fp.;*/ escape:; fclose(read_fp); fclose(writefp); /*printf("g");*/ } /*== end; =================================================================;*/ /*===== 99-1 REFOSSIL.TXT :Repair CRLFed keyword.==========================;*/ FILE *refossil(FILE *writefp,char bufa[258],long line_counter,char keyword[258],char file2orkey2[258]) { /*Declear Parameters.;*/ int i,j,m,n,d1st; /*printf("b");*/ /*All brach functiones do to execute to bufa, as a New read file line.;*/ d1st=discover1st(bufa,keyword); /*printf("c");*/ /*if keyword not included on bufa, simple it write bufa to file_pointer.;*/ /*but only pickup cmd, it not execute those process.;*/ if(d1st==-1) { fputs(bufa,writefp); printf("fputs event occured.\n"); } /*if discover keyword,then separated stream by each option cmd demannd.;*/ else { printf("%s discovered in %ldth line.\n",keyword,line_counter); /*write bufa contents just before keyword palce.;*/ if(0 newbufa\n + newbufb\n it is by refossil2-func. ^including 'keyword' repaired. well, bufa<=newbufa, bufb<=newbufb, and pass 'bufa' to many understream branch, after it, bufa < bufb renewal. Most first,bufa=='== Mather filename =====\n' Most EOF, bufa alone executed with out new bufb.; ===================================================;*/ bufbflag=0; again:; line_counter++; /*if read_bufb reach EOF, it skip trunk doing and pass old bufa to off springs branch.;*/ if((fgets(bufb,256,read_fp))==NULL) { /*printf("a");*/ printf("Throw Final- line into Process.\n"); bufbflag=-1; goto whenfileend; } //---------------------------------------------------------------------------- else { //printf("%ldth line readed.\n",line_counter+long 1); if(discover1st(bufb,"\n")==-1){strcpy(bufb,"\n");} /*globalchbuf,buffer to check.*/ strcpy(globalchbuf,bufa); strcat(globalchbuf,bufb); /*globalchbuf, it is include inner '\n';*/ /*call repair-function for keyword;*/ strcpy(globalkeyword,keyword); refossil2(); //real execute create globalchbuf for new bufa/b from globalchbuf. /*initialize buffer contents for new buffers.;*/ bufa[0]='\0'; bufb[0]='\0'; /*write before paragraph of (new)globalchbuf to bufa,;*/ for (i=0;globalchbuf[i]!='\0';i++) { /*printf("%c",globalchbuf[i]);*/ bufa[i]=globalchbuf[i]; if(globalchbuf[i]=='\n') { bufa[i+1]='\0'; goto nextisbufb; } } fprintf(writefp, "== %s Nothing Newline code in Buffering A of MT process.==\n",filename); fprintf(writefp, "== Now plus new_NewLine code and new bufa 254 char.s forcely. ==\n"); bufa[255]='\0'; strcat(bufa,"\n"); /*exit(1);*/ nextisbufb:; /*write back paragraph of (new) globalchbuf to bufb.;*/ m=i+1; for(j=m;globalchbuf[j]!='\0';j++) { bufb[j-m]=globalchbuf[j]; if(globalchbuf[j]=='\n') { bufb[j-m+1]='\0'; goto nextisescape; } } fprintf(writefp, "== %s Nothing Newline code in Buffering B of MT process.==\n" ,filename); fprintf(writefp, "== Now plus new_NewLine code and new bufb is 254 char.s forcely.==\n"); //goto whenerrorescape; for(i=254+1;bufb[i]!='\0';i++) { bufb[i-(254+1)]=bufb[i]; } i=i-1; bufb[i]='\0'; strcat(bufb,"\n"); /*exit(1);*/ nextisescape:; /*printf("bufa:%sbufb:%s\n",bufa,bufb);*/ } /*read_mather file show EOF, then jump to this, be alone bufa only,,with out bufb contents,*/ whenfileend:; //---------------------------------------------------------------------------- /*printf("b");*/ /*All brach functiones do to execute to bufa, as a New read file line.;*/ /*pik;*/ /*=====each cmd.======*/ d1st=discover1st(bufa,keyword); /*printf("c");*/ /*if keyword not included on bufa, simple it write bufa to file_pointer.;*/ /*but only pickup cmd, it not execute those process.;*/ if(d1st==-1) { fputs(bufa,writefp); printf("fputs event occured.\n"); } /*if discover keyword,then separated stream by each option cmd demannd.;*/ else { printf("%s discovered in %ldth line.\n",keyword,line_counter); /*when choose pik cmd, it type line_counter to file_pointer;*/ /*write bufa contents just before keyword palce.;*/ if(0 small.Ex txt > TXT.--------- void addbackslashpathhead(void);//From Command Line \ less str to with top \. void current(void);//Get current str. Ex. \DOS. Useing char grp.current[258].------ // /*Use Static Prameters as Structure. avoid Pointer Error.------------------;*/ struct baggage { int fargc;char opt[8]; char extention[4];char pathname[258];char filename[258]; char keyword[258]; char *char_linesmargin;int lines_margin; int path_counter;int file_counter; char current[258]; }; static struct baggage grp; /*get path str and filename str.-------------------------------------------;*/ void path(void); void file(void); /*get path & file NAME read to pass path() and file()----------------------;*/ void getpathname(void); void getfilename(void); //void _daughter(void); each daughter process.----------------------------;*/ void list_daughter(void); void makehtml1(void);//Special Upper process. makehtml1>m.html2>getpath/file> void makehtml2(void);// > html_daughter. ; void html_daughter(void); void tasm_daughter(void); void key_daughter(void); void csv_daughter(void); /*-- Logical Expression.------------------------------------------------------ *backtag get* 's subfunction |-char current void trimextention(void) |-char trimextention void current(void) getpathname------------<-------+ /kdrv(Example.) give Extention. |:loop | getfilename------------<-------| /kdir give Pathnaame. loop:+------------->-+ | & Extention. | | Veach functions' subf. | | | | | +---<<---------+ eachfunctions:daughter<--+ <--+ /key | give Filename. <-Filename. | ^one kind family set | | main()(:all functions promoter.) Can use only 'getfilename' from those current directry. Cannot escape hit bad file. When exe process stopped, Prepare many method for users. */ /*==Each CMD Sequences.====================================================;*/ /*--Triming Extention.-----------------------------------------------------;*/ void trimextention(void) { int i; grp.extention[3]='\0'; if(grp.extention[0]=='\0') { grp.extention[0]='T'; grp.extention[1]='X'; grp.extention[2]='T'; } if(grp.extention[1]=='\0') { /*grp.extention[0]='?';*/ grp.extention[1]=' '; grp.extention[2]=' '; } if(grp.extention[2]=='\0') { /*grp.extention[0]='?'; grp.extention[1]='?';*/ grp.extention[2]=' '; } for(i=0;i<=2;i++) { if(grp.extention[i]=='a'){grp.extention[i]='A';}; if(grp.extention[i]=='b'){grp.extention[i]='B';}; if(grp.extention[i]=='c'){grp.extention[i]='C';}; if(grp.extention[i]=='d'){grp.extention[i]='D';}; if(grp.extention[i]=='e'){grp.extention[i]='E';}; if(grp.extention[i]=='f'){grp.extention[i]='F';}; if(grp.extention[i]=='g'){grp.extention[i]='G';}; if(grp.extention[i]=='h'){grp.extention[i]='H';}; if(grp.extention[i]=='i'){grp.extention[i]='I';}; if(grp.extention[i]=='j'){grp.extention[i]='J';}; if(grp.extention[i]=='k'){grp.extention[i]='K';}; if(grp.extention[i]=='l'){grp.extention[i]='L';}; if(grp.extention[i]=='m'){grp.extention[i]='M';}; if(grp.extention[i]=='n'){grp.extention[i]='N';}; if(grp.extention[i]=='o'){grp.extention[i]='O';}; if(grp.extention[i]=='p'){grp.extention[i]='P';}; if(grp.extention[i]=='q'){grp.extention[i]='Q';}; if(grp.extention[i]=='r'){grp.extention[i]='R';}; if(grp.extention[i]=='s'){grp.extention[i]='S';}; if(grp.extention[i]=='t'){grp.extention[i]='T';}; if(grp.extention[i]=='u'){grp.extention[i]='U';}; if(grp.extention[i]=='v'){grp.extention[i]='V';}; if(grp.extention[i]=='w'){grp.extention[i]='W';}; if(grp.extention[i]=='x'){grp.extention[i]='X';}; if(grp.extention[i]=='y'){grp.extention[i]='Y';}; if(grp.extention[i]=='z'){grp.extention[i]='Z';}; } //return(&grp.extention[0]); } /*--Triming Extention's end.-----------------------------------------------;*/ /*-- Add Top \ to Pathname STR from commandline.---------------------------;*/ void addbackslashpathhead(void) { int i; if((grp.pathname[0]!='\0')&&(grp.pathname[0]!='\\')) { /* 0----------(n-1) :i ...........[] :old grp.pathname[258] str. \ ...........[] :new grp.pathname[258] str. 0------------(n-1+1) :new i.....*/ for(i=strlen(grp.pathname)-1+1;0<=i;i--)//+1 for \0 of str's end. { grp.pathname[i+1]=grp.pathname[i]; } grp.pathname[0]='\\'; } } /*-------------------------------------------------------------------------;*/ /*--Get Home Current place.------------------------------------------------;*/ void current(void) { //char grp.current[258]; FILE *read_fp; int i,d1st; system("dir > current.tmp"); if((read_fp=fopen("current.tmp","r"))!=NULL) { while((fgets(grp.current,256,read_fp))!='\0') { if((d1st=discover1st(grp.current,"\\"))!=-1) { goto currentcmdescape; } } printf("error /cannot know current place.\n"); exit(1); currentcmdescape:; /*Breaked;*/ for(i=d1st;grp.current[i]!='\0';i++) { if(grp.current[i]=='\n') { grp.current[i]='\0'; } grp.current[i-d1st]=grp.current[i]; } i=i-1; grp.current[i+1]='\0'; if(grp.current[1]=='\0'){grp.current[0]='\0';}; //Can make null str because of not pointer-str. fclose(read_fp); } printf(grp.current); remove("current.tmp"); } /*-------------------------------------------------------------------------;*/ void path(void) { int m,k; /*path directry imfo.line.\n; '\\' is \ character's regular expression.;*/ ++grp.path_counter; grp.file_counter=0; k=discover1st(grp.pathname,"\\"); for(m=k;grp.pathname[m]!='\0';m++) { if(grp.pathname[m]=='\n') { grp.pathname[m]='\0'; }/*\n remove.;*/ grp.pathname[m-k]=grp.pathname[m]; } m=m-1; grp.pathname[m-k+1]='\0';/*grp.pathname strings' ends.;*/ grp.path_counter++; if(grp.pathname[1]=='\0') { grp.pathname[0]='\0'; } /*Current Root Directry No has '\'mark.;*/ printf("%s",grp.pathname); } /*-------------------------------------------------------------------------;*/ void file(void) { char tmp[258]; int i; /*only "*.???" included line of pathname.tmp & filename.tmp active.;*/ grp.file_counter++; for (i=0;i<=11;i++) { if(grp.filename[i]==' ') { break; } } i=i-1; grp.filename[i+1]='.'; grp.filename[i+2]='\0'; /*To get trunk of grp.filename.;*/ strcat(grp.filename,grp.extention); sprintf(tmp,"%s\\%s",grp.pathname,grp.filename); strcpy(grp.filename,tmp); printf("%s\n",grp.filename); } /*-------------------------------------------------------------------------;*/ void getpathname(void) { FILE *read_fp; //int k,m; char tmp[258],dosorder[258]; remove("pathname.tmp"); grp.path_counter=0; grp.file_counter=0; /*--Get Path & File Name File from DRV TOP Current.------------------------;*/ current(); if (grp.current[1]=='\0'){grp.current[0]='\0';} if (grp.pathname[1]=='\0'){grp.pathname[0]='\0';}//actually, no work. system("cd\\"); strcpy(dosorder,"dir *."); trimextention(); strcat(dosorder,grp.extention); strcat(dosorder," /s > "); strcat(dosorder,grp.current); strcat(dosorder,"\\pathname.tmp"); printf("%s\n",dosorder); system(dosorder); dosorder[0]='\0'; /*--Return home directry.--------------------------------------------------;*/ if(grp.current[0]=='\0') { sprintf(dosorder,"cd\\"); } else { sprintf(dosorder,"cd%s",grp.current); } printf("%s\n",dosorder); system(dosorder); if((read_fp=fopen("pathname.tmp","r"))==NULL) { printf("Cannot Open Pathname.TMP\n"); exit(1); } grp.path_counter=0; /*--Read Redirectional Drectry and FileList File.--------------------------;*/ while((fgets(tmp,256,read_fp))!=NULL) { /*--When Hit PathName Line.------------------------------------------------;*/ if((discover1st(tmp,":\\"))!=-1) { strcpy(grp.pathname,tmp); path(); } /*--When Hit FileName Line.------------------------------------------------;*/ if(tmp[9]==grp.extention[0]){ if(tmp[10]==grp.extention[1]){ if(tmp[11]==grp.extention[2]) { strcpy(grp.filename,tmp); file(); /*--Sub Streame of daughter branches.--------------------------------------;*/ if(strcmpi(grp.opt,"/ldrv")==0){list_daughter();} if(strcmpi(grp.opt,"/hdrv")==0){html_daughter();} if(strcmpi(grp.opt,"/tdrv")==0){tasm_daughter();} if(strcmpi(grp.opt,"/kdrv")==0){key_daughter();} if(strcmpi(grp.opt,"/cdrv")==0){csv_daughter();} }}} /*-------------------------------------------------------------------------;*/ }/*while Read;*/ fclose(read_fp); remove("pathname.tmp"); } /*--getpathname()'s end.---------------------------------------------------;*/ /*-------------------------------------------------------------------------;*/ void getfilename(void) { FILE *read_fp; //int k,m; char tmp[258],dosorder[258]; remove("filename.tmp"); grp.path_counter=1; grp.file_counter=0; /*--Get File Name File from DRV TOP Current.-------------------------------;*/ current(); if (grp.current[1]=='\0'){grp.current[0]='\0';} if (grp.pathname[1]=='\0'){grp.pathname[0]='\0';} system("cd\\"); strcpy(dosorder,"dir "); strcat(dosorder,grp.pathname); strcat(dosorder,"\\*."); trimextention(); strcat(dosorder,grp.extention); strcat(dosorder," > "); strcat(dosorder,grp.current); strcat(dosorder,"\\filename.tmp"); printf("%s\n",dosorder); system(dosorder); dosorder[0]='\0'; /*--Return home directry.--------------------------------------------------;*/ if(grp.current[0]=='\0') { sprintf(dosorder,"cd\\"); } else { sprintf(dosorder,"cd%s",grp.current); } printf("%s\n",dosorder); system(dosorder); if((read_fp=fopen("filename.tmp","r"))==NULL) { printf("Cannot Open Filename.TMP\n"); exit(1); } grp.path_counter=0; /*--Read Redirectional Drectry and FileList File.--------------------------;*/ while((fgets(tmp,256,read_fp))!=NULL) { /*--When Hit PathName Line.------------------------------------------------;*/ /*if((discover1st(grp.filename,":\\"))!=-1) { strcpy(grp.filename,tmp); path(); }*/ /*--When Hit FileName Line.------------------------------------------------;*/ if(tmp[9]==grp.extention[0]){ if(tmp[10]==grp.extention[1]){ if(tmp[11]==grp.extention[2]) { strcpy(grp.filename,tmp); file(); /*--Sub Streame of daughter branches.--------------------------------------;*/ if(strcmpi(grp.opt,"/ldir")==0){list_daughter();} if(strcmpi(grp.opt,"/hdir")==0){html_daughter();} if(strcmpi(grp.opt,"/tdir")==0){tasm_daughter();} if(strcmpi(grp.opt,"/kdir")==0){key_daughter();} if(strcmpi(grp.opt,"/cdir")==0){csv_daughter();} }}} /*-------------------------------------------------------------------------;*/ }/*while Read;*/ fclose(read_fp); remove("filename.tmp"); } /*--getfilename()'s end.---------------------------------------------------;*/ /*=========================================================================;*/ /*== promortor and daughter set sequences.=================================;*/ /*=========================================================================;*/ /* 1/list cmd 2/tasm cmd 3/html list cmd (trbufkey1:for trns to buf str.) 4/key_serch cmd 5/0-9_serch cmd ;*/ /*-- 1/list CMD.-------------------------------------------------------------;*/ void list_daughter(void) { FILE *writefp; FILE *read_fp; char buf[256]; writefp=fopen("output.txt","a"); sprintf(buf,"dir %s > output.tmp",grp.filename); system(buf); if((read_fp=fopen("output.tmp","r"))==NULL) { fprintf(writefp,"== Cannot Read %s's Imformation.=====\n",grp.filename); } else { while((fgets(buf,256,read_fp))!=NULL) fputs(buf,writefp); } fclose(writefp); fclose(read_fp); remove("output.tmp"); } /*-- 2/tasm CMD.-----------------------------------------------------------;*/ void tasm_daughter(void) { FILE *read_fp; FILE *writefp; char buf[256]; writefp=fopen("output.txt","a"); if((read_fp=fopen(grp.filename,"r"))==NULL) { fprintf(writefp,"== No Exist %s =====\n",grp.filename); } else { fprintf(writefp,"== %s =====\n",grp.filename); while((fgets(buf,256,read_fp))!=NULL) { fputs(buf,writefp); } } fclose(read_fp); fclose(writefp); /*only /tasd option.;*/ /*remove("filename.tmp");*/ } /*--3/html_list cmd.---------------------------------------------------------;*/ /* it have 2 upper ruitine.;*/ void makehtml1(void) { FILE *writefp; char newname[32]; writefp=fopen("output.htm","w");/*New create.;*/ fprintf(writefp,"
\n"); fprintf(writefp,"

Your directry's content's


\n"); fprintf(writefp,"
Those cannot self_open without ConCerned by the each Apllications.\n

\n"); fclose(writefp); if(2<=grp.fargc) { grp.extention[3]='\0'; makehtml2(); writefp=fopen("output.htm","a"); fprintf(writefp,""); fclose(writefp); sprintf(newname,"%s_html.htm",grp.extention); printf("%s\n",newname); remove(newname); rename("output.htm",newname); } else { remove("useful.htm"); //remove("output.htm"); strcpy(grp.extention,"htm");makehtml2(); strcpy(grp.extention,"txt");makehtml2(); strcpy(grp.extention,"xls");makehtml2(); strcpy(grp.extention,"doc");makehtml2(); strcpy(grp.extention,"mdb");makehtml2(); strcpy(grp.extention,"jtd"); /*Ichi-Taro the JPword proceeer, after ver.8;;Binary Document-Files.;*/ makehtml2(); strcpy(grp.extention,"123");makehtml2(); // strcpy(grp.extention,"hlp");makehtml2(); // make on mt /hdrv(hdir) hlp. because of so many //hlp_files on normal WINDOWS(TM) SYSTEM. strcpy(grp.extention,"jpg");makehtml2(); strcpy(grp.extention,"avi");makehtml2(); strcpy(grp.extention,"wav");makehtml2(); strcpy(grp.extention,"mdi");makehtml2(); strcpy(grp.extention,"rmi");makehtml2(); strcpy(grp.extention,"gif");makehtml2(); strcpy(grp.extention,"bmp");makehtml2(); writefp=fopen("output.htm","a"); fprintf(writefp,""); fclose(writefp); rename("output.htm","useful.htm"); } } /*-------------------------------------------------------------------------;*/ void makehtml2(void) { FILE *writefp; writefp=fopen("output.htm","a"); fprintf(writefp,"== %s =====
\n",grp.extention); fclose(writefp); if(strcmpi(grp.opt,"/hdrv")==0){getpathname();}; if(strcmpi(grp.opt,"/hdir")==0){getfilename();}; } /*-------------------------------------------------------------------------;*/ void html_daughter(void) { FILE *writefp; writefp=fopen("output.htm","a"); int i; if((1+1\n");} for(i=0+1;i<=10000;i++) { if(grp.file_counter==i*5+1) { /*New Line by the Unit Of 5_lines.;*/ fprintf(writefp,"
\n"); break; } } fprintf(writefp,"
%s
\n",grp.filename,grp.filename); fclose(writefp); } /*-- Key and Csv cmd from this.--------------------------------------------;*/ /*-- char int changer for linesmargin.-------------------------------------;*/ /*int linesmargin_char2int(char *char_linesmargin) { int grp.lines_margin; grp.lines_margin=atoi(char_linesmargin); if((grp.lines_margin<0)||(4 newbufa\n + newbufb\n it is by refossil2-func. ^including 'keyword' repaired. well, bufa<=newbufa, bufb<=newbufb, and pass 'bufa' to many understream branch, after it, bufa < bufb renewal. Most first,bufa=='== Mather filename =====\n' Most EOF, bufa alone executed with out new bufb.; =========================================================================;*/ finalline_flag=0; while(finalline_flag==0) { /*if read_bufb reach EOF,it skip trunk doing and pass old bufa to off springs branch.;*/ if((fgets(bufb,254,read_fp))==NULL) { /*printf("a");*/ printf("Throw Final- line into Process.\n"); finalline_flag=-1; goto whenfileend; } else { //printf("%ldth line readed.\n",line_counter+long 1); if(discover1st(bufb,"\n")==-1){strcpy(bufb,"\n");} /*globalchbuf,buffer to check.*/ strcpy(globalchbuf,bufa); strcat(globalchbuf,bufb); /*globalchbuf, it is include inner '\n';*/ /*call repair-function for keyword;*/ strcpy(globalkeyword,grp.keyword); refossil2(); //real execute create globalchbuf for new bufa/b from globalchbuf. /*initialize buffer contents for new buffers.;*/ bufa[0]='\0'; bufb[0]='\0'; /*write before paragraph of (new)globalchbuf to bufa,;*/ for (i=0;globalchbuf[i]!='\0';i++) { /*printf("%c",globalchbuf[i]);*/ bufa[i]=globalchbuf[i]; if(globalchbuf[i]=='\n') { bufa[i+1]='\0'; goto nextisbufb; } } fprintf(writefp, "== %s Nothing Newline code in Buffering A of MT process.==\n",grp.filename); fprintf(writefp, "== Now plus new_NewLine code and new bufa 254 char.s forcely. ==\n"); bufa[255]='\0'; strcat(bufa,"\n"); /*exit(1);*/ nextisbufb:; /*write back paragraph of (new) globalchbuf to bufb.;*/ m=i+1; for(j=m;globalchbuf[j]!='\0';j++) { bufb[j-m]=globalchbuf[j]; if(globalchbuf[j]=='\n') { bufb[j-m+1]='\0'; goto nextisescape; } } fprintf(writefp, "== %s Nothing Newline code in Buffering B of MT process.==\n" ,grp.filename); fprintf(writefp, "== Now plus new_NewLine code and new bufb is 254 char.s forcely.==\n"); //goto whenerrorescape; for(i=254+1;bufb[i]!='\0';i++) { bufb[i-(254+1)]=bufb[i]; } i=i-1; bufb[i]='\0'; strcat(bufb,"\n"); /*exit(1);*/ nextisescape:; /*printf("bufa:%sbufb:%s\n",bufa,bufb);*/ } /*read_mather file show EOF, then jump to this, be alone bufa only,,with out bufb contents,*/ whenfileend:; /*This function same as csv_daughter.--------------------------------------;*/ //--same to key_daughter.----------------------------------------------------- //line_counter. line_counter++; printf("%s Line Number:%ld\n",grp.filename,line_counter); //front margin duty wrire. if(0<----- filebackup(); in fileback.h; | |--for ez common functionss. | |-numasm() | |-cleanup() | |--keyfuncs():Keyword Serch FUNCTIONS.-----><-----*refossil2() | | CRLFed keyword Repaire Ruitine | | In refossil.h | | | |-FILE *????????(FILE *writefp,.....) KeyfuncsFamiles' Dauters Process. | |--pikanti() out of cmd of keyfuncs. (no using char *reffosil2();) | |--enzyme()-----><-----*refossil2() | |--:get path/filelist families.------------------------------------------ | ---------------------------- | -- Logical Composition.----- | ---------------------------- | get* 's subfunction | |-char *current | |-char *trimextention | | getpathname------------<-------+ /drvk(Example.) give Extention. | |:loop | | getfilename------------<-------| /dirk give Pathname. | loop:+------------->-+ | & Extention. | | | | | V each functions' subf. | | | | | | | +---<<---------+ | eachfunctions:daughter <-+ <--+ /filek | give Filename. | <-Filename. | | ^| one kind of family set | | | | main()(:all functions promoter.) | | Can use only 'getfilename' from those current directry. | Cannot escape hit bad file. When exe process stopped, | Pripare many method for users. | |----------------------------------------------------------------------; | each promoter/daughter processes.(get path/files families.) | | |--key_promoter/daughter(): serch keyword with margin.--><---refossil2() |--csv_promoter/dauther(): serch 0-9 char. w. margin.--><---trbufkey12() | | *trbufkey12() is translation function to | buffer strings by keyword1 to keyword2. |--list_promoter/daughter() | |--htmi_make1() | | | html_make2() | | | |-html_promoter/dauther() :get html style file list | | ------------------------------------------------------------------------ | main(){} :main is a role to control CMD Option Promoter. == style as declearation's style. =============================== *for system maintenances. pwinuj :promoter for WindowsGUI with US and JP edition. spreaduj:sprede readmeus/jp.txt. mkodhead:make oderform_dialogue txt as *.h. mkrmhead:make readmeus/jp txt as *.h. orirmod :output original readme*.txt and odrformp.txt. void pwinuj(fargc,char fargv1[258]); void spreaduj(); void mkodhead(int fargc,char fargv1[258]); void mkrmhead(int fargc,char fargv1[258]); void orirmod(); *common file operationg functions. void newtxtjp(); void time(int fargc,char filename[258],char signature[258]); void txtasm(); void append(int fargc,char file1[258],char file2[258]); void bak2txt(int fargc,char filename[258]); void addcont(int fargc,char filename[258]); void sepcont(int fargc,char filename[258]); void segment(int fargc,char filename[258],char linenumber_perpage[258],char charper_char keyword[258]); void rmvseg(int fargc,char filename[258]); void pikanti(int fargc,char filename[258],char char keyword[258]); *for EZ functions.; void numasm(int fargc,char number_files[258]); void cleanup(int fargc,char number_files[258]); *keyfunks familes. void keyfuncs(int fragc,char opt[8],char fargv1[258],char fargv2[258],char fargv3[258]); FILE *refossil(FILE *writefp,char bufa[258],int line_counter,char keyword[258],char file2orkey2[258]); FILE *trans(FILE *writefp,char bufa[258],int line_counter,char keyword[258],char file2orkey2[258]); FILE *translup(FILE *writefp,char bufa[258],int line_counter,char keyword[258],char file2orkey2[258]); FILE *pickup(FILE *writefp,char bufa[258],int line_counter,char keyword[258],char file2orkey2[258]); FILE *insert(FILE *writefp,char bufa[258],int line_counter,char keyword[258],char file2orkey2[258]); *enzyme; void enzyme(int fragc,char filename[258],char keyword[258]); Functions declearation's end; */ /*==========================================================================;*/ /*3)Main ruitene as promoter for each functions============================;*/ void main(int argc,char *argv[]) { /*main 1/4 option destributions for each Functions.;*/ /*void;*/int fargc; fargc=argc-1; char opt[8],fargv1[258],fargv2[258],fargv3[258],fargv4[258]; strcpy(opt,argv[1+0]); strcpy(fargv1,argv[1+1]); strcpy(fargv2,argv[2+1]); strcpy(fargv3,argv[3+1]); strcpy(fargv4,argv[4+1]); if(opt[0]=='/') { if(strcmpi(opt,"/moh" )==0){mkodhead(fargc,fargv1); exit(1);} if(strcmpi(opt,"/pwin")==0){ pwinuj( fargc,fargv1); exit(1);} if(strcmpi(opt,"/mrc" )==0){ mkrmc(fargc,fargv1); exit(1);} if(strcmpi(opt,"/srt" )==0){spreaduj(); exit(1);} //if(strcmpi(opt,"/mrh_h" )==0){mkrmhead_html(fargc,fargv1); exit(1);} if(strcmpi(opt,"/srt_h" )==0){spreaduj_html(); exit(1);} if(strcmpi(opt,"/ori" )==0){ orirmod(); exit(1);} if(strcmpi(opt,"/new" )==0){newtxtjp(); exit(1);} if(strcmpi(opt,"/time")==0){ time(fargc,fargv1,fargv2); exit(1);} if(strcmpi(opt,"/tasm")==0){ txtasm(); exit(1);} if(strcmpi(opt,"/apd" )==0){ append(fargc,fargv1,fargv2); exit(1);} if(strcmpi(opt,"/adc" )==0){ addcont(fargc,fargv1); exit(1);} if(strcmpi(opt,"/spc" )==0){ sepcont(fargc,fargv1); exit(1);} if(strcmpi(opt,"/seg" )==0){ segment(fargc,fargv1,fargv2,fargv3); exit(1);} if(strcmpi(opt,"/rsg" )==0){ rmvseg(fargc,fargv1); exit(1);} if(strcmpi(opt,"/b2t" )==0){ bak2txt(fargc,fargv1); exit(1);} if(strcmpi(opt,"/nasm")==0){ numasm(fargc,fargv1); exit(1);} if(strcmpi(opt,"/cln" )==0){cleanup(fargc,fargv1); exit(1);} /*dominstrcmpition for keyword_serching functions.*/ if(strcmpi(opt,"/ref" )==0){keyfuncs(fargc+1,opt,fargv1,fargv2,fargv3); exit(1);} if(strcmpi(opt,"/tr" )==0){keyfuncs(fargc+1,opt,fargv1,fargv2,fargv3); exit(1);} if(strcmpi(opt,"/tlup")==0){keyfuncs(fargc+1,opt,fargv1,fargv2,fargv3); exit(1);} if(strcmpi(opt,"/pik" )==0){keyfuncs(fargc+1,opt,fargv1,fargv2,fargv3); exit(1);} if(strcmpi(opt,"/ins" )==0){keyfuncs(fargc+1,opt,fargv1,fargv2,fargv3); exit(1);} if(strcmpi(opt,"/ez" )==0){ enzyme(fargc,fargv1,fargv2); exit(1);} if(strcmpi(opt,"/pika")==0){ pikanti(fargc,fargv1,fargv2); exit(1);} /*Extract Pik cmd crowd.;*/ /*Usage for Command design. Extracted PIK CMD famirie, has two functional constraction. 1)upper.:get each file name and pass it to subprocess one by one. 2)under.:recieve "filename" and do subprocess.(when it write same write file, then it does on Append_Write mode.) X_PIK famiries's optional letters.: ex. mt /drvk ..... = /for whole Drive and Keyword serch subprocess. in this rules,. this is next usage-expressions. /drvk keyword serch to whole drive. /dirk keyword serch to current/ordered directry. /key keyword serch to one file. /drvc 0-9 char. serch to whole drive. /dirc 0-9 char. serch to current/ordered directry. /csv 0-9 char. serch to current/ordered directry. and other commnds. /drvh meke file list on HTML style YYMMDDaa.txt\n"); printf("TimeStump FOOTER. mt /time filename.txt (sign/comment) >FILENAME.txt\n"); //printf("\n"); printf("Making Sum-TXT. mt /tasm (return) >sumtxt.txt \n"); printf("Append file. mt /apd headfile.txt backfile.txt >HEADFILE.txt\n"); printf("ADD contents to file. mt /adc filename.txt >FILENAME.txt\n"); printf("SEParation Contents. mt /spc filename.txt >FILENAME.txt\n"); printf("Contents-Call. contcall (return:batch-file).\n"); printf("Segmentize File. mt /seg filename.txt numberline (Keyword)>output.txt\n"); printf("Removing Segment. mt /rsg filename.txt >FILENAME.txt\n"); printf("Restore Bakeup-file. mt /b2t filename.bak >output.txt\n"); printf("\n"); printf("Repair CRLFed keyword.mt /ref filename.txt keyword >output.txt\n"); printf("Desolve by keyword. mt /ez filename.txt keyword >0-9999.txt\n"); printf("Combine all enzymed. mt /nasm numberoffiles >output.txt\n"); printf("Cleanup all enzymed. mt /cln numberoffiles \n"); //printf("\n"); printf("Pickup Keyword-line. mt /pik filename.txt keyword >output.txt\n"); printf("Pickup KeywordAnti. mt /pika filename.txt keyword >output.txt\n"); //printf("\n"); printf("Autotranslation. mt /trs filename.txt keyword1 keyword2 >output.txt\n"); printf("AutoTRS,with leftup. mt /tlup filename.txt keyword1 keyword2 >output.txt\n"); printf("Insert. mt /ins file1.txt keyword file2.txt >output.txt\n"); printf("==HIT ANY KEY.=====\n"); getch(); /*main4/4 Massage to CMDline.==============================================;*/ //printf("MultiFunctions for text ver.1.029uni/(C)MIYAMA.1999 VYE00525@nifty.ne.jp .\n"); printf("==Function ==========Usage ===================================Output_files.==\n"); printf("FileList_DRV byDosDir.mt /ldrv (extention) >output.txt\n"); printf("FileList_DIR byDosDir.mt /ldir (extention) (\\pathname) >output.txt\n"); printf("FileList_DRV HTML. mt /hdrv (extention) >output.txt\n"); printf("FileList_DIR HTML. mt /hdir (extention) (\\pathname) >output.txt\n"); printf("\n"); printf("Making Sum_Txt:DRV. mt /tdrv (extention) >output.txt\n"); printf("Making Sum_Txt:DIR. mt /tdir (extention) (\\pathname) >output.txt\n"); printf("\n"); printf("Pickup Keyword:DRV. mt /kdrv keyword (extention) (lines_margin) >output.txt\n"); printf("Pickup Keyword:DIR. mt /kdir keyword (extention) (\\pathname) (lines_margin) >output.txt\n"); printf("\n"); printf("Pickup Keyword:FILE. mt /key keyword filename (lines_margin) >output.txt\n"); printf("\n"); printf("Pickup 0-9 char.:DRV. mt /cdrv (extention) (lines_margin) >output.txt\n"); printf("Pickup 0-9 char.:DIR. mt /cdir (extention) (\\pathname) (lines_margin) >output.txt\n"); printf("\n"); printf("Pickup 0-9 char.:FILE.mt /csv filename (lines_margin) >output.txt\n"); printf("===============================================================================\n"); printf("Multifunctions for Text ver.1.029uni/(C)MIYAMA.1999 VYE00525@nifty.ne.jp .\n"); } /*==========================================================================;*/ /* ==CMD for system maintenance and operation.===== 4-1)HANDS functions. 01 pwinuj /pwin (j/u) Promoter for Win95/NT. 02 spreaduj /srt make readmeus.txt and readmejp.txt. 03 spreaduj_html /srt_h make readmeus.htm and readmejp.htm. 06 orirmod /ori out readmegn/odrformp.txt as original with bilingal. 4-2)EARS functions. 04 mkodhead /moh make headerfile(odrformp.h) to make odrformp(pre).txt. 05 mkrmc /mrc make sourcefile(readmegn.c) to make readmegen(general).txt). ==Simple file operation.===== 1 newtxtjp Making YYMMDDaa.txt(append mode) 2 time APPEND TIMEStump as FOOTER. 3 txtasm Make SumTXT.TXT from aall *.txt. 4 append Append file 2 to file2 with filename-tag. 5 bak2txt Repair *.bat to output.txt. 5)Each CMD. ==CMD for edit.===== 6 addcont Add Contents to files. 7 sepcont Separation Contents from files. 8 segment Add line and Page Number to files. 9 rmvseg Reamving l and p number. ==CMD for changer.===== (From V.1.027, all function without 11/12, included as domain the KEYFUNCS.function.) 10 refossil Repair CRLFed keyword. 11 enzyme Desolve file to faragment(0-9999.txt) with keyword place. 12 numasm Recombine 0-9999.txt to Output.txt 13 cleanup Remove 0-9999.txt 14 trans AutoTranslation. 15 trs l up TRS with Keyword left up.) 16 pickup Pickup Keyword line of files. 17 insert Insert file2.txt to file1.txt's keyword place. ==Multi Files CMD.===== 18 list get file list of DRV/DIR. 19 html get files list of DRV/DIR. 20 tasm make sum_txt file from DRV/DIR. 21 key pickup keyword from files of DRV/DIR. 22 csv pickup 0-9 char.s from files of DRV/DIR. /*=========================================================================;*//*==========================================================================;*/ /*7) MT Source's TXT 's end.;*/ /*==========================================================================;*/