Working on PR

This commit is contained in:
Diptanshu8 2017-07-06 22:13:10 +00:00
parent 2ced408994
commit 57424857b0
5 changed files with 59 additions and 0 deletions

View File

@ -8,5 +8,9 @@ for i in sys.argv[1:]:
cc.api_add_param(s,str(i))
compile_ret = cc.compile_params(s,len(sys.argv[1:]));
start_ret = cc.api_start(s);
print cc.cvar.python_subs.number_of_lines
print type(cc.cvar.python_subs.subs)
#for item in xrange(cc.cc_to_python_get_subs_number_of_lines()):
# print cc.cc_to_python_get_sub[item]
#os.system('clear')

View File

@ -217,6 +217,14 @@ def main(argc, argv):
return _ccextractor.main(argc, argv)
main = _ccextractor.main
def cc_to_python_get_subs_number_of_lines():
return _ccextractor.cc_to_python_get_subs_number_of_lines()
cc_to_python_get_subs_number_of_lines = _ccextractor.cc_to_python_get_subs_number_of_lines
def cc_to_python_get_sub(i):
return _ccextractor.cc_to_python_get_sub(i)
cc_to_python_get_sub = _ccextractor.cc_to_python_get_sub
def __real_write(file_handle, buffer, nbyte):
return _ccextractor.__real_write(file_handle, buffer, nbyte)
__real_write = _ccextractor.__real_write

View File

@ -4188,6 +4188,41 @@ fail:
}
SWIGINTERN PyObject *_wrap_cc_to_python_get_subs_number_of_lines(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int result;
if (!PyArg_ParseTuple(args,(char *)":cc_to_python_get_subs_number_of_lines")) SWIG_fail;
result = (int)cc_to_python_get_subs_number_of_lines();
resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_cc_to_python_get_sub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
int val1 ;
int ecode1 = 0 ;
PyObject * obj0 = 0 ;
char *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:cc_to_python_get_sub",&obj0)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cc_to_python_get_sub" "', argument " "1"" of type '" "int""'");
}
arg1 = (int)(val1);
result = (char *)cc_to_python_get_sub(arg1);
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap___real_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
@ -4300,6 +4335,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"sigint_handler", _wrap_sigint_handler, METH_VARARGS, NULL},
{ (char *)"print_end_msg", _wrap_print_end_msg, METH_VARARGS, NULL},
{ (char *)"main", _wrap_main, METH_VARARGS, NULL},
{ (char *)"cc_to_python_get_subs_number_of_lines", _wrap_cc_to_python_get_subs_number_of_lines, METH_VARARGS, NULL},
{ (char *)"cc_to_python_get_sub", _wrap_cc_to_python_get_sub, METH_VARARGS, NULL},
{ (char *)"__real_write", _wrap___real_write, METH_VARARGS, NULL},
{ (char *)"__wrap_write", _wrap___wrap_write, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }

View File

@ -475,6 +475,14 @@ int api_param_count(struct ccx_s_options* api_options){
return api_options->python_param_count;
}
int cc_to_python_get_subs_number_of_lines(){
return python_subs.number_of_lines;
}
char* cc_to_python_get_sub(int i){
return python_subs.subs[i];
}
int __real_write(int file_handle, char* buffer, int nbyte);
int __wrap_write(int file_handle, char* buffer, int nbyte)
{

View File

@ -44,6 +44,8 @@ void sigterm_handler(int sig);
void sigint_handler(int sig);
void print_end_msg();
int main(int argc, char *argv[]);
int cc_to_python_get_subs_number_of_lines();
char* cc_to_python_get_sub(int i);
int __real_write(int file_handle, char* buffer, int nbyte);
int __wrap_write(int file_handle, char* buffer, int nbyte);
#endif //CCEXTRACTOR_H