Changeset: 814fd62758aa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=814fd62758aa
Modified Files:
        monetdb5/modules/mal/rapi.c
Branch: RIntegration
Log Message:

actually returning something now


diffs (64 lines):

diff --git a/monetdb5/modules/mal/rapi.c b/monetdb5/modules/mal/rapi.c
--- a/monetdb5/modules/mal/rapi.c
+++ b/monetdb5/modules/mal/rapi.c
@@ -198,23 +198,18 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
        for (i = 0; i < pci->retc; i++) {
                SEXP ret_col = VECTOR_ELT(retval, i);
                SEXPTYPE ret_type = TYPEOF(ret_col);
+               int *ret = (int *)getArgReference(stk, pci, i);
+
                cnt = (BUN)ret_rows;
 
 
-               sprintf(buf, "ret%d", i);
-               args[i] = GDKstrdup(buf);
-
-
                //do something with it
                if (isaBatType(getArgType(mb,pci,i))) {
                        // hand over the vector into a BAT
                        switch (ATOMstorage(getTailType(getArgType(mb,pci,i)))) 
{
-                       case TYPE_bte:
-                               b = BATnew(TYPE_oid, TYPE_int, cnt);
-                               break;
                        case TYPE_int:
                        {       int *p, prev;
-                               b = BATnew(TYPE_oid, TYPE_int, cnt);
+                               b = BATnew(TYPE_void, TYPE_int, cnt);
                            BATseqbase(b, 0);
                                b->T->nil = 0;
                                b->T->nonil = 1;
@@ -252,11 +247,13 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
                                        }
                                        prev = *p;
                                }
+                               *ret = b->batCacheid;
                                break;
                        }
                        case TYPE_dbl:
                        {       double *p, prev;
-                                                       b = BATnew(TYPE_oid, 
TYPE_dbl, cnt);
+                                                       b = BATnew(TYPE_void, 
TYPE_dbl, cnt);
+
                                                    BATseqbase(b, 0);
                                                        b->T->nil = 0;
                                                        b->T->nonil = 1;
@@ -294,6 +291,8 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
                                                                }
                                                                prev = *p;
                                                        }
+
+                                                       *ret = b->batCacheid;
                                                        break;
                                                }
                        default:
@@ -310,9 +309,6 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
        MT_lock_unset(&rapiLock, "rapi.evaluate");
        // free all names variables introduced so far.
        // Beware, they still live in the R  context
-       for (i = 0; i < pci->argc; i++)
-               if (args[i])
-                       GDKfree(args[i]);
        GDKfree(args);
        // TODO: destroy R temp environment
        return msg;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to