|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char jini[1000];
char jycomand[1006];
char jinicode[1000];
char jyexe[1000];
char jyfun[1000];
char jfexe[1000];
int jy_ini(){
FILE *fp = fopen("index.set","r");
fscanf(fp,"%s",jini);
fscanf(fp,"%s",jinicode);
fclose(fp);
return 0;
}
int jy_comand_exe(char jycom[]){
stpcpy(jycomand,"bash ");
strcat(jycomand,jini);
strcat(jycomand," -c \"");
strcat(jycomand,jycom);
strcat(jycomand,"\"");
system(jycomand);
return 0;
}
int jy_code_new(){
//printf("%s",jinicode);
FILE *fop = fopen(jinicode,"w");
fprintf(fop,"");
fclose(fop);
return 0;
}
int jy_code_add(char code[]){
//printf("%s",jinicode);
FILE *fop = fopen(jinicode,"a");
fprintf(fop,"%s",code);
fclose(fop);
return 0;
}
int jy_code_exe(char arg[]){
stpcpy(jyexe,"bash ");
strcat(jyexe,jini);
strcat(jyexe," ");
strcat(jyexe,jinicode);
strcat(jyexe," ");
strcat(jyexe,arg);
system(jyexe);
return 0;
}
int jy_run_mod(char mod[]){
stpcpy(jyexe,"bash ");
strcat(jyexe,jini);
strcat(jyexe," -m ");
strcat(jyexe,mod);
system(jyexe);
return 0;
}
int jy_run_class(char path[]){
stpcpy(jyexe,"bash ");
strcat(jyexe,jini);
strcat(jyexe," --boot ");
strcat(jyexe,path);
system(jyexe);
return 0;
}
int jy_run_console(){
stpcpy(jyexe,"bash ");
strcat(jyexe,jini);
system(jyexe);
return 0;
}
int jy_code_fun_new(char name[],char code[]){
stpcpy(jyfun,"def ");
strcat(jyfun,name);
strcat(jyfun,"() :\n ");
strcat(jyfun,code);
FILE *fop = fopen(jinicode,"a");
fprintf(fop,"%s",jyfun);
fclose(fop);
return 0;
}
int jy_code_fun_call(char name[],char arg[]){
strcat(jfexe,name);
strcat(jfexe," (");
strcat(jfexe,arg);
strcat(jfexe," )");
FILE *fop = fopen(jinicode,"a");
fprintf(fop,"%s",jfexe);
fclose(fop);
return 0;
}
|
|