Update of /cvsroot/easycalc/PPCport/core/mlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26731 Modified Files: calcDB.cpp display.cpp history.cpp konvert.cpp matrix.cpp specfun.cpp Added Files: txtask.cpp txtask.h Log Message: 1.25b --- NEW FILE: txtask.h --- /* * $Id: txtask.h,v 1.1 2009/11/02 17:24:39 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2000 Ondrej Palkovsky * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #ifndef _TXTASK_H_ #define _TXTASK_H_ #define TXTASK_ASK 1200 CError txtask_ask(Functype *func, CodeStack *stack); #endif Index: matrix.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/matrix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** matrix.cpp 17 Oct 2009 13:48:34 -0000 1.1 --- matrix.cpp 2 Nov 2009 17:24:39 -0000 1.2 *************** *** 19,29 **** * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. ! * * You can contact me at 'on...@pe...'. * * 2002-07-28 - John Hodapp <bi...@em...> ! * Added routines QRQ and QRR for QR Factorizaton of MXN Matrix * 2002-08-11 - John Hodapp <bi...@em...> ! * Added routines QRS to solve Polynomial Ax=b for vector x * using QR routine. Requires room for x (can be set to zeros) [...2331 lines suppressed...] ! return list_func(func,stack); ! if (type == cmatrix) ! return cmatrix_dim(func,stack); ! err = stack_get_val(stack,&m,matrix); ! if (err) ! return err; ! ! result = list_new(2); ! result->item[0].imag = result->item[1].imag = 0.0; ! result->item[0].real = m->rows; ! result->item[1].real = m->cols; ! ! err = stack_add_val(stack,&result,list); ! ! list_delete(result); ! matrix_delete(m); ! return err; } Index: specfun.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/specfun.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** specfun.cpp 17 Oct 2009 13:48:34 -0000 1.1 --- specfun.cpp 2 Nov 2009 17:24:39 -0000 1.2 *************** *** 431,433 **** return(p); } - --- 431,432 ---- Index: display.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/display.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** display.cpp 17 Oct 2009 13:48:34 -0000 1.5 --- display.cpp 2 Nov 2009 17:24:39 -0000 1.6 *************** *** 95,99 **** TCHAR *result; ! result = (TCHAR *) MemPtrNew((dispPrefs.decPoints+64)*sizeof(TCHAR)); /* The ipart shouldn't be more then 10 */ fp_print_double(result,number); --- 95,99 ---- TCHAR *result; ! result = (TCHAR *) MemPtrNew((dispPrefs.decPoints+64)*sizeof(TCHAR)); /* The ipart shouldn't be more than 10 */ fp_print_double(result,number); Index: history.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/history.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** history.cpp 17 Oct 2009 13:48:34 -0000 1.3 --- history.cpp 2 Nov 2009 17:24:39 -0000 1.4 *************** *** 35,39 **** #include "history.h" #include "display.h" ! #include "dbutil.h" static DmOpenRef dbRef; --- 35,39 ---- #include "history.h" #include "display.h" ! #include "compat/dbutil.h" static DmOpenRef dbRef; Index: konvert.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/konvert.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** konvert.cpp 17 Oct 2009 13:48:34 -0000 1.5 --- konvert.cpp 2 Nov 2009 17:24:39 -0000 1.6 *************** *** 172,176 **** {_T("fin_fv"),MATH_FINFV,math_financial,6}, {_T("fin_pmt"),MATH_FINPMT,math_financial,6}, ! // TODO {_T("ask"),TXTASK_ASK,txtask_ask,0}, {_T("gcd"), MATH_GCD, math_gcd, 0, true, true}, {_T("lcm"), MATH_LCM, math_gcd, 0, true, true}, --- 172,176 ---- {_T("fin_fv"),MATH_FINFV,math_financial,6}, {_T("fin_pmt"),MATH_FINPMT,math_financial,6}, ! {_T("ask"),TXTASK_ASK,txtask_ask,0}, {_T("gcd"), MATH_GCD, math_gcd, 0, true, true}, {_T("lcm"), MATH_LCM, math_gcd, 0, true, true}, Index: calcDB.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/calcDB.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** calcDB.cpp 17 Oct 2009 13:48:34 -0000 1.5 --- calcDB.cpp 2 Nov 2009 17:24:39 -0000 1.6 *************** *** 31,35 **** #include "calcDB.h" #include "stack.h" ! #include "dbutil.h" static DmOpenRef gDB; --- 31,35 ---- #include "calcDB.h" #include "stack.h" ! #include "compat/dbutil.h" static DmOpenRef gDB; *************** *** 196,199 **** --- 196,201 ---- StrCopy(record->u.stack.header.param_name,parameter_name); + // Mapi: Fix ?? + // Or Microsoft compiler isn't handling that one the same way than Palm app compilers // ptr = (byte *) &(record->u.stack.data); ptr = (byte *) (record->u.stack.data); --- NEW FILE: txtask.cpp --- /* * $Id: txtask.cpp,v 1.1 2009/11/02 17:24:39 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 2002 Ondrej Palkovsky * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * You can contact me at 'on...@pe...'. */ #include "stdafx.h" #include "compat/PalmOS.h" #include "compat/segment.h" //#include "calcrsc.h" #include "konvert.h" #include "core/calc.h" #include "funcs.h" #include "display.h" #include "stack.h" #include "txtask.h" #include "system - UI/EasyCalc.h" CError txtask_ask (Functype *func, CodeStack *stack) { t_asktxt_param param; TCHAR *title, *text = NULL; CError err; Trpn tmpitem; CodeStack *tmpstack; Boolean res = 0; if (func->paramcount == 1) { /* Do not show dialog on graphs */ if (DisableInput) return (c_interrupted); err = stack_get_val(stack, &title, string); if (err) return (err); } else if (func->paramcount == 2) { tmpitem = stack_pop(stack); err = stack_get_val(stack, &title, string); if (err) { rpn_delete(tmpitem); return (err); } /* Return default value if graphing */ if (DisableInput) { MemPtrFree(title); stack_push(stack, tmpitem); return (c_noerror); } /* If it is variable, try to eval it, if it doesn't exist, * ignore it */ if (tmpitem.type==variable) err = rpn_eval_variable(&tmpitem, tmpitem); if (!err) text = display_default(tmpitem, true); rpn_delete(tmpitem); } else return (c_badargcount); param.asktxt = title; param.defaultvalue = text; res = popupAskTxt(¶m); MemPtrFree(text); if (res) { text = param.answertxt; if (!text) FrmAlertMain(altCompute); else { tmpstack = text_to_stack(text,&err); if (!err) { err = stack_compute(tmpstack); if (!err) tmpitem = stack_pop(tmpstack); stack_delete(tmpstack); } if (err) alertErrorMessage(err); } MemPtrFree(text); } MemPtrFree(title); if (res) { stack_push(stack, tmpitem); return (c_noerror); } return (c_interrupted); } |