Hi,

 Thanks for supporting a great product!

 Package database-1.0.4 won't install on my octave-3.2 / Ubuntu 10.04.2 LTS. I 
THINK I fixed it, at least the package now runs my script. Due to my lack of 
understanding of octave internals, I don't know how generic my fixes are. I'm 
attaching the diffs here. It would be great, if someone knowledgeable could 
take a look at the diffs. If the diffs make sense, then we'll go further from 
there.

 Thanks!

 ----- database-1.0.4-octave-3.2.patch

 diff -rupN database-1.0.4/src/odbc_wrap.cpp 
database-1.0.4-modified/src/odbc_wrap.cpp
 --- database-1.0.4/src/odbc_wrap.cpp 2009-06-07 06:45:37.000000000 -0400
 +++ database-1.0.4-modified/src/odbc_wrap.cpp 2011-05-06 11:19:10.316765281 
-0400
 @@ -8,6 +8,8 @@
 * interface file instead.
 * 
----------------------------------------------------------------------------- */

 +#include <octave/symtab.h>
 +
 #define SWIGOCTAVE
 #define SWIG_name_d "odbc"
 #define SWIG_name odbc
 @@ -1194,9 +1196,10 @@ namespace Swig {
 install_builtin_function(it->second.first->method, it->first,
 it->second.first->doc?it->second.first->doc:std::string());
 else if (it->second.second.is_defined()) {
 - link_to_global_variable(curr_sym_tab->lookup(it->first, true));
 + symbol_table::varref(it->first);
 + symbol_table::mark_global(it->first);
 set_global_value(it->first, it->second.second);
 - 
 +
 octave_swig_type *ost = Swig::swig_value_deref(it->second.second);
 if (ost) {
 const char* h = ost->help_text();
 @@ -2107,7 +2110,9 @@ SWIGRUNTIME swig_module_info *SWIG_Octav
 SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info 
*pointer) {
 octave_value ov = new octave_swig_packed(0, &pointer, sizeof(swig_module_info 
*));
 const char *module_var = "__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME 
SWIG_RUNTIME_VERSION;
 - link_to_global_variable(curr_sym_tab->lookup(module_var, true));
 + symbol_table::varref(module_var);
 + symbol_table::mark_global(module_var);
 +
 set_global_value(module_var, ov);
 }

 @@ -2416,14 +2421,14 @@ SWIG_AsCharPtrAndSize(octave_value ov, c
 SQLRETURN SQLGetData(SQLHSTMT StatementHandle,
 SQLUSMALLINT ColumnNumber,
 std::string* value,
 - SQLINTEGER* ind) {
 + SQLLEN* ind) {
 SQLRETURN res;
 char buf[128];
 *ind=0;
 value->resize(0);
 for (;;) {
 - res=SQLGetData(StatementHandle,ColumnNumber,1,
 - buf,sizeof(buf),ind);
 + res=SQLGetData(StatementHandle,ColumnNumber,(SQLSMALLINT)1,
 + buf,(SQLLEN)(sizeof(buf)),ind);
 if (*ind==(-4)||*ind==(-1))
 return res;
 int rdlen=*ind>sizeof(buf)?sizeof(buf)-1:*ind;
 @@ -2488,7 +2493,7 @@ SWIG_AsCharPtrAndSize(octave_value ov, c
 if (!check_error(r,3,stmt))
 return Cell();

 - SQLINTEGER nr=0;
 + SQLLEN nr=0;
 SQLSMALLINT nc=0;
 r=SQLRowCount(stmt,&nr);
 if (!check_error(r,3,stmt))
 @@ -2503,7 +2508,7 @@ SWIG_AsCharPtrAndSize(octave_value ov, c
 std::vector<SQLSMALLINT> ctypes(nc);
 SQLCHAR tmp[128];
 SQLSMALLINT tmplen=0;
 - SQLUINTEGER tmp2=0;
 + SQLULEN tmp2=0;
 SQLSMALLINT tmp3=0;
 SQLSMALLINT tmp4=0;
 for (int j=0;j<nc;++j) {
 @@ -2523,8 +2528,8 @@ SWIG_AsCharPtrAndSize(octave_value ov, c
 if (r==100)
 break;
 assert(j<nr);
 - for (int k=0;k<nc;++k) {
 - SQLINTEGER ind=0;
 + for (SQLUSMALLINT k=0;k<nc;++k) {
 + SQLLEN ind=0;
 r=SQLGetData(stmt,k+1,&v,&ind);
 if (!check_error(r,3,stmt))
 return Cell();
 @@ -5068,7 +5073,7 @@ static octave_value_list _wrap_SQLColAtt
 SQLPOINTER arg4 = (SQLPOINTER) 0 ;
 SQLSMALLINT arg5 ;
 SQLSMALLINT *arg6 = (SQLSMALLINT *) 0 ;
 - SQLINTEGER *arg7 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg7 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 @@ -5121,7 +5126,7 @@ static octave_value_list _wrap_SQLColAtt
 if (!SWIG_IsOK(res7)) {
 SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "SQLColAttributes" "', 
argument " "7"" of type '" "SQLINTEGER *""'");
 }
 - arg7 = (SQLINTEGER *)(argp7);
 + arg7 = (SQLLEN *)(argp7);
 result = (SQLRETURN)SQLColAttributes(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -5221,7 +5226,7 @@ static octave_value_list _wrap_SQLDescri
 SQLHSTMT arg1 = (SQLHSTMT) 0 ;
 SQLUSMALLINT arg2 ;
 SQLSMALLINT *arg3 = (SQLSMALLINT *) 0 ;
 - SQLUINTEGER *arg4 = (SQLUINTEGER *) 0 ;
 + SQLULEN *arg4 = (SQLULEN *) 0 ;
 SQLSMALLINT *arg5 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg6 = (SQLSMALLINT *) 0 ;
 int res1 ;
 @@ -5261,7 +5266,7 @@ static octave_value_list _wrap_SQLDescri
 if (!SWIG_IsOK(res4)) {
 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "SQLDescribeParam" "', 
argument " "4"" of type '" "SQLUINTEGER *""'");
 }
 - arg4 = (SQLUINTEGER *)(argp4);
 + arg4 = (SQLULEN *)(argp4);
 res5 = SWIG_ConvertPtr(args(4), &argp5,SWIGTYPE_p_short, 0 | 0 );
 if (!SWIG_IsOK(res5)) {
 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "SQLDescribeParam" "', 
argument " "5"" of type '" "SQLSMALLINT *""'");
 @@ -5574,7 +5579,7 @@ fail:
 static octave_value_list _wrap_SQLParamOptions (const octave_value_list& args, 
int nargout) {
 SQLHSTMT arg1 = (SQLHSTMT) 0 ;
 SQLUINTEGER arg2 ;
 - SQLUINTEGER *arg3 = (SQLUINTEGER *) 0 ;
 + SQLULEN *arg3 = (SQLULEN *) 0 ;
 int res1 ;
 unsigned long val2 ;
 int ecode2 = 0 ;
 @@ -5601,7 +5606,7 @@ static octave_value_list _wrap_SQLParamO
 if (!SWIG_IsOK(res3)) {
 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SQLParamOptions" "', 
argument " "3"" of type '" "SQLUINTEGER *""'");
 }
 - arg3 = (SQLUINTEGER *)(argp3);
 + arg3 = (SQLULEN *)(argp3);
 result = (SQLRETURN)SQLParamOptions(arg1,arg2,arg3);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -6046,7 +6051,7 @@ static octave_value_list _wrap_SQLBindPa
 SQLSMALLINT arg7 ;
 SQLPOINTER arg8 = (SQLPOINTER) 0 ;
 SQLINTEGER arg9 ;
 - SQLINTEGER *arg10 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg10 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 @@ -6120,7 +6125,7 @@ static octave_value_list _wrap_SQLBindPa
 if (!SWIG_IsOK(res10)) {
 SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "SQLBindParameter" "', 
argument " "10"" of type '" "SQLINTEGER *""'");
 }
 - arg10 = (SQLINTEGER *)(argp10);
 + arg10 = (SQLLEN *)(argp10);
 result = 
(SQLRETURN)SQLBindParameter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -6284,7 +6289,7 @@ static octave_value_list _wrap_SQLBindCo
 SQLSMALLINT arg3 ;
 SQLPOINTER arg4 = (SQLPOINTER) 0 ;
 SQLINTEGER arg5 ;
 - SQLINTEGER *arg6 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg6 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 @@ -6330,7 +6335,7 @@ static octave_value_list _wrap_SQLBindCo
 if (!SWIG_IsOK(res6)) {
 SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "SQLBindCol" "', 
argument " "6"" of type '" "SQLINTEGER *""'");
 }
 - arg6 = (SQLINTEGER *)(argp6);
 + arg6 = (SQLLEN *)(argp6);
 result = (SQLRETURN)SQLBindCol(arg1,arg2,arg3,arg4,arg5,arg6);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -6347,7 +6352,7 @@ static octave_value_list _wrap_SQLBindPa
 SQLUINTEGER arg5 ;
 SQLSMALLINT arg6 ;
 SQLPOINTER arg7 = (SQLPOINTER) 0 ;
 - SQLINTEGER *arg8 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg8 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 @@ -6407,7 +6412,7 @@ static octave_value_list _wrap_SQLBindPa
 if (!SWIG_IsOK(res8)) {
 SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "SQLBindParam" "', 
argument " "8"" of type '" "SQLINTEGER *""'");
 }
 - arg8 = (SQLINTEGER *)(argp8);
 + arg8 = (SQLLEN *)(argp8);
 result = (SQLRETURN)SQLBindParam(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -6776,12 +6781,12 @@ fail:

 static octave_value_list _wrap_SQLDescribeCol (const octave_value_list& args, 
int nargout) {
 SQLHSTMT arg1 = (SQLHSTMT) 0 ;
 - SQLUSMALLINT arg2 ;
 + SQLULEN arg2 ;
 SQLCHAR *arg3 = (SQLCHAR *) 0 ;
 SQLSMALLINT arg4 ;
 SQLSMALLINT *arg5 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg6 = (SQLSMALLINT *) 0 ;
 - SQLUINTEGER *arg7 = (SQLUINTEGER *) 0 ;
 + SQLULEN *arg7 = (SQLULEN *) 0 ;
 SQLSMALLINT *arg8 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg9 = (SQLSMALLINT *) 0 ;
 int res1 ;
 @@ -6790,7 +6795,7 @@ static octave_value_list _wrap_SQLDescri
 SQLCHAR tmp3[512] ;
 SQLSMALLINT tmp23 = 0 ;
 SQLSMALLINT tmp6 = 0 ;
 - SQLUINTEGER tmp7 = 0 ;
 + SQLULEN tmp7 = 0 ;
 SQLSMALLINT tmp8 = 0 ;
 SQLSMALLINT tmp9 = 0 ;
 octave_value_list _out;
 @@ -6816,7 +6821,7 @@ static octave_value_list _wrap_SQLDescri
 if (!SWIG_IsOK(ecode2)) {
 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SQLDescribeCol" "', 
argument " "2"" of type '" "SQLUSMALLINT""'");
 }
 - arg2 = (SQLUSMALLINT)(val2);
 + arg2 = (SQLULEN)(val2);
 result = 
(SQLRETURN)SQLDescribeCol(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -7306,8 +7311,8 @@ static octave_value_list _wrap_SQLGetDat
 SQLUSMALLINT arg2 ;
 SQLSMALLINT arg3 ;
 SQLPOINTER arg4 = (SQLPOINTER) 0 ;
 - SQLINTEGER arg5 ;
 - SQLINTEGER *arg6 = (SQLINTEGER *) 0 ;
 + SQLLEN arg5 ;
 + SQLLEN *arg6 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 @@ -7348,12 +7353,12 @@ static octave_value_list _wrap_SQLGetDat
 if (!SWIG_IsOK(ecode5)) {
 SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "SQLGetData" "', 
argument " "5"" of type '" "SQLINTEGER""'");
 }
 - arg5 = (SQLINTEGER)(val5);
 + arg5 = (SQLLEN)(val5);
 res6 = SWIG_ConvertPtr(args(5), &argp6,SWIGTYPE_p_long, 0 | 0 );
 if (!SWIG_IsOK(res6)) {
 SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "SQLGetData" "', 
argument " "6"" of type '" "SQLINTEGER *""'");
 }
 - arg6 = (SQLINTEGER *)(argp6);
 + arg6 = (SQLLEN *)(argp6);
 result = (SQLRETURN)SQLGetData(arg1,arg2,arg3,arg4,arg5,arg6);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -7431,7 +7436,7 @@ static octave_value_list _wrap_SQLGetDes
 SQLSMALLINT *arg5 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg6 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg7 = (SQLSMALLINT *) 0 ;
 - SQLINTEGER *arg8 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg8 = (SQLLEN *) 0 ;
 SQLSMALLINT *arg9 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg10 = (SQLSMALLINT *) 0 ;
 SQLSMALLINT *arg11 = (SQLSMALLINT *) 0 ;
 @@ -7502,7 +7507,7 @@ static octave_value_list _wrap_SQLGetDes
 if (!SWIG_IsOK(res8)) {
 SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "SQLGetDescRec" "', 
argument " "8"" of type '" "SQLINTEGER *""'");
 }
 - arg8 = (SQLINTEGER *)(argp8);
 + arg8 = (SQLLEN *)(argp8);
 res9 = SWIG_ConvertPtr(args(8), &argp9,SWIGTYPE_p_short, 0 | 0 );
 if (!SWIG_IsOK(res9)) {
 SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "SQLGetDescRec" "', 
argument " "9"" of type '" "SQLSMALLINT *""'");
 @@ -8034,9 +8039,9 @@ fail:

 static octave_value_list _wrap_SQLRowCount (const octave_value_list& args, int 
nargout) {
 SQLHSTMT arg1 = (SQLHSTMT) 0 ;
 - SQLINTEGER *arg2 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg2 = (SQLLEN *) 0 ;
 int res1 ;
 - SQLINTEGER tmp2 = 0 ;
 + SQLLEN tmp2 = 0 ;
 octave_value_list _out;
 octave_value_list *_outp=&_out;
 octave_value _outv;
 @@ -8244,8 +8249,8 @@ static octave_value_list _wrap_SQLSetDes
 SQLSMALLINT arg6 ;
 SQLSMALLINT arg7 ;
 SQLPOINTER arg8 = (SQLPOINTER) 0 ;
 - SQLINTEGER *arg9 = (SQLINTEGER *) 0 ;
 - SQLINTEGER *arg10 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg9 = (SQLLEN *) 0 ;
 + SQLLEN *arg10 = (SQLLEN *) 0 ;
 int res1 ;
 short val2 ;
 int ecode2 = 0 ;
 @@ -8314,12 +8319,12 @@ static octave_value_list _wrap_SQLSetDes
 if (!SWIG_IsOK(res9)) {
 SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "SQLSetDescRec" "', 
argument " "9"" of type '" "SQLINTEGER *""'");
 }
 - arg9 = (SQLINTEGER *)(argp9);
 + arg9 = (SQLLEN *)(argp9);
 res10 = SWIG_ConvertPtr(args(9), &argp10,SWIGTYPE_p_long, 0 | 0 );
 if (!SWIG_IsOK(res10)) {
 SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "SQLSetDescRec" "', 
argument " "10"" of type '" "SQLINTEGER *""'");
 }
 - arg10 = (SQLINTEGER *)(argp10);
 + arg10 = (SQLLEN *)(argp10);
 result = 
(SQLRETURN)SQLSetDescRec(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -8381,7 +8386,7 @@ static octave_value_list _wrap_SQLSetPar
 SQLUINTEGER arg5 ;
 SQLSMALLINT arg6 ;
 SQLPOINTER arg7 = (SQLPOINTER) 0 ;
 - SQLINTEGER *arg8 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg8 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 @@ -8441,7 +8446,7 @@ static octave_value_list _wrap_SQLSetPar
 if (!SWIG_IsOK(res8)) {
 SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "SQLSetParam" "', 
argument " "8"" of type '" "SQLINTEGER *""'");
 }
 - arg8 = (SQLINTEGER *)(argp8);
 + arg8 = (SQLLEN *)(argp8);
 result = (SQLRETURN)SQLSetParam(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
 _outv = SWIG_From_short((short)(result));
 if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
 @@ -8911,12 +8916,12 @@ static octave_value_list _wrap_SQLGetDat
 SQLHSTMT arg1 = (SQLHSTMT) 0 ;
 SQLUSMALLINT arg2 ;
 std::string *arg3 = (std::string *) 0 ;
 - SQLINTEGER *arg4 = (SQLINTEGER *) 0 ;
 + SQLLEN *arg4 = (SQLLEN *) 0 ;
 int res1 ;
 unsigned short val2 ;
 int ecode2 = 0 ;
 std::string tmp3 ;
 - SQLINTEGER tmp4 = 0 ;
 + SQLLEN tmp4 = 0 ;
 octave_value_list _out;
 octave_value_list *_outp=&_out;
 octave_value _outv;
 @@ -9823,7 +9828,9 @@ DEFUN_DLD (SWIG_name,args,nargout,SWIG_n
 module_ns->install_global();
 module_ns->decref();

 - link_to_global_variable(curr_sym_tab->lookup(SWIG_name_d,true));
 + symbol_table::varref(SWIG_name_d);
 + symbol_table::mark_global(SWIG_name_d);
 +
 set_global_value(SWIG_name_d,Swig::swig_value_ref(module_ns));

 return octave_value_list();
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to