[Compbench-devel] CompBenchmarks++/CBM-PI CBM.i, 1.1, 1.2 CBM.pm, 1.1, 1.2 CBM_wrap.cxx, 1.1, 1.2
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2006-12-28 13:23:03
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20090 Modified Files: CBM.i CBM.pm CBM_wrap.cxx Log Message: libcompbenchmarks.h used. Index: CBM.pm =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CBM.pm 28 Dec 2006 00:38:14 -0000 1.1 --- CBM.pm 28 Dec 2006 13:22:57 -0000 1.2 *************** *** 47,50 **** --- 47,51 ---- package CBM; + *setVerbosity = *CBMc::setVerbosity; *Init = *CBMc::Init; *stringref = *CBMc::stringref; *************** *** 377,380 **** --- 378,382 ---- *CBM_SYSTEM_FREEBSD = *CBMc::CBM_SYSTEM_FREEBSD; *CBM_SYSTEM_LINUX = *CBMc::CBM_SYSTEM_LINUX; + *HAVE_CTYPE_H = *CBMc::HAVE_CTYPE_H; *HAVE_DLFCN_H = *CBMc::HAVE_DLFCN_H; *HAVE_GETOPT_H = *CBMc::HAVE_GETOPT_H; *************** *** 399,402 **** --- 401,409 ---- *STDC_HEADERS = *CBMc::STDC_HEADERS; *VERSION = *CBMc::VERSION; + *H_CBMLIBCOMPBENCHMARKS = *CBMc::H_CBMLIBCOMPBENCHMARKS; + *libcompbenchmarks_version = *CBMc::libcompbenchmarks_version; + *UO_enableTestSuite = *CBMc::UO_enableTestSuite; + *UO_force = *CBMc::UO_force; + *UO_verbose = *CBMc::UO_verbose; my %__cbmSystem_hash; Index: CBM_wrap.cxx =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM_wrap.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CBM_wrap.cxx 28 Dec 2006 00:38:14 -0000 1.1 --- CBM_wrap.cxx 28 Dec 2006 13:22:57 -0000 1.2 *************** *** 1375,1378 **** --- 1375,1381 ---- + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0) + + /* -------- TYPES TABLE (BEGIN) -------- */ *************** *** 1424,1430 **** --- 1427,1464 ---- + #include <stdexcept> + + #include <string> + double SwigSvToNumber(SV* sv) { + return SvIOK(sv) ? double(SvIVX(sv)) : SvNVX(sv); + } + std::string SwigSvToString(SV* sv) { + STRLEN len; + return SvPV(sv,len); + } + void SwigSvFromString(SV* sv, const std::string& s) { + sv_setpv(sv,s.c_str()); + } + + + #include <string> + + + #include <vector> + #include <algorithm> + #include <stdexcept> + + #include <map> + #include <algorithm> + #include <stdexcept> + + + #include <utility> + + + #include "libcompbenchmarks.h" #include "Glue.h" *************** *** 1492,1574 **** - SWIGINTERN swig_type_info* - SWIG_pchar_descriptor() - { - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; - } - - - SWIGINTERN int - SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) - { - if (SvPOK(obj)) { - STRLEN len = 0; - char *cstr = SvPV(obj, len); - size_t size = len + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = reinterpret_cast<char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - char* vptr = 0; - if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = vptr; - if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; - } - - - SWIGINTERN int - SWIG_AsPtr_std_string SWIG_PERL_DECL_ARGS_2(SV * obj, std::string **val) - { - char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; - if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) delete[] buf; - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } else { - static int init = 0; - static swig_type_info* descriptor = 0; - if (!init) { - descriptor = SWIG_TypeQuery("std::string" " *"); - init = 1; - } - if (descriptor) { - std::string *vptr; - int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); - if (SWIG_IsOK(res) && val) *val = vptr; - return res; - } - } - return SWIG_ERROR; - } - - #include <limits.h> #ifndef LLONG_MIN --- 1526,1529 ---- *************** *** 1649,1665 **** SWIGINTERN int ! SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) { ! if (SvUOK(obj)) { ! if (val) *val = SvUV(obj); return SWIG_OK; - } else if (SvIOK(obj)) { - long v = SvIV(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } } else { int dispatch = 0; --- 1604,1612 ---- SWIGINTERN int ! SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) { ! if (SvIOK(obj)) { ! if (val) *val = SvIV(obj); return SWIG_OK; } else { int dispatch = 0; *************** *** 1667,1671 **** if (nptr) { char *endptr; ! unsigned long v = strtoul(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; --- 1614,1618 ---- if (nptr) { char *endptr; ! long v = strtol(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; *************** *** 1681,1686 **** double d; int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); ! if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { ! if (val) *val = (unsigned long)(d); return res; } --- 1628,1633 ---- double d; int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); ! if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { ! if (val) *val = (long)(d); return res; } *************** *** 1692,1704 **** SWIGINTERN int ! SWIG_AsVal_unsigned_SS_int SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned int *val) { ! unsigned long v; ! int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, &v); if (SWIG_IsOK(res)) { ! if ((v > UINT_MAX)) { return SWIG_OverflowError; } else { ! if (val) *val = static_cast<unsigned int >(v); } } --- 1639,1651 ---- SWIGINTERN int ! SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) { ! long v; ! int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v); if (SWIG_IsOK(res)) { ! if ((v < INT_MIN || v > INT_MAX)) { return SWIG_OverflowError; } else { ! if (val) *val = static_cast<int >(v); } } *************** *** 1707,1723 **** ! SWIGINTERNINLINE SV * ! SWIG_From_std_string SWIG_PERL_DECL_ARGS_1(const std::string& s) { ! return SWIG_FromCharPtrAndSize(s.data(), s.size()); } SWIGINTERN int ! SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) { ! if (SvIOK(obj)) { ! if (val) *val = SvIV(obj); return SWIG_OK; } else { int dispatch = 0; --- 1654,1750 ---- ! SWIGINTERN swig_type_info* ! SWIG_pchar_descriptor() { ! static int init = 0; ! static swig_type_info* info = 0; ! if (!init) { ! info = SWIG_TypeQuery("_p_char"); ! init = 1; ! } ! return info; } SWIGINTERN int ! SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) { ! if (SvPOK(obj)) { ! STRLEN len = 0; ! char *cstr = SvPV(obj, len); ! size_t size = len + 1; ! if (cptr) { ! if (alloc) { ! if (*alloc == SWIG_NEWOBJ) { ! *cptr = reinterpret_cast<char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); ! } else { ! *cptr = cstr; ! *alloc = SWIG_OLDOBJ; ! } ! } ! } ! if (psize) *psize = size; ! return SWIG_OK; ! } else { ! swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); ! if (pchar_descriptor) { ! char* vptr = 0; ! if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { ! if (cptr) *cptr = vptr; ! if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; ! if (alloc) *alloc = SWIG_OLDOBJ; ! return SWIG_OK; ! } ! } ! } ! return SWIG_TypeError; ! } ! ! ! SWIGINTERN int ! SWIG_AsPtr_std_string SWIG_PERL_DECL_ARGS_2(SV * obj, std::string **val) ! { ! char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; ! if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { ! if (buf) { ! if (val) *val = new std::string(buf, size - 1); ! if (alloc == SWIG_NEWOBJ) delete[] buf; ! return SWIG_NEWOBJ; ! } else { ! if (val) *val = 0; ! return SWIG_OLDOBJ; ! } ! } else { ! static int init = 0; ! static swig_type_info* descriptor = 0; ! if (!init) { ! descriptor = SWIG_TypeQuery("std::string" " *"); ! init = 1; ! } ! if (descriptor) { ! std::string *vptr; ! int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); ! if (SWIG_IsOK(res) && val) *val = vptr; ! return res; ! } ! } ! return SWIG_ERROR; ! } ! ! ! SWIGINTERN int ! SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) ! { ! if (SvUOK(obj)) { ! if (val) *val = SvUV(obj); return SWIG_OK; + } else if (SvIOK(obj)) { + long v = SvIV(obj); + if (v >= 0) { + if (val) *val = v; + return SWIG_OK; + } else { + return SWIG_OverflowError; + } } else { int dispatch = 0; *************** *** 1725,1729 **** if (nptr) { char *endptr; ! long v = strtol(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; --- 1752,1756 ---- if (nptr) { char *endptr; ! unsigned long v = strtoul(nptr, &endptr,0); if (errno == ERANGE) { errno = 0; *************** *** 1739,1744 **** double d; int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); ! if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { ! if (val) *val = (long)(d); return res; } --- 1766,1771 ---- double d; int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); ! if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { ! if (val) *val = (unsigned long)(d); return res; } *************** *** 1750,1762 **** SWIGINTERN int ! SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) { ! long v; ! int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v); if (SWIG_IsOK(res)) { ! if ((v < INT_MIN || v > INT_MAX)) { return SWIG_OverflowError; } else { ! if (val) *val = static_cast<int >(v); } } --- 1777,1789 ---- SWIGINTERN int ! SWIG_AsVal_unsigned_SS_int SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned int *val) { ! unsigned long v; ! int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, &v); if (SWIG_IsOK(res)) { ! if ((v > UINT_MAX)) { return SWIG_OverflowError; } else { ! if (val) *val = static_cast<unsigned int >(v); } } *************** *** 1765,1768 **** --- 1792,1802 ---- + SWIGINTERNINLINE SV * + SWIG_From_std_string SWIG_PERL_DECL_ARGS_1(const std::string& s) + { + return SWIG_FromCharPtrAndSize(s.data(), s.size()); + } + + *************** *** 1779,1782 **** --- 1813,1909 ---- return 0; } + SWIGCLASS_STATIC int _wrap_libcompbenchmarks_version_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + { + char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ; + int res = SWIG_AsCharPtrAndSize(sv, &cptr, &csize, &alloc); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in variable '""libcompbenchmarks_version""' of type '""char *""'"); + } + if (libcompbenchmarks_version) delete[] libcompbenchmarks_version; + if (alloc == SWIG_NEWOBJ) { + libcompbenchmarks_version = cptr; + } else { + libcompbenchmarks_version = csize ? reinterpret_cast<char* >(memcpy((new char[csize]), cptr, sizeof(char)*(csize))) : 0; + } + } + fail: + return 1; + } + + + SWIGCLASS_STATIC int _wrap_libcompbenchmarks_version_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + sv_setsv(sv,SWIG_FromCharPtr(libcompbenchmarks_version)) ; + return 1; + } + + + SWIGCLASS_STATIC int _wrap_UO_enableTestSuite_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + { + int val; + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in variable '""UO_enableTestSuite""' of type '""int""'"); + } + UO_enableTestSuite = static_cast<int >(val); + } + fail: + return 1; + } + + + SWIGCLASS_STATIC int _wrap_UO_enableTestSuite_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + sv_setsv(sv,SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(UO_enableTestSuite))) ; + return 1; + } + + + SWIGCLASS_STATIC int _wrap_UO_force_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + { + int val; + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in variable '""UO_force""' of type '""int""'"); + } + UO_force = static_cast<int >(val); + } + fail: + return 1; + } + + + SWIGCLASS_STATIC int _wrap_UO_force_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + sv_setsv(sv,SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(UO_force))) ; + return 1; + } + + + SWIGCLASS_STATIC int _wrap_UO_verbose_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + { + int val; + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in variable '""UO_verbose""' of type '""int""'"); + } + UO_verbose = static_cast<int >(val); + } + fail: + return 1; + } + + + SWIGCLASS_STATIC int _wrap_UO_verbose_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + sv_setsv(sv,SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(UO_verbose))) ; + return 1; + } + + SWIGCLASS_STATIC int _wrap_cbmSystem_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) { MAGIC_PPERL *************** *** 1810,1813 **** --- 1937,1968 ---- extern "C" { #endif + XS(_wrap_setVerbosity) { + { + int arg1 ; + int val1 ; + int ecode1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: setVerbosity(v);"); + } + ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "setVerbosity" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast<int >(val1); + setVerbosity(arg1); + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + XS(_wrap_CBMSystem_init) { { *************** *** 5246,5253 **** --- 5401,5413 ---- #endif static swig_variable_info swig_variables[] = { + { "CBMc::libcompbenchmarks_version", MAGIC_CLASS _wrap_libcompbenchmarks_version_set, MAGIC_CLASS _wrap_libcompbenchmarks_version_get,0 }, + { "CBMc::UO_enableTestSuite", MAGIC_CLASS _wrap_UO_enableTestSuite_set, MAGIC_CLASS _wrap_UO_enableTestSuite_get,0 }, + { "CBMc::UO_force", MAGIC_CLASS _wrap_UO_force_set, MAGIC_CLASS _wrap_UO_force_get,0 }, + { "CBMc::UO_verbose", MAGIC_CLASS _wrap_UO_verbose_set, MAGIC_CLASS _wrap_UO_verbose_get,0 }, { "CBMc::cbmSystem", MAGIC_CLASS _wrap_cbmSystem_set, MAGIC_CLASS _wrap_cbmSystem_get,&SWIGTYPE_p_CBMSystem }, {0,0,0,0} }; static swig_command_info swig_commands[] = { + {"CBMc::setVerbosity", _wrap_setVerbosity}, {"CBMc::CBMSystem_init", _wrap_CBMSystem_init}, {"CBMc::CBMSystem_Split", _wrap_CBMSystem_Split}, *************** *** 5701,5704 **** --- 5861,5869 ---- } while(0) /*@SWIG@*/; /*@SWIG:%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HAVE_CTYPE_H", TRUE | 0x2); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(1))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "HAVE_DLFCN_H", TRUE | 0x2); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(1))); *************** *** 5811,5814 **** --- 5976,5984 ---- } while(0) /*@SWIG@*/; /*@SWIG:%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "H_CBMLIBCOMPBENCHMARKS", TRUE | 0x2); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(1))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "CBMSystem_Root", TRUE | 0x2); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(CBMSystem::Root))); Index: CBM.i =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CBM.i 28 Dec 2006 00:38:14 -0000 1.1 --- CBM.i 28 Dec 2006 13:22:57 -0000 1.2 *************** *** 1,6 **** ! %include std_string.i %module CBM %{ #include "Glue.h" %} --- 1,7 ---- ! %include stl.i %module CBM %{ + #include "libcompbenchmarks.h" #include "Glue.h" %} *************** *** 37,40 **** --- 38,42 ---- %include "config.h" + %include "libcompbenchmarks.h" %include "System/System.h" %include "System/System-Unix.h" |