Update of /cvsroot/pure-data/externals/iem/pdoctave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18364
Modified Files: pdoctave_dataframe.c pdoctave_get.c write_shared_mem.cc Log Message: added octave error handling 'try' and 'catch' to pdoctave_get. So unknown variables are returned now as empty
Index: pdoctave_get.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/pdoctave/pdoctave_get.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pdoctave_get.c 25 Mar 2006 13:14:59 -0000 1.3 --- pdoctave_get.c 26 Mar 2006 12:47:03 -0000 1.4 *************** *** 51,56 **** char *cmd; cmd = pdoctget_obj->oct_command; ! strcpy(cmd, "write_shared_mem("); ! cmd += 17; strcpy(cmd, pdoctget_obj->oct_name); cmd += strlen (cmd); --- 51,56 ---- char *cmd; cmd = pdoctget_obj->oct_command; ! strcpy(cmd, "try\n write_shared_mem("); ! cmd += strlen(cmd); strcpy(cmd, pdoctget_obj->oct_name); cmd += strlen (cmd); *************** *** 58,62 **** sprintf(cmd, "%d", getSharedDataFrameId(pdoctget_obj->sdf)); cmd += strlen(cmd); ! strcpy (cmd, ")\n");
writeToOctaveStdIN (pdoctget_obj->oct_command); --- 58,69 ---- sprintf(cmd, "%d", getSharedDataFrameId(pdoctget_obj->sdf)); cmd += strlen(cmd); ! strcpy (cmd, ");\n catch\n disp("undefined variable"); write_shared_mem("); ! cmd += strlen(cmd); ! strcpy (cmd, "[],"); ! cmd +=strlen(cmd); ! sprintf(cmd, "%d", getSharedDataFrameId(pdoctget_obj->sdf)); ! cmd +=strlen(cmd); ! strcpy (cmd,");\n end\n\0"); ! post("pdoctave_get: %s",pdoctget_obj->oct_command);
writeToOctaveStdIN (pdoctget_obj->oct_command);
Index: pdoctave_dataframe.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/pdoctave/pdoctave_dataframe.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pdoctave_dataframe.c 25 Mar 2006 13:14:59 -0000 1.2 --- pdoctave_dataframe.c 26 Mar 2006 12:47:03 -0000 1.3 *************** *** 208,212 **** int sleepUntilReadUnBlocked (SharedDataFrame *sdf) { ! alarm(MAX_SLEEP_TIME); while ((sdf->block_for_read!=0)&&scheduling_ok) sched_yield(); --- 208,212 ---- int sleepUntilReadUnBlocked (SharedDataFrame *sdf) { ! //alarm(MAX_SLEEP_TIME); while ((sdf->block_for_read!=0)&&scheduling_ok) sched_yield(); *************** *** 216,220 **** int sleepUntilReadBlocked (SharedDataFrame *sdf) { ! alarm(MAX_SLEEP_TIME); while ((sdf->block_for_read==0)&&scheduling_ok) sched_yield(); --- 216,220 ---- int sleepUntilReadBlocked (SharedDataFrame *sdf) { ! //alarm(MAX_SLEEP_TIME); while ((sdf->block_for_read==0)&&scheduling_ok) sched_yield(); *************** *** 224,228 **** int sleepUntilWriteUnBlocked (SharedDataFrame *sdf) { ! alarm(MAX_SLEEP_TIME); while ((sdf->block_for_write!=0)&&scheduling_ok) sched_yield(); --- 224,228 ---- int sleepUntilWriteUnBlocked (SharedDataFrame *sdf) { ! //alarm(MAX_SLEEP_TIME); while ((sdf->block_for_write!=0)&&scheduling_ok) sched_yield(); *************** *** 231,235 **** int sleepUntilWriteBlocked (SharedDataFrame *sdf) { ! alarm(MAX_SLEEP_TIME); while ((sdf->block_for_write==0)&&scheduling_ok) sched_yield(); --- 231,235 ---- int sleepUntilWriteBlocked (SharedDataFrame *sdf) { ! //alarm(MAX_SLEEP_TIME); while ((sdf->block_for_write==0)&&scheduling_ok) sched_yield();
Index: write_shared_mem.cc =================================================================== RCS file: /cvsroot/pure-data/externals/iem/pdoctave/write_shared_mem.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** write_shared_mem.cc 25 Mar 2006 13:14:59 -0000 1.3 --- write_shared_mem.cc 26 Mar 2006 12:47:03 -0000 1.4 *************** *** 68,71 **** --- 68,73 ---- if (args(0).is_empty()) { pdtype = UNKNOWN; + unBlockForWriting (sdf); + freeSharedDataFrame (&sdf); return octave_value(); }