mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-24 11:53:25 +00:00
Cyclic rotation and python script argv passing solved
This commit is contained in:
parent
edb2431cf9
commit
6e50104da4
@ -2,14 +2,10 @@ import ccextractor as cc
|
||||
import os
|
||||
import time
|
||||
import sys
|
||||
sample = " ".join(sys.argv[1:])
|
||||
print 'Name of sample is {0}'.format(sample)
|
||||
time.sleep(1)
|
||||
s = cc.api_init_options()
|
||||
cc.checking_configuration_file(s)
|
||||
params = [str(sample)]
|
||||
for i in params:
|
||||
for i in sys.argv[1:]:
|
||||
cc.api_add_param(s,str(i))
|
||||
compile_ret = cc.compile_params(s,len(params));
|
||||
compile_ret = cc.compile_params(s,len(sys.argv[1:]));
|
||||
start_ret = cc.api_start(s);
|
||||
os.system('clear')
|
||||
#os.system('clear')
|
||||
|
@ -434,24 +434,15 @@ void checking_configuration_file(struct ccx_s_options api_options){
|
||||
|
||||
int compile_params(struct ccx_s_options *api_options,int argc){
|
||||
printf("Inside compile params\n");
|
||||
char** temp = malloc(api_options->argument_count*sizeof(char *));
|
||||
int i=0;
|
||||
while(i<api_options->argument_count){
|
||||
temp[i]=malloc(strlen(api_options->myarguments[i]));
|
||||
strcpy(temp[i],api_options->myarguments[i]);
|
||||
i++;
|
||||
}
|
||||
api_options->myarguments = realloc(api_options->myarguments, (api_options->argument_count+1) * sizeof *api_options->myarguments);
|
||||
api_options->myarguments[0] = realloc(api_options->myarguments[0],strlen("./ccextractor")+1);
|
||||
strcpy(api_options->myarguments[0], "./ccextractor");
|
||||
api_options->myarguments[api_options->argument_count] = malloc(strlen("./ccextractor")+1);
|
||||
strcpy(api_options->myarguments[api_options->argument_count], "./ccextractor");
|
||||
api_options->argument_count++;
|
||||
i=1;
|
||||
while(i<api_options->argument_count){
|
||||
api_options->myarguments[i] = realloc(api_options->myarguments[i],strlen(temp[i-1]));
|
||||
strcpy(api_options->myarguments[i],temp[i-1]);
|
||||
i++;
|
||||
}
|
||||
free(temp);
|
||||
char* temp = api_options->myarguments[api_options->argument_count-1];
|
||||
int i;
|
||||
for (i = api_options->argument_count-1; i > 0; i--)
|
||||
api_options->myarguments[i] = api_options->myarguments[i-1];
|
||||
api_options->myarguments[0] = temp;
|
||||
int ret = parse_parameters (api_options, api_options->argument_count, api_options->myarguments);
|
||||
if (ret == EXIT_NO_INPUT_FILES)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user