You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(36) |
Sep
(44) |
Oct
(25) |
Nov
(2) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
(4) |
Aug
(8) |
Sep
(16) |
Oct
|
Nov
(2) |
Dec
(28) |
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(33) |
Jul
(5) |
Aug
(7) |
Sep
(9) |
Oct
(31) |
Nov
(25) |
Dec
(21) |
2011 |
Jan
(2) |
Feb
(12) |
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/easycalc/PPCport/core/mlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17665 Modified Files: display.cpp display.h funcs.cpp funcs.h history.cpp history.h konvert.cpp konvert.h stack.cpp stack.h Log Message: 2nd upload, getting closer Index: display.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/display.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** display.h 22 Jun 2009 22:04:26 -0000 1.1 --- display.h 24 Jun 2009 21:39:59 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- #define _DISPLAY_H_ + #include "Skin.h" #include "konvert.h" *************** *** 53,58 **** TCHAR * display_complex(Complex number) MLIB; TCHAR * display_integer(UInt32 number,Tbase mode) MLIB; ! TCHAR * display_default(Trpn rpn,Boolean complete) MLIB; ! TCHAR * display_list(List *list) MLIB; extern TdispPrefs dispPrefs; --- 54,59 ---- TCHAR * display_complex(Complex number) MLIB; TCHAR * display_integer(UInt32 number,Tbase mode) MLIB; ! TCHAR * display_default(Skin *skin, Trpn rpn,Boolean complete) MLIB; ! TCHAR * display_list(Skin *skin, List *list) MLIB; extern TdispPrefs dispPrefs; Index: display.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/display.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** display.cpp 22 Jun 2009 22:04:26 -0000 1.1 --- display.cpp 24 Jun 2009 21:39:59 -0000 1.2 *************** *** 27,31 **** #include "compat/PalmOS.h" #include "konvert.h" ! #include "calc.h" #include "mathem.h" #include "display.h" --- 27,31 ---- #include "compat/PalmOS.h" #include "konvert.h" ! #include "Skin.h" #include "mathem.h" #include "display.h" *************** *** 53,72 **** * ***********************************************************************/ ! char * display_complex(Complex number) { ! char *result; ! result = MemPtrNew(dispPrefs.decPoints*2+45); ! result[0] = '\0'; if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); if (number.imag > 0.0 && finite(number.imag)) ! StrCat(result,"+"); } if (number.imag != 0.0 && !isnan(number.imag)) { fp_print_double(result+StrLen(result),number.imag); ! StrCat(result,"i"); } --- 53,72 ---- * ***********************************************************************/ ! TCHAR * display_complex(Complex number) { ! TCHAR *result; ! result = (TCHAR *) MemPtrNew(dispPrefs.decPoints*2+45); ! result[0] = _T('\0'); if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); if (number.imag > 0.0 && finite(number.imag)) ! StrCat(result,_T("+")); } if (number.imag != 0.0 && !isnan(number.imag)) { fp_print_double(result+StrLen(result),number.imag); ! StrCat(result,_T("i")); } *************** *** 87,96 **** * ***********************************************************************/ ! char * display_real(double number) { ! char *result; ! result = MemPtrNew(dispPrefs.decPoints+64); /* The ipart shouldn't be more then 10 */ fp_print_double(result,number); --- 87,96 ---- * ***********************************************************************/ ! TCHAR * display_real(double number) { ! TCHAR *result; ! result = (TCHAR *) MemPtrNew(dispPrefs.decPoints+64); /* The ipart shouldn't be more then 10 */ fp_print_double(result,number); *************** *** 106,110 **** Char *result, *result1, tmp; ! result = MemPtrNew(33); /* 32 bits + '\0' */ result1 = result; /* result1 points to digits after possible '-' sign */ --- 106,110 ---- Char *result, *result1, tmp; ! result = (TCHAR *) MemPtrNew(33); /* 32 bits + '\0' */ result1 = result; /* result1 points to digits after possible '-' sign */ *************** *** 124,128 **** if ((signednum = number) < 0) { number = -number; ! *result = '-'; result1 = result + 1; } --- 124,128 ---- if ((signednum = number) < 0) { number = -number; ! *result = _T('-'); result1 = result + 1; } *************** *** 133,141 **** for (i=0; number; i++, number /= base) if ((number % base) < 10) ! result1[i]='0'+(number % base); else ! result1[i]='A'+(number % base) - 10; ! result1[i]='\0'; /* Reverse the string */ for (j = 0, i--; j < i; j++, i--) { --- 133,141 ---- for (i=0; number; i++, number /= base) if ((number % base) < 10) ! result1[i]=_T('0')+(number % base); else ! result1[i]=_T('A')+(number % base) - 10; ! result1[i]=_T('\0'); /* Reverse the string */ for (j = 0, i--; j < i; j++, i--) { *************** *** 146,223 **** if (StrLen(result) == 0) ! StrCopy(result,"0"); return result; } ! char * ! display_list(List *list) { ! char *result,*tmp; Int16 i; ! result = MemPtrNew((UInt32)(dispPrefs.decPoints*2+10)*list->size + 10); if (!result) { ! alertErrorMessage(c_memory); return NULL; } ! StrCopy(result,"["); for (i=0;i<list->size;i++) { tmp = display_complex(list->item[i]); StrCat(result,tmp); ! StrCat(result,":"); MemPtrFree(tmp); } /* Cut off the last ':' */ ! result[StrLen(result)-1] = '\0'; ! StrCat(result,"]"); return result; } ! char * display_matrix(Matrix *m) { Int16 i,j; ! char *result,*tmp; ! result = MemPtrNew((dispPrefs.decPoints+15)*m->rows*m->cols + 10); ! StrPrintF(result,"["); for (i=0;i<m->rows;i++) { ! if (i) StrCat(result,":"); ! StrCat(result,"["); for (j=0;j<m->cols;j++) { ! if (j) StrCat(result,":"); tmp = display_real(MATRIX(m,i,j)); StrCat(result,tmp); MemPtrFree(tmp); } ! StrCat(result,"]"); } ! StrCat(result,"]"); return result; } ! char * display_cmatrix(CMatrix *m) { Int16 i,j; ! char *result,*tmp; ! result = MemPtrNew((dispPrefs.decPoints+15)*m->rows*m->cols*2 + 10); ! StrPrintF(result,"["); for (i=0;i<m->rows;i++) { ! if (i) StrCat(result,":"); ! StrCat(result,"["); for (j=0;j<m->cols;j++) { ! if (j) StrCat(result,":"); tmp = display_complex(MATRIX(m,i,j)); StrCat(result,tmp); MemPtrFree(tmp); } ! StrCat(result,"]"); } ! StrCat(result,"]"); return result; } --- 146,223 ---- if (StrLen(result) == 0) ! StrCopy(result,_T("0")); return result; } ! TCHAR * ! display_list(Skin *skin, List *list) { ! TCHAR *result,*tmp; Int16 i; ! result = (TCHAR *) MemPtrNew((UInt32)(dispPrefs.decPoints*2+10)*list->size + 10); if (!result) { ! skin->alertErrorMessage(c_memory); return NULL; } ! StrCopy(result,_T("[")); for (i=0;i<list->size;i++) { tmp = display_complex(list->item[i]); StrCat(result,tmp); ! StrCat(result,_T(":")); MemPtrFree(tmp); } /* Cut off the last ':' */ ! result[StrLen(result)-1] = _T('\0'); ! StrCat(result,_T("]")); return result; } ! TCHAR * display_matrix(Matrix *m) { Int16 i,j; ! TCHAR *result,*tmp; ! result = (TCHAR *) MemPtrNew((dispPrefs.decPoints+15)*m->rows*m->cols + 10); ! StrPrintF(result,_T("[")); for (i=0;i<m->rows;i++) { ! if (i) StrCat(result,_T(":")); ! StrCat(result,_T("[")); for (j=0;j<m->cols;j++) { ! if (j) StrCat(result,_T(":")); tmp = display_real(MATRIX(m,i,j)); StrCat(result,tmp); MemPtrFree(tmp); } ! StrCat(result,_T("]")); } ! StrCat(result,_T("]")); return result; } ! TCHAR * display_cmatrix(CMatrix *m) { Int16 i,j; ! TCHAR *result,*tmp; ! result = (TCHAR *) MemPtrNew((dispPrefs.decPoints+15)*m->rows*m->cols*2 + 10); ! StrPrintF(result,_T("[")); for (i=0;i<m->rows;i++) { ! if (i) StrCat(result,_T(":")); ! StrCat(result,_T("[")); for (j=0;j<m->cols;j++) { ! if (j) StrCat(result,_T(":")); tmp = display_complex(MATRIX(m,i,j)); StrCat(result,tmp); MemPtrFree(tmp); } ! StrCat(result,_T("]")); } ! StrCat(result,_T("]")); return result; } *************** *** 239,246 **** * ***********************************************************************/ ! char * ! display_default(Trpn rpn, Boolean complete) { ! char *result; CError err; Boolean deleterpn = false; --- 239,246 ---- * ***********************************************************************/ ! TCHAR * ! display_default(Skin *skin, Trpn rpn, Boolean complete) { ! TCHAR *result; CError err; Boolean deleterpn = false; *************** *** 267,279 **** break; case string: ! result = MemPtrNew(StrLen(rpn.u.stringval)+1); StrCopy(result,rpn.u.stringval); break; case list: if (complete) ! result = display_list(rpn.u.listval); else { ! result = MemPtrNew(20); ! StrPrintF(result,"list(..%d..)",rpn.u.listval->size); } break; --- 267,279 ---- break; case string: ! result = (TCHAR *) MemPtrNew(StrLen(rpn.u.stringval)+1); StrCopy(result,rpn.u.stringval); break; case list: if (complete) ! result = display_list(skin, rpn.u.listval); else { ! result = (TCHAR *) MemPtrNew(20); ! StrPrintF(result,_T("list(..%d..)"),rpn.u.listval->size); } break; *************** *** 282,287 **** result = display_matrix(rpn.u.matrixval); else { ! result = MemPtrNew(20); ! StrPrintF(result,"matrix(%d,%d)", rpn.u.matrixval->rows,rpn.u.matrixval->cols); } --- 282,287 ---- result = display_matrix(rpn.u.matrixval); else { ! result = (TCHAR *) MemPtrNew(20); ! StrPrintF(result,_T("matrix(%d,%d)"), rpn.u.matrixval->rows,rpn.u.matrixval->cols); } *************** *** 291,296 **** result = display_cmatrix(rpn.u.cmatrixval); else { ! result = MemPtrNew(20); ! StrPrintF(result,"cmatrix(%d,%d)", rpn.u.cmatrixval->rows, rpn.u.cmatrixval->cols); --- 291,296 ---- result = display_cmatrix(rpn.u.cmatrixval); else { ! result = (TCHAR *) MemPtrNew(20); ! StrPrintF(result,_T("cmatrix(%d,%d)"), rpn.u.cmatrixval->rows, rpn.u.cmatrixval->cols); *************** *** 298,308 **** break; case funcempty: ! result = MemPtrNew(StrLen(rpn.u.funcname)+5); StrCopy(result,rpn.u.funcname); ! StrCat(result,"()"); break; default: ! result = MemPtrNew(16); ! StrCopy(result,"Unknown type."); break; } --- 298,308 ---- break; case funcempty: ! result = (TCHAR *) MemPtrNew(StrLen(rpn.u.funcname)+5); StrCopy(result,rpn.u.funcname); ! StrCat(result,_T("()")); break; default: ! result = (TCHAR *) MemPtrNew(16); ! StrCopy(result,_T("Unknown type.")); break; } Index: funcs.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/funcs.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** funcs.cpp 22 Jun 2009 22:04:26 -0000 1.1 --- funcs.cpp 24 Jun 2009 21:39:59 -0000 1.2 *************** *** 30,34 **** #include "compat/PalmOS.h" ! #include <StringMgr.h> #include "defuns.h" --- 30,34 ---- #include "compat/PalmOS.h" ! //#include <StringMgr.h> #include "defuns.h" *************** *** 38,42 **** #include "MathLib.h" #include "stack.h" ! #include "calc.h" #include "mathem.h" #include "complex.h" --- 38,42 ---- #include "MathLib.h" #include "stack.h" ! //#include "calc.h" #include "mathem.h" #include "complex.h" *************** *** 58,82 **** Int16 func_argcount; ! const char *funcInterDef[] = { /* covariance */ ! "sum((x(1)-mean(x(1)))*(x(2)-mean(x(2))))/dim(x(1))", /* corr. coefficient */ ! "cov(x(1):x(2))/(stddev(x(1):1)*stddev(x(2):1))", /* qbinomial */ ! "ibeta(x(1):x(2)-x(1)+1:x(3))", /* qbeta */ ! "1-ibeta(x(2):x(3):x(1))", /* qchisq */ ! "1-igamma(x(2)/2:x(1)/2)", /* qF */ ! "ibeta(x(3)/2:x(2)/2:x(3)/(x(3)+x(2)*x(1)))", /* qPoisson */ ! "igamma(x(1):x(2))", /* qStudentt */ ! "0.5(1+sign(x(1))*(ibeta(x(2)/2:0.5:x(2)/(x(2)+x(1)^2))-1)", /* qWeibull */ ! "exp(-(x(1)/x(2))^x(3))", /* qNormal */ ! "erfc(x/sqrt(2))/2" }; --- 58,82 ---- Int16 func_argcount; ! const TCHAR *funcInterDef[] = { /* covariance */ ! _T("sum((x(1)-mean(x(1)))*(x(2)-mean(x(2))))/dim(x(1))"), /* corr. coefficient */ ! _T("cov(x(1):x(2))/(stddev(x(1):1)*stddev(x(2):1))"), /* qbinomial */ ! _T("ibeta(x(1):x(2)-x(1)+1:x(3))"), /* qbeta */ ! _T("1-ibeta(x(2):x(3):x(1))"), /* qchisq */ ! _T("1-igamma(x(2)/2:x(1)/2)"), /* qF */ ! _T("ibeta(x(3)/2:x(2)/2:x(3)/(x(3)+x(2)*x(1)))"), /* qPoisson */ ! _T("igamma(x(1):x(2))"), /* qStudentt */ ! _T("0.5(1+sign(x(1))*(ibeta(x(2)/2:0.5:x(2)/(x(2)+x(1)^2))-1)"), /* qWeibull */ ! _T("exp(-(x(1)/x(2))^x(3))"), /* qNormal */ ! _T("erfc(x/sqrt(2))/2") }; *************** *** 138,142 **** { rpn->type=complex; ! rpn->u.cplxval = MemPtrNew(sizeof(Complex)); rpn->allocsize = sizeof(Complex); rpn->u.cplxval->real = 0.0; --- 138,142 ---- { rpn->type=complex; ! rpn->u.cplxval = (Complex *) MemPtrNew(sizeof(Complex)); rpn->allocsize = sizeof(Complex); rpn->u.cplxval->real = 0.0; *************** *** 176,200 **** const struct { ! char *name; CError (*func)(Trpn *rpn,double val); double param; }ConstTable[]={ ! {"pi",dnum_func,3.1415926535897932384}, ! {"e",dnum_func,2.7182818284590452354}, ! {"euler", dnum_func, 0.5772156649015328606}, ! {"i",i_func}, ! {"j",i_func}, ! {"T",dnum_func,1E12}, ! {"G",dnum_func,1E9}, ! {"M",dnum_func,1E6}, ! {"k",dnum_func,1E3}, ! {"m",dnum_func,1E-3}, ! {"u",dnum_func,1E-6}, ! {"n",dnum_func,1E-9}, ! {"p",dnum_func,1E-12}, ! {"f",dnum_func,1E-15}, ! {"rand",rand_func}, ! {"rNorm",rnorm_func}, ! {"now",time_func}, {NULL,NULL} }; --- 176,200 ---- const struct { ! TCHAR *name; CError (*func)(Trpn *rpn,double val); double param; }ConstTable[]={ ! {_T("pi"),dnum_func,3.1415926535897932384}, ! {_T("e"),dnum_func,2.7182818284590452354}, ! {_T("euler"), dnum_func, 0.5772156649015328606}, ! {_T("i"),i_func}, ! {_T("j"),i_func}, ! {_T("T"),dnum_func,1E12}, ! {_T("G"),dnum_func,1E9}, ! {_T("M"),dnum_func,1E6}, ! {_T("k"),dnum_func,1E3}, ! {_T("m"),dnum_func,1E-3}, ! {_T("u"),dnum_func,1E-6}, ! {_T("n"),dnum_func,1E-9}, ! {_T("p"),dnum_func,1E-12}, ! {_T("f"),dnum_func,1E-15}, ! {_T("rand"),rand_func}, ! {_T("rNorm"),rnorm_func}, ! {_T("now"),time_func}, {NULL,NULL} }; *************** *** 223,227 **** } else if (source.type == litem) { CodeStack *tstack; ! Functype *func=MemPtrNew(sizeof(*func)); UInt32 row=source.u.litemval.row; UInt32 col=source.u.litemval.col; --- 223,227 ---- } else if (source.type == litem) { CodeStack *tstack; ! Functype *func= (Functype *) MemPtrNew(sizeof(*func)); UInt32 row=source.u.litemval.row; UInt32 col=source.u.litemval.col; *************** *** 279,283 **** freeitem = true; } ! err = db_write_variable("ans",ans); if (!err) history_add_item(ans); --- 279,283 ---- freeitem = true; } ! err = db_write_variable(_T("ans"),ans); if (!err) history_add_item(ans); *************** *** 306,311 **** { CError err; ! char *name; ! char *oldname; Trpn tmp; --- 306,311 ---- { CError err; ! TCHAR *name; ! TCHAR *oldname; Trpn tmp; *************** *** 316,320 **** if (StrLen(name)>MAX_FUNCNAME) return c_badarg; ! oldname = MemPtrNew(StrLen(parameter_name)+1); StrCopy(oldname,parameter_name); StrCopy(parameter_name,name); --- 316,320 ---- if (StrLen(name)>MAX_FUNCNAME) return c_badarg; ! oldname = (TCHAR *) MemPtrNew(StrLen(parameter_name)+1); StrCopy(oldname,parameter_name); StrCopy(parameter_name,name); *************** *** 365,369 **** Boolean ! is_constant(char *name) { Int16 i; --- 365,369 ---- Boolean ! is_constant(TCHAR *name) { Int16 i; *************** *** 428,433 **** /* Handle f()=g() type of assignment */ CodeStack *newstack; ! char *origtext = NULL; ! char oldparam[MAX_FUNCNAME+1]; /* Save default parameter name */ --- 428,433 ---- /* Handle f()=g() type of assignment */ CodeStack *newstack; ! TCHAR *origtext = NULL; ! TCHAR oldparam[MAX_FUNCNAME+1]; /* Save default parameter name */ *************** *** 613,617 **** Int16 i,j; ! argarr = MemPtrNew(sizeof(*argarr) * paramcount); for (i=0;i<paramcount;i++) { argarr[i] = stack_pop(varstack); --- 613,617 ---- Int16 i,j; ! argarr = (Trpn *) MemPtrNew(sizeof(*argarr) * paramcount); for (i=0;i<paramcount;i++) { argarr[i] = stack_pop(varstack); *************** *** 656,660 **** ***********************************************************************/ CError ! text_function(char *name,Int16 paramcount,CodeStack *stack) { CError err; --- 656,660 ---- ***********************************************************************/ CError ! text_function(TCHAR *name,Int16 paramcount,CodeStack *stack) { CError err; *************** *** 693,697 **** CodeStack *myfunc; ! myfunc = text_to_stack((char *)funcInterDef[func->num],&err); if (err) return err; --- 693,697 ---- CodeStack *myfunc; ! myfunc = text_to_stack((TCHAR *)funcInterDef[func->num],&err); if (err) return err; *************** *** 832,836 **** Complex_gon tmp; CError err; ! char *res; err=stack_get_val(stack,&arg,complex); --- 832,836 ---- Complex_gon tmp; CError err; ! TCHAR *res; err=stack_get_val(stack,&arg,complex); *************** *** 840,860 **** tmp = cplx_to_gon(arg); if (func->num == FUNC_GONIO) { ! res = MemPtrNew(MAX_FP_NUMBER*2+10); fp_print_double(res,tmp.r); ! StrCat(res,"e^("); fp_print_double(res+StrLen(res),tmp.angle); ! StrCat(res,"i)"); } else if (func->num == FUNC_TOCIS) { tmp.angle = math_rad_to_user(tmp.angle); ! res = MemPtrNew(MAX_FP_NUMBER*2+20); fp_print_double(res,tmp.r); ! StrCat(res,"(cos("); fp_print_double(res+StrLen(res),tmp.angle); ! StrCat(res,")+i*sin("); fp_print_double(res+StrLen(res),tmp.angle); ! StrCat(res,"))"); } else --- 840,860 ---- tmp = cplx_to_gon(arg); if (func->num == FUNC_GONIO) { ! res = (TCHAR *) MemPtrNew(MAX_FP_NUMBER*2+10); fp_print_double(res,tmp.r); ! StrCat(res,_T("e^(")); fp_print_double(res+StrLen(res),tmp.angle); ! StrCat(res,_T("i)")); } else if (func->num == FUNC_TOCIS) { tmp.angle = math_rad_to_user(tmp.angle); ! res = (TCHAR *) MemPtrNew(MAX_FP_NUMBER*2+20); fp_print_double(res,tmp.r); ! StrCat(res,_T("(cos(")); fp_print_double(res+StrLen(res),tmp.angle); ! StrCat(res,_T(")+i*sin(")); fp_print_double(res+StrLen(res),tmp.angle); ! StrCat(res,_T("))")); } else *************** *** 870,874 **** { double arg; ! char *res,*tmp; CError err; --- 870,874 ---- { double arg; ! TCHAR *res,*tmp; CError err; *************** *** 880,892 **** return c_badarg; ! res = MemPtrNew(MAX_FP_NUMBER+20); tmp = res; if (func->num==FUNC_RADIAN) { fp_print_double(res,arg/M_PIl); ! StrCat(res,"pi"); } else if (func->num==FUNC_DEGREE || func->num == FUNC_DEGREE2) { if (arg<0) { ! *tmp++='-'; arg=-arg; } --- 880,892 ---- return c_badarg; ! res = (TCHAR *) MemPtrNew(MAX_FP_NUMBER+20); tmp = res; if (func->num==FUNC_RADIAN) { fp_print_double(res,arg/M_PIl); ! StrCat(res,_T("pi")); } else if (func->num==FUNC_DEGREE || func->num == FUNC_DEGREE2) { if (arg<0) { ! *tmp++=_T('-'); arg=-arg; } *************** *** 896,911 **** fp_print_double(tmp,trunc(arg+1E-12)); tmp+=StrLen(tmp); ! *tmp++='°'; if (arg-trunc(arg)<1E-15) ! StrCopy(tmp,"0\'"); else { if (func->num == FUNC_DEGREE) { fp_print_double(tmp,trunc(60*(arg-trunc(arg+1E-12))+1E-12)); tmp+=StrLen(tmp); ! *tmp++='\''; fp_print_double(tmp,60*(arg*60-trunc(arg*60+1E-12))); } else { /* FUNC_DEGREE2 */ fp_print_double(tmp,60*(arg-trunc(arg+1E-12))+1E-12); ! StrCat(tmp,"'"); } } --- 896,911 ---- fp_print_double(tmp,trunc(arg+1E-12)); tmp+=StrLen(tmp); ! *tmp++=_T('°'); if (arg-trunc(arg)<1E-15) ! StrCopy(tmp,_T("0\'")); else { if (func->num == FUNC_DEGREE) { fp_print_double(tmp,trunc(60*(arg-trunc(arg+1E-12))+1E-12)); tmp+=StrLen(tmp); ! *tmp++=_T('\''); fp_print_double(tmp,60*(arg*60-trunc(arg*60+1E-12))); } else { /* FUNC_DEGREE2 */ fp_print_double(tmp,60*(arg-trunc(arg+1E-12))+1E-12); ! StrCat(tmp,_T("'")); } } *************** *** 934,938 **** ***********************************************************************/ Boolean ! varfunc_name_ok(char *name,rpntype type) { Int16 i; --- 934,938 ---- ***********************************************************************/ Boolean ! varfunc_name_ok(TCHAR *name,rpntype type) { Int16 i; Index: history.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core/mlib/history.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** history.cpp 22 Jun 2009 22:04:26 -0000 1.1 --- history.cpp 24 Jun 2009 21:39:59 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- #include "compat/PalmOS.h" + #include "Skin.h" #include <string.h> |
From: Mapi B. <ma...@us...> - 2009-06-24 21:39:37
|
Update of /cvsroot/easycalc/PPCport/compat In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17597 Modified Files: dbutil.cpp PalmOS.h Log Message: 2nd upload, getting closer Index: PalmOS.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/compat/PalmOS.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PalmOS.h 22 Jun 2009 21:57:16 -0000 1.1 --- PalmOS.h 24 Jun 2009 21:39:34 -0000 1.2 *************** *** 35,42 **** #define IndexedColorType int ! #define StrCopy wcscpy ! #define StrLen wcslen ! #define StrNCompare wcsncmp ! #define StrCompare wcscmp #define MemPtrNew malloc --- 35,44 ---- #define IndexedColorType int ! #define StrCopy _tcscpy ! #define StrLen _tcslen ! #define StrNCompare _tcsncmp ! #define StrCompare _tcscmp ! #define StrCat _tcscat ! #define StrPrintF _stprintf #define MemPtrNew malloc |
Update of /cvsroot/easycalc/PPCport In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17473 Modified Files: ansops.h calcrsc.h chkstack.h EasyCalc.vcproj grprefs.h Main.cpp Main.h prefs.h varmgr.h Log Message: 2nd upload, getting closer Index: EasyCalc.vcproj =================================================================== RCS file: /cvsroot/easycalc/PPCport/EasyCalc.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EasyCalc.vcproj 22 Jun 2009 21:53:07 -0000 1.3 --- EasyCalc.vcproj 24 Jun 2009 21:38:50 -0000 1.4 *************** *** 459,466 **** --- 459,474 ---- > <File + RelativePath=".\core\mlib\calcDB.cpp" + > + </File> + <File RelativePath=".\core\mlib\display.cpp" > </File> <File + RelativePath=".\core\mlib\fp.cpp" + > + </File> + <File RelativePath=".\core\mlib\funcs.cpp" > *************** *** 538,545 **** > <File - RelativePath=".\include\calcDB.h" - > - </File> - <File RelativePath=".\include\cmatrix.h" > --- 546,549 ---- *************** *** 558,565 **** </File> <File - RelativePath=".\include\fp.h" - > - </File> - <File RelativePath=".\include\integ.h" > --- 562,565 ---- *************** *** 638,641 **** --- 638,645 ---- </File> <File + RelativePath=".\compat\FloatManager.h" + > + </File> + <File RelativePath=".\compat\Lang.h" > *************** *** 657,664 **** --- 661,676 ---- > <File + RelativePath=".\core\mlib\calcDB.h" + > + </File> + <File RelativePath=".\core\mlib\display.h" > </File> <File + RelativePath=".\core\mlib\fp.h" + > + </File> + <File RelativePath=".\core\mlib\funcs.h" > |
From: Mapi B. <ma...@us...> - 2009-06-22 22:26:51
|
Update of /cvsroot/easycalc/PPCport/mlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26747 Removed Files: history.cpp konvert.cpp stack.cpp Log Message: 2nd upload, getting closer --- stack.cpp DELETED --- --- history.cpp DELETED --- --- konvert.cpp DELETED --- |
From: Mapi B. <ma...@us...> - 2009-06-22 22:25:22
|
Update of /cvsroot/easycalc/PPCport/skins In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26596 Removed Files: EasyCalc.gif EasyCalc.layout Log Message: 2nd upload, getting closer --- EasyCalc.layout DELETED --- --- EasyCalc.gif DELETED --- |
From: Mapi B. <ma...@us...> - 2009-06-22 22:23:38
|
Update of /cvsroot/easycalc/PPCport/include In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26315 Removed Files: display.h funcs.h history.h konvert.h PalmOS.h stack.h Log Message: 2nd upload, getting closer --- display.h DELETED --- --- PalmOS.h DELETED --- --- funcs.h DELETED --- --- history.h DELETED --- --- konvert.h DELETED --- --- stack.h DELETED --- |
From: Mapi B. <ma...@us...> - 2009-06-22 22:12:13
|
Update of /cvsroot/easycalc/PPCport In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25054 Added Files: EasyCalc.vcproj.CLIENT5.Admin.user Log Message: 2nd upload, getting closer --- NEW FILE: EasyCalc.vcproj.CLIENT5.Admin.user --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioUserFile ProjectType="Visual C++" Version="9,00" ShowAllFiles="false" > <Configurations> <Configuration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" > <DebugSettings Command="$(TargetPath)" WorkingDirectory="" CommandArguments="" Attach="false" DebuggerType="3" Remote="1" RemoteMachine="CLIENT5" RemoteCommand="" HttpUrl="" PDBPath="" SQLDebugging="" Environment="" EnvironmentMerge="true" DebuggerFlavor="5" MPIRunCommand="" MPIRunArguments="" MPIRunWorkingDirectory="" ApplicationCommand="" ApplicationArguments="" ShimCommand="" MPIAcceptMode="" MPIAcceptFilter="" /> <DeploymentTool DeploymentDevice="25D984D9-0DFE-4DB1-A5A0-9A4F660BF2CE" /> <DebuggerTool RemoteExecutable="" Arguments="" /> </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" > <DebugSettings Command="$(TargetPath)" WorkingDirectory="" CommandArguments="" Attach="false" DebuggerType="3" Remote="1" RemoteMachine="CLIENT5" RemoteCommand="" HttpUrl="" PDBPath="" SQLDebugging="" Environment="" EnvironmentMerge="true" DebuggerFlavor="5" MPIRunCommand="" MPIRunArguments="" MPIRunWorkingDirectory="" ApplicationCommand="" ApplicationArguments="" ShimCommand="" MPIAcceptMode="" MPIAcceptFilter="" /> <DeploymentTool DeploymentDevice="d1a7b239-28d5-4485-9b8c-5764e3dc79b6" /> <DebuggerTool RemoteExecutable="" Arguments="" /> </Configuration> <Configuration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" > <DebugSettings Command="$(TargetPath)" WorkingDirectory="" CommandArguments="" Attach="false" DebuggerType="3" Remote="1" RemoteMachine="CLIENT5" RemoteCommand="" HttpUrl="" PDBPath="" SQLDebugging="" Environment="" EnvironmentMerge="true" DebuggerFlavor="5" MPIRunCommand="" MPIRunArguments="" MPIRunWorkingDirectory="" ApplicationCommand="" ApplicationArguments="" ShimCommand="" MPIAcceptMode="" MPIAcceptFilter="" /> <DeploymentTool DeploymentDevice="25D984D9-0DFE-4DB1-A5A0-9A4F660BF2CE" /> <DebuggerTool RemoteExecutable="" Arguments="" /> </Configuration> <Configuration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" > <DebugSettings Command="$(TargetPath)" WorkingDirectory="" CommandArguments="" Attach="false" DebuggerType="3" Remote="1" RemoteMachine="CLIENT5" RemoteCommand="" HttpUrl="" PDBPath="" SQLDebugging="" Environment="" EnvironmentMerge="true" DebuggerFlavor="5" MPIRunCommand="" MPIRunArguments="" MPIRunWorkingDirectory="" ApplicationCommand="" ApplicationArguments="" ShimCommand="" MPIAcceptMode="" MPIAcceptFilter="" /> <DeploymentTool DeploymentDevice="d1a7b239-28d5-4485-9b8c-5764e3dc79b6" /> <DebuggerTool RemoteExecutable="" Arguments="" /> </Configuration> </Configurations> </VisualStudioUserFile> |
From: Mapi B. <ma...@us...> - 2009-06-22 22:12:08
|
Update of /cvsroot/easycalc/PPCport/system - UI In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25108/system - UI Log Message: Directory /cvsroot/easycalc/PPCport/system - UI added to the repository |
Update of /cvsroot/easycalc/PPCport In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24734 Removed Files: core_display.h core_globals.cpp core_globals.h DataManager.cpp DataManager.h dbutil.cpp EasyCalc.cpp EasyCalc.h EasyCalc.ico EasyCalcppc.rc EasyCalcppc.rc2 resourceppc.h result.cpp result.h shell_loadimage.cpp shell_loadimage.h Skin.cpp Skin.h StateManager.cpp StateManager.h stdafx.cpp stdafx.h Log Message: 2nd upload, getting closer --- EasyCalc.h DELETED --- --- EasyCalc.cpp DELETED --- --- Skin.h DELETED --- --- StateManager.cpp DELETED --- --- StateManager.h DELETED --- --- dbutil.cpp DELETED --- --- stdafx.h DELETED --- --- stdafx.cpp DELETED --- --- core_globals.h DELETED --- --- result.h DELETED --- --- shell_loadimage.cpp DELETED --- --- DataManager.h DELETED --- --- resourceppc.h DELETED --- --- core_globals.cpp DELETED --- --- EasyCalcppc.rc DELETED --- --- shell_loadimage.h DELETED --- --- Skin.cpp DELETED --- --- DataManager.cpp DELETED --- --- EasyCalcppc.rc2 DELETED --- --- core_display.h DELETED --- --- EasyCalc.ico DELETED --- --- result.cpp DELETED --- |
From: Mapi B. <ma...@us...> - 2009-06-22 22:07:33
|
Update of /cvsroot/easycalc/PPCport In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24451 Removed Files: core_display.cpp Log Message: 2nd upload, getting closer --- core_display.cpp DELETED --- |
From: Mapi B. <ma...@us...> - 2009-06-22 22:06:07
|
Update of /cvsroot/easycalc/PPCport/langs/merge In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24230/merge Added Files: lang.rcp Log Message: 2nd upload, getting closer --- NEW FILE: lang.rcp --- /* $Id: cs.rcp,v 1.31 2007/07/28 02:52:13 tvoverbe Exp $ */ TRANSLATION "cs" BEGIN "$$OK" = "OK" "$$CANCEL" = "Storno" /************************************************** * PREFERENCES (19) * **************************************************/ "$$PREFERENCES TITLE" = "Nastavení" "$$RADIAN" = "Radiány" "$$DEGREE" = "Stupnì" "$$GRAD" = "Grady" "$$DECIMAL" = "10ková" "$$BINARY" = "2ková" [...4415 lines suppressed...] "f1 and f2" /**************************************************/ "$$SOLVERHELP" = "The Solver is a tool, that helps you store equations "\ "and formulas and compute results in a convinient way. "\ "Create a new worksheet or select existing one from the drop-down "\ "menu. When the worksheet is selected, you can type in either formula "\ "(e.g. pi*r^2) or equation (e.g. x^2=x+2). Then tap the 'Update' "\ "button and the list of variables gets updated. If you wrote in formula, "\ "set up the variables and tap button 'Calculate'. If you entered equation, "\ "select the variable you want to solve and press button 'Solve'.\n\n"\ "You may annotate the function and the variables. Press the 'Note' button "\ "and add a note. If you start a new line with a name of variable and colon "\ "(e.g. 't: Time'), the rest of the line is treated as a description of the "\ "variable and shown to you when you select the variable in the list.\n\n"\ "The equation solving internally uses fzero() function, you can modify the "\ "parameters by tapping the 'Options' button." END |
From: Mapi B. <ma...@us...> - 2009-06-22 22:05:41
|
Update of /cvsroot/easycalc/PPCport/discarded In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24114 Added Files: result.cpp result.h Log Message: 2nd upload, getting closer --- NEW FILE: result.cpp --- /* * $Id: result.cpp,v 1.1 2009/06/22 22:04:54 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...'. */ #include "StdAfx.h" #include "compat/PalmOS.h" #ifdef SONY_SDK #include <SonyCLIE.h> #endif #ifdef SUPPORT_DIA #include "DIA.h" #else #define HanderaAdjustFont( font ) ( font ) #endif //#include "clie.h" #include "calcrsc.h" #include "konvert.h" #include "stack.h" #include "funcs.h" #include "defuns.h" #include "result.h" #include "prefs.h" #include "display.h" #include "ansops.h" //#include "calc.h" #include "fp.h" //#include "lstedit.h" //#include "mtxedit.h" #define BOLDRES 1 /* This handle gets freed from the PalmOS at the end, * or it would have to be called from some other routine than AppHandler */ WinHandle txtWindow = NULL; Coord position; RectangleType resultBounds; /*********************************************************************** * * FUNCTION: result_popup * * DESCRIPTION: Popup a list with operations related to the result field * * PARAMETERS: None * * RETURN: None * ***********************************************************************/ void result_popup(void) { } /*********************************************************************** * * FUNCTION: result_copy * * DESCRIPTION: Copy contents of Result field to clipboard * * PARAMETERS: None * * RETURN: None * ***********************************************************************/ void result_copy(void) { } /*********************************************************************** * * FUNCTION: result_set * * DESCRIPTION: set new result to display, automatically convert * given item * * PARAMETERS: Trpn item - the object to display * * RETURN: None * ***********************************************************************/ void result_set(Trpn item) IFACE; void result_set(Trpn item) { } /*********************************************************************** * * FUNCTION: result_set_text * * DESCRIPTION: set text result on display * * PARAMETERS: text - text to display * type - type of the displayed text * * RETURN: None * ***********************************************************************/ void result_set_text(TCHAR *text,rpntype type) IFACE; void result_set_text(TCHAR *text,rpntype type) { } /*********************************************************************** * * FUNCTION: result_set_pow * * DESCRIPTION: set formatted text on display, * DOESN'T CHANGE ANSTYPE! * * PARAMETERS: text - text to display * * RETURN: None * ***********************************************************************/ void result_set_pow(TCHAR *text) IFACE; void result_set_pow(TCHAR *text) { } /*********************************************************************** * * FUNCTION: result_init * * DESCRIPTION: Initialize resultField gadget, allocate txtWindow * * PARAMETERS: id - resource id of the gadget * * RETURN: None * ***********************************************************************/ void result_init(Int16 id) IFACE; void result_init(Int16 id) { UInt16 err; UInt16 size=0; Int16 version; void *prefData; Coord dx, dy; FormType *frm = FrmGetActiveForm(); FrmGetObjectBounds(frm, FrmGetObjectIndex(frm, id), &resultBounds); resultBounds.topLeft.x *= gSonyFactor; resultBounds.topLeft.y *= gSonyFactor; resultBounds.extent.x *= gSonyFactor; resultBounds.extent.y *= gSonyFactor; if (gHrMode == hrPalm) { WinHandle oldwin; UInt16 save; /* make sure we have a valid draw window */ oldwin = WinSetDrawWindow(WinGetDisplayWindow()); save = WinSetCoordinateSystem(kCoordinatesNative); dx = WinScaleCoord(resultBounds.extent.x, true); dy = WinScaleCoord(resultBounds.extent.y, true); WinSetCoordinateSystem(save); WinSetDrawWindow(oldwin); } else { dx = resultBounds.extent.x; dy = resultBounds.extent.y; } if (!txtWindow) { txtWindow = clie_createoffscreenwindow(dx, dy, nativeFormat, &err); ErrFatalDisplayIf(err,"Error while creating txtWindow."); position = 0; /* Read the stored text last time used in this gadget */ version=PrefGetAppPreferences(APP_ID,PREF_RESULT,NULL,&size,false); if (version==PREF_RES_VERSION) { prefData = MemPtrNew(size); PrefGetAppPreferences(APP_ID,PREF_RESULT,prefData,&size,false); resultPrefs = *(TresultPrefs *)prefData; if (resultPrefs.formatType == plaintext) result_set_text((TCHAR *)prefData+sizeof(resultPrefs), resultPrefs.ansType); else if (resultPrefs.formatType == powtext) result_set_pow((TCHAR *)prefData+sizeof(resultPrefs)); else { result_set_text((TCHAR *)prefData+sizeof(resultPrefs), resultPrefs.ansType); resultPrefs.formatType = fmtnumber; result_print_num(displayedText); } MemPtrFree(prefData); } else result_set_text("",notype); } } /*********************************************************************** * * FUNCTION: result_destroy * * DESCRIPTION: Free all structures asociated with resultField * * PARAMETERS: None * * RETURN: None * ***********************************************************************/ void result_destroy(void) IFACE; void result_destroy(void) { void *data; if (!txtWindow) /* The gadget was not initialized */ return; WinDeleteWindow(txtWindow,false); txtWindow = NULL; data = MemPtrNew(sizeof(resultPrefs)+StrLen(displayedText)+1); *(TresultPrefs *)data = resultPrefs; StrCopy((TCHAR *)data+sizeof(resultPrefs),displayedText); PrefSetAppPreferences(APP_ID,PREF_RESULT,PREF_RES_VERSION, data,StrLen(displayedText)+1+sizeof(resultPrefs), false); MemPtrFree(data); if (displayedText) MemPtrFree(displayedText); } static Boolean larr_drawn=false,rarr_drawn=false; void result_clear_arrowflags(void) IFACE; void result_clear_arrowflags(void) { larr_drawn = rarr_drawn = false; } /*********************************************************************** * * FUNCTION: result_draw * * DESCRIPTION: Redraw a gadget, depending on the position variable * * PARAMETERS: None * * RETURN: None * ***********************************************************************/ void result_draw(void) IFACE; void result_draw(void) { RectangleType tmpbounds; MemHandle bmpRes; BitmapType *bmpPtr; Coord x, y, width,height; RectangleType re; WinHandle oldwindow; if (gHrMode == hrPalm) { UInt16 save = WinSetCoordinateSystem(kCoordinatesNative); tmpbounds.topLeft.x = WinScaleCoord(position, true); tmpbounds.topLeft.y = 0; tmpbounds.extent.x = WinScaleCoord(resultBounds.extent.x, true); tmpbounds.extent.y = WinScaleCoord(resultBounds.extent.y, true); x = WinScaleCoord(resultBounds.topLeft.x, true); y = WinScaleCoord(resultBounds.topLeft.y, true); WinSetCoordinateSystem(save); } else { tmpbounds.topLeft.x = position; tmpbounds.topLeft.y = 0; tmpbounds.extent.x = resultBounds.extent.x; tmpbounds.extent.y = resultBounds.extent.y; x = resultBounds.topLeft.x; y = resultBounds.topLeft.y; } clie_copyrectangle(txtWindow,NULL,&tmpbounds, x, y, winPaint); re.extent.x = 3; re.extent.y = 5; re.topLeft.y = resultBounds.topLeft.y/gSonyFactor+4; oldwindow = WinSetDrawWindow(txtWindow); WinGetWindowExtent(&width,&height); if (gHrMode == hrPalm) { UInt16 save = WinSetCoordinateSystem(kCoordinatesNative); width = WinUnscaleCoord(width, true); height = WinUnscaleCoord(height, true); WinSetCoordinateSystem(save); } WinSetDrawWindow(oldwindow); if (position>3*gSonyFactor && !larr_drawn) { bmpRes = DmGetResource(bitmapRsc,bmpLArrow); bmpPtr = MemHandleLock(bmpRes); clie_drawbitmap(bmpPtr, resultBounds.topLeft.x-4*gSonyFactor, resultBounds.topLeft.y+4*gSonyFactor); MemHandleUnlock(bmpRes); DmReleaseResource(bmpRes); larr_drawn = true; } if (position <=3*gSonyFactor && larr_drawn) { re.topLeft.x = resultBounds.topLeft.x/gSonyFactor-4; WinEraseRectangle(&re,0); larr_drawn = false; } if (position>=width-resultBounds.extent.x-3*gSonyFactor && rarr_drawn) { re.topLeft.x = (resultBounds.topLeft.x+resultBounds.extent.x)/gSonyFactor+1; WinEraseRectangle(&re,0); rarr_drawn = false; } if (position<width-resultBounds.extent.x-3*gSonyFactor && !rarr_drawn) { bmpRes = DmGetResource(bitmapRsc,bmpRArrow); bmpPtr = MemHandleLock(bmpRes); clie_drawbitmap(bmpPtr, resultBounds.topLeft.x+resultBounds.extent.x+1*gSonyFactor, resultBounds.topLeft.y+4*gSonyFactor); MemHandleUnlock(bmpRes); DmReleaseResource(bmpRes); rarr_drawn = true; } } /*********************************************************************** * * FUNCTION: result_track * * DESCRIPTION: track the pen movement over result gadget * * PARAMETERS: x,y - starting pen position * * RETURN: true - pen movement handled by this gadget * false - the tap wasn't for this gadget * ***********************************************************************/ Boolean result_track(Coord x,Coord y) IFACE; Boolean result_track(Coord x,Coord y) { Coord width,height; Coord oldx,oldy; Boolean penDown; Int16 diff; WinHandle oldwindow; x *= gSonyFactor; y *= gSonyFactor; oldx = x; oldy = y; if (!RctPtInRectangle(x,y,&resultBounds)) return false; #ifdef SPECFUN_ENABLED /* Popup list editor if the displayed thing is a list */ if (resultPrefs.ansType == list) { lstedit_popup_ans(); return true; } else if (resultPrefs.ansType == matrix || resultPrefs.ansType == cmatrix) { mtxedit_popup_ans(); return true; } #endif oldwindow = WinSetDrawWindow(txtWindow); WinGetWindowExtent(&width,&height); if (gHrMode == hrPalm) { UInt16 save = WinSetCoordinateSystem(kCoordinatesNative); width = WinUnscaleCoord(width, true); height = WinUnscaleCoord(height, true); WinSetCoordinateSystem(save); } WinSetDrawWindow(oldwindow); do { EvtGetPen(&x,&y,&penDown); x *= gSonyFactor; y *= gSonyFactor; if (oldx!=x && RctPtInRectangle(x,y,&resultBounds)) { diff = oldx-x; if (position+diff>=0 && position+diff+resultBounds.extent.x<=width) { position+=diff; result_draw(); } oldx = x; oldy = y; } }while(penDown); return true; } static void result_clear(Coord width) IFACE; static void result_clear(Coord width) { UInt16 err; Coord dx, dy; if (txtWindow) WinDeleteWindow(txtWindow,false); if (gHrMode == hrPalm) { WinHandle oldwin; UInt16 save; /* Make sure we have a valid draw window */ oldwin = WinSetDrawWindow(WinGetDisplayWindow()); save = WinSetCoordinateSystem(kCoordinatesNative); dx = WinScaleCoord(width, true); dy = WinScaleCoord(resultBounds.extent.y, true); WinSetCoordinateSystem(save); WinSetDrawWindow(oldwin); } else { dx = width; dy = resultBounds.extent.y; } txtWindow = clie_createoffscreenwindow(dx,dy,nativeFormat,&err); ErrFatalDisplayIf(err,"Cannot create window."); } /*********************************************************************** * * FUNCTION: result_print * * DESCRIPTION: Prints a given text on display * * PARAMETERS: None * * RETURN: None * ***********************************************************************/ static void result_print(TCHAR *text) { } /*********************************************************************** * * FUNCTION: result_print_pow * * DESCRIPTION: Formats a a^b in a nice way on the display * * PARAMETERS: text to display, should contain a '^' character * * RETURN: None * ***********************************************************************/ static void result_print_pow(TCHAR *text) { } /*********************************************************************** * * FUNCTION: result_print_num * * DESCRIPTION: Formats a generic real/int number, adds * spacing to display e.g. 1111 1111, or 100.222,333 444 * * PARAMETERS: text to display * * RETURN: None * ***********************************************************************/ static void result_print_num(TCHAR *text) { } void result_error(CError errcode) { } --- NEW FILE: result.h --- /* * $Id: result.h,v 1.1 2009/06/22 22:04:54 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 _RESULT_H_ #define _RESULT_H_ void result_init(Int16 id) IFACE; void result_destroy(void) IFACE; void result_clear_arrowflags(void) IFACE; void result_draw(void) IFACE; Boolean result_track(Coord x,Coord y) IFACE; #endif |
Update of /cvsroot/easycalc/PPCport/core/mlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24055/mlib Added Files: display.cpp display.h funcs.cpp funcs.h history.cpp history.h konvert.cpp konvert.h stack.cpp stack.h Log Message: 2nd upload, getting closer --- NEW FILE: display.h --- /* * $Id: display.h,v 1.1 2009/06/22 22:04:26 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 _DISPLAY_H_ #define _DISPLAY_H_ #include "konvert.h" typedef enum { disp_decimal=10, disp_hexa=16, disp_octal=8, disp_binary=2 }Tbase; typedef enum { disp_normal, disp_sci, disp_eng }Tdisp_mode; typedef struct { Int8 decPoints; Boolean stripZeros; Tdisp_mode mode; Tbase base; Boolean forceInteger; Boolean cvtUnits; }TdispPrefs; TCHAR * display_real(double number) MLIB; TCHAR * display_complex(Complex number) MLIB; TCHAR * display_integer(UInt32 number,Tbase mode) MLIB; TCHAR * display_default(Trpn rpn,Boolean complete) MLIB; TCHAR * display_list(List *list) MLIB; extern TdispPrefs dispPrefs; #endif --- NEW FILE: konvert.cpp --- /* * $Id: konvert.cpp,v 1.1 2009/06/22 22:04:26 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001,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, [...1179 lines suppressed...] if (IS_FUNC_1LETTER(defined_funcs[i].name[0])) (*count)++; names = (TCHAR **) MemPtrNew(*count * sizeof(*names)); for (i=0,j=0;defined_funcs[i].name[0];i++) if (IS_FUNC_1LETTER(defined_funcs[i].name[0])) names[j++]=(TCHAR *)defined_funcs[i].name; /* Shell sort the array */ for (gap = *count/2;gap > 0; gap/=2) for (i = gap;i < *count;i++) for (j=i-gap;j>=0 && StrCompare(names[j],names[j+gap])>0; j-=gap) { temp = names[j]; names[j] = names[j+gap]; names[j+gap] = temp; } return names; } --- NEW FILE: display.cpp --- /* * $Id: display.cpp,v 1.1 2009/06/22 22:04:26 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...'. */ #include "stdafx.h" #include "compat/PalmOS.h" #include "konvert.h" #include "calc.h" #include "mathem.h" #include "display.h" #include "defuns.h" #include "funcs.h" #include "prefs.h" #include "fp.h" #include "stack.h" #include "MathLib.h" TdispPrefs dispPrefs; /*********************************************************************** * * FUNCTION: display_complex * * DESCRIPTION: Return a textualy formated complex number * * NOTE; Returns a dynamically allocated structure, * it must be freed after use * * PARAMETERS: number * * RETURN: textualy formated number * ***********************************************************************/ char * display_complex(Complex number) { char *result; result = MemPtrNew(dispPrefs.decPoints*2+45); result[0] = '\0'; if (number.real != 0.0 || number.imag==0.0) { fp_print_double(result,number.real); if (number.imag > 0.0 && finite(number.imag)) StrCat(result,"+"); } if (number.imag != 0.0 && !isnan(number.imag)) { fp_print_double(result+StrLen(result),number.imag); StrCat(result,"i"); } return result; } /*********************************************************************** * * FUNCTION: double_real * * DESCRIPTION: Return a nicely formatted real number * * NOTE: Result is a dynamically allocated text! * * PARAMETERS: number * * RETURN: formatted text * ***********************************************************************/ char * display_real(double number) { char *result; result = MemPtrNew(dispPrefs.decPoints+64); /* The ipart shouldn't be more then 10 */ fp_print_double(result,number); return result; } Char * display_integer(UInt32 number, Tbase mode) { Int16 base; Int16 i, j; Int32 signednum; Char *result, *result1, tmp; result = MemPtrNew(33); /* 32 bits + '\0' */ result1 = result; /* result1 points to digits after possible '-' sign */ switch (mode) { case disp_binary: base=2; break; case disp_octal: base=8; break; case disp_hexa: base=16; break; case disp_decimal: default: /* for decimal display signed number */ if ((signednum = number) < 0) { number = -number; *result = '-'; result1 = result + 1; } base=10; break; } for (i=0; number; i++, number /= base) if ((number % base) < 10) result1[i]='0'+(number % base); else result1[i]='A'+(number % base) - 10; result1[i]='\0'; /* Reverse the string */ for (j = 0, i--; j < i; j++, i--) { tmp = result1[i]; result1[i] = result1[j]; result1[j] = tmp; } if (StrLen(result) == 0) StrCopy(result,"0"); return result; } char * display_list(List *list) { char *result,*tmp; Int16 i; result = MemPtrNew((UInt32)(dispPrefs.decPoints*2+10)*list->size + 10); if (!result) { alertErrorMessage(c_memory); return NULL; } StrCopy(result,"["); for (i=0;i<list->size;i++) { tmp = display_complex(list->item[i]); StrCat(result,tmp); StrCat(result,":"); MemPtrFree(tmp); } /* Cut off the last ':' */ result[StrLen(result)-1] = '\0'; StrCat(result,"]"); return result; } char * display_matrix(Matrix *m) { Int16 i,j; char *result,*tmp; result = MemPtrNew((dispPrefs.decPoints+15)*m->rows*m->cols + 10); StrPrintF(result,"["); for (i=0;i<m->rows;i++) { if (i) StrCat(result,":"); StrCat(result,"["); for (j=0;j<m->cols;j++) { if (j) StrCat(result,":"); tmp = display_real(MATRIX(m,i,j)); StrCat(result,tmp); MemPtrFree(tmp); } StrCat(result,"]"); } StrCat(result,"]"); return result; } char * display_cmatrix(CMatrix *m) { Int16 i,j; char *result,*tmp; result = MemPtrNew((dispPrefs.decPoints+15)*m->rows*m->cols*2 + 10); StrPrintF(result,"["); for (i=0;i<m->rows;i++) { if (i) StrCat(result,":"); StrCat(result,"["); for (j=0;j<m->cols;j++) { if (j) StrCat(result,":"); tmp = display_complex(MATRIX(m,i,j)); StrCat(result,tmp); MemPtrFree(tmp); } StrCat(result,"]"); } StrCat(result,"]"); return result; } /*********************************************************************** * * FUNCTION: display_default * * DESCRIPTION: Default displaying routine, automatically detects * type of input and formats it accordingly * * NOTE: Result is a dynamically allocated, muste be freed after use. * * PARAMETERS: rpn * complete - if true, the result can be chewed in be * the compiler and produces itself * * RETURN: formatted rpn suitable for output * ***********************************************************************/ char * display_default(Trpn rpn, Boolean complete) { char *result; CError err; Boolean deleterpn = false; if (rpn.type==variable || rpn.type == litem) { if (rpn.type == litem) deleterpn = true; err=rpn_eval_variable(&rpn,rpn); if (err) { result = print_error(err); return result; } } switch (rpn.type) { case integer: result = display_integer(rpn.u.intval,dispPrefs.base); break; case complex: result = display_complex(*rpn.u.cplxval); break; case real: result = display_real(rpn.u.realval); break; case string: result = MemPtrNew(StrLen(rpn.u.stringval)+1); StrCopy(result,rpn.u.stringval); break; case list: if (complete) result = display_list(rpn.u.listval); else { result = MemPtrNew(20); StrPrintF(result,"list(..%d..)",rpn.u.listval->size); } break; case matrix: if (complete) result = display_matrix(rpn.u.matrixval); else { result = MemPtrNew(20); StrPrintF(result,"matrix(%d,%d)", rpn.u.matrixval->rows,rpn.u.matrixval->cols); } break; case cmatrix: if (complete) result = display_cmatrix(rpn.u.cmatrixval); else { result = MemPtrNew(20); StrPrintF(result,"cmatrix(%d,%d)", rpn.u.cmatrixval->rows, rpn.u.cmatrixval->cols); } break; case funcempty: result = MemPtrNew(StrLen(rpn.u.funcname)+5); StrCopy(result,rpn.u.funcname); StrCat(result,"()"); break; default: result = MemPtrNew(16); StrCopy(result,"Unknown type."); break; } if (deleterpn) rpn_delete(rpn); return result; } --- NEW FILE: funcs.cpp --- /* * $Id: funcs.cpp,v 1.1 2009/06/22 22:04:26 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999 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, [...1139 lines suppressed...] void dummy_dummy2(void) GRAPH; void dummy_dummy2(void) { } void dummy_dummy3(void) NEWFUNC; void dummy_dummy3(void) { } void dummy_dummy4(void) MATFUNC; void dummy_dummy4(void) { } --- NEW FILE: funcs.h --- /* * $Id: funcs.h,v 1.1 2009/06/22 22:04:26 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,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 _FUNCS_H_ #define _FUNCS_H_ #define FUNC_IF 0 /* Constants as indices to funcInterDef table */ #define FUNC_COV 0 #define FUNC_CORR 1 #define FUNC_QBINOM 2 #define FUNC_QBETA 3 #define FUNC_QCHISQ 4 #define FUNC_QF 5 #define FUNC_QPOISSON 6 #define FUNC_QSTUDENTT 7 #define FUNC_QWEIBULL 8 #define FUNC_QNORMAL 9 /* Maximal depth in user functions */ #define MAX_RECURS 10 /* When the 'real' argument is zero */ #define IS_ZERO(x) (fabs(x)<1E-6) #define FUNC_EMPTY 0 #define FUNC_PLUS 1 #define FUNC_MINUS 2 #define FUNC_MULTIPLY 3 #define FUNC_DIVIDE 4 #define FUNC_POWER 5 #define FUNC_EQUAL 6 #define FUNC_NEGATE 7 #define FUNC_DISCARD 8 #define FUNC_AND 9 #define FUNC_OR 10 #define FUNC_SHL 11 #define FUNC_SHR 12 #define FUNC_X 13 #define FUNC_MOD 14 #define FUNC_XOR 15 #define FUNC_ISEQUAL 16 #define FUNC_GRTHEN 17 #define FUNC_LETHEN 18 #define FUNC_GREQ 19 #define FUNC_LEEQ 20 #define FUNC_CONJ 21 #define FUNC_ITEM 22 #define FUNC_DEGREE 1 #define FUNC_RADIAN 2 #define FUNC_GONIO 3 #define FUNC_TOCIS 4 #define FUNC_DEGREE2 5 #define RAND_NUM ((double) SysRandom(0) / (double)sysRandomMax) CError convert_real_to_string(Functype *func,CodeStack *stack) PARSER; CError convert_cplx_to_string(Functype *func,CodeStack *stack) PARSER; CError define_func(Functype *func,CodeStack *stack) PARSER; CError change_param_name(Functype *func,CodeStack *stack) PARSER; CError unset_variable(Functype *func,CodeStack *stack) PARSER; CError discard_arg(Functype *func,CodeStack *stack) PARSER; CError empty_arg(Functype *func,CodeStack *stack) PARSER; CError rpn_eval_variable(Trpn *dest,Trpn source) PARSER; CError set_ans_var(Trpn ans) PARSER; CError eval_x(Functype *func,CodeStack *stack) PARSER; CError text_function(TCHAR *name,Int16 paramcount,CodeStack *stack) PARSER; void set_func_argument(Trpn *arg,UInt16 argcount) PARSER; void decr_func_argument(void) PARSER; Boolean varfunc_name_ok(TCHAR *name,rpntype type) PARSER; CError func_get_value(CodeStack *origstack,double param, double *result, CodeStack *addparms) PARSER; CError func_get_value_cplx(CodeStack *origstack,Complex* params, UInt16 paramcount, Complex *result) PARSER; CError exec_function(CodeStack *funcstack,CodeStack *varstack, Int16 paramcount) PARSER; CError func_interdef(Functype *func,CodeStack *stack) PARSER; CError func_if(Functype *func,CodeStack *stack) PARSER; CError func_item(Functype *func, CodeStack *stack) PARSER; Boolean is_constant(TCHAR *name) PARSER; extern Boolean DisableInput; #endif --- NEW FILE: stack.cpp --- /* * $Id: stack.cpp,v 1.1 2009/06/22 22:04:26 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, [...977 lines suppressed...] * FUNCTION: stack_delete * * DESCRIPTION: Deletes existing stack and frees all associated memory * * PARAMETERS: stack * * RETURN: Nothing * ***********************************************************************/ void stack_delete(CodeStack *stack) { while (stack->size) { stack->size--; rpn_delete(stack->stack[stack->size]); } MemPtrFree(stack->stack); MemPtrFree(stack); } --- NEW FILE: history.cpp --- /* * $Id: history.cpp,v 1.1 2009/06/22 22:04:26 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...'. */ #include "StdAfx.h" #include "compat/PalmOS.h" #include <string.h> #include "calcDB.h" #include "stack.h" #include "defuns.h" #include "history.h" #include "display.h" #include "dbutil.h" static DmOpenRef dbRef; UInt16 history_total(void) MLIB; UInt16 history_total(void) { return DmNumRecords(dbRef); } void history_add_line(TCHAR *line) { tHistory *item,*newitem; UInt16 size; MemHandle newHandle; UInt16 recordNumber; size = sizeof(*item) + StrLen(line) + 1; item = (tHistory *) MemPtrNew(size); item->isrpn = false; StrCopy(item->u.text,line); recordNumber = 0; newHandle = DmNewRecord(dbRef,&recordNumber,size); newitem = (tHistory *) MemHandleLock(newHandle); DmWrite(newitem,0,item,size); MemHandleUnlock(newHandle); DmReleaseRecord(dbRef,recordNumber,true); MemPtrFree(item); } /*********************************************************************** * * FUNCTION: history_add * * DESCRIPTION: Add a record in a records database * * PARAMETERS: item - the record that should be added * * RETURN: None * ***********************************************************************/ void history_add_item(Trpn item) { dbStackItem *packitem; UInt16 size,psize; MemHandle newHandle; UInt16 recordNumber; tHistory *histitem,*newitem; packitem = rpn_pack_record(item); if (!packitem) return; size = sizeof(*histitem) + packitem->datasize; psize = sizeof(*packitem) + packitem->datasize; histitem = (tHistory *) MemPtrNew(size); if (!histitem) { MemPtrFree(packitem); return; } histitem->isrpn = true; memcpy((void *)&histitem->u.item,(void *)packitem,psize); recordNumber = 0; newHandle = DmNewRecord(dbRef,&recordNumber,size); if (!newHandle) { MemPtrFree(packitem); MemPtrFree(histitem); return; } newitem = (tHistory *) MemHandleLock(newHandle); DmWrite(newitem,0,histitem,size); MemHandleUnlock(newHandle); DmReleaseRecord(dbRef,recordNumber,true); MemPtrFree(packitem); MemPtrFree(histitem); } /*********************************************************************** * * FUNCTION: history_shrink * * DESCRIPTION: Shrink the history detabase to a defined * number of records * * PARAMETERS: How many records leave in database * * RETURN: None * ***********************************************************************/ void history_shrink(Int16 count) { Int16 i; if (DmNumRecords(dbRef)==0) return; i = DmNumRecords(dbRef)-1; while (i>=count) { DmRemoveRecord(dbRef,i--); } } /*********************************************************************** * * FUNCTION: history_get * * DESCRIPTION: Return a history record * * PARAMETERS: num - how old the item is * * RETURN: item * ***********************************************************************/ Trpn history_get_item(UInt16 num) { MemHandle recordHandle; tHistory *historyitem; Trpn result; recordHandle = DmQueryRecord(dbRef,num); historyitem = (tHistory *) MemHandleLock(recordHandle); result = rpn_unpack_record(&historyitem->u.item); MemHandleUnlock(recordHandle); return result; } TCHAR * history_get_line(UInt16 num) { MemHandle recordHandle; tHistory *historyitem; TCHAR *result; recordHandle = DmQueryRecord(dbRef,num); historyitem = (tHistory *) MemHandleLock(recordHandle); result = (TCHAR *) MemPtrNew(StrLen(historyitem->u.text) + 1); StrCopy(result,historyitem->u.text); MemHandleUnlock(recordHandle); return result; } Boolean history_isrpn(UInt16 num) { MemHandle recordHandle; tHistory *historyitem; Boolean result; recordHandle = DmQueryRecord(dbRef,num); historyitem = (tHistory *) MemHandleLock(recordHandle); result = historyitem->isrpn; MemHandleUnlock(recordHandle); return result; } /*********************************************************************** * * FUNCTION: history_command * * DESCRIPTION: This function is evaluated directly from a normal * mathematical equation * * PARAMETERS: On stack - 1 number convertible to integer * * RETURN: On stack - value from history database * ***********************************************************************/ CError history_command(Functype *func,CodeStack *stack) { CError err; UInt32 arg; if ((err=stack_get_val(stack,&arg,integer))) return err; if (arg > DmNumRecords(dbRef)) return c_badarg; if (!history_isrpn(arg)) return c_badarg; stack_push(stack,history_get_item(arg)); return c_noerror; } /*********************************************************************** * * FUNCTION: history_open * * DESCRIPTION: Open a history database * * PARAMETERS: None * * RETURN: 0 on success * ***********************************************************************/ Int16 history_open(void) { return open_db(HISTORYDBNAME, HIST_DB_VERSION, LIB_ID, DBTYPE, &dbRef); } /*********************************************************************** * * FUNCTION: history_close * * DESCRIPTION: Close a history database * * PARAMETERS: None * * RETURN: 0 on success * ***********************************************************************/ Int16 history_close(void) { history_shrink(HISTORY_RECORDS); return DmCloseDatabase(dbRef); } --- NEW FILE: history.h --- /* * $Id: history.h,v 1.1 2009/06/22 22:04:26 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 _HISTORY_H_ #define _HISTORY_H_ #define HISTORY_RECORDS 30 typedef struct { Boolean isrpn; Int16 xxxpad; union { dbStackItem item; TCHAR *text; }u; }tHistory; CError history_command(Functype *func,CodeStack *stack) MLIB; Int16 history_close(void) MLIB; Int16 history_open(void) MLIB; void history_shrink(Int16 count) MLIB; void history_add_line(TCHAR *line) MLIB; void history_add_item(Trpn item) MLIB; Boolean history_isrpn(UInt16 num) MLIB; UInt16 history_total(void) MLIB; TCHAR * history_get_line(UInt16 num) MLIB; Trpn history_get_item(UInt16 num) MLIB; #endif --- NEW FILE: konvert.h --- /* * $Id: konvert.h,v 1.1 2009/06/22 22:04:26 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,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 _konvert_h_ #define _konvert_h_ #include "segment.h" #define MAX_FUNCNAME 10 #define MAX_VARNAME 10 /* First function/variable character */ #define IS_FUNC_1LETTER(x) (((x)>='a' && (x)<='z') || (x)=='_' || (x)==(TCHAR)181 || \ ((x)>='G' && (x)<='Z')) /* Other characters, inside varname can be numbers */ #define IS_FUNC_LETTER(x) (IS_FUNC_1LETTER(x) || ((x)>='0' && (x)<='9') || \ ((x)>='A' && (x)<='Z')) typedef enum { degree, radian, grad }Ttrigo_mode; typedef enum { notype=0, integer, real, function, functext, funcempty, variable, string, /* These 2 next shouldn't be in rpn, it's temporary */ oper, discard, complex, list, matrix, litem, cmatrix }rpntype; typedef enum { c_noerror=0, c_syntax, c_badfunc, c_noarg, c_badarg, c_internal, c_badmode, c_noresult, c_divbyzero, c_notvar, c_badresult, c_deeprec, c_compimp, c_range, c_badargcount, c_baddim, c_singular, c_interrupted, c_memory, c_stacklow }CError; typedef struct { double real; double imag; }Complex; typedef struct { double r; double angle; }Complex_gon; typedef struct { Int16 offs; Int16 num; Int16 paramcount; }Functype; typedef struct { Int16 paramcount; TCHAR name[MAX_FUNCNAME+1]; }TextFunctype; typedef struct { Int16 row; Int16 col; TCHAR name[MAX_FUNCNAME+1]; }LitemType; typedef struct { UInt16 size; Complex *item; }List; #define MATRIX(m,r,c) m->item[m->cols * (r) + (c)] typedef struct { Int16 rows,cols; double *item; }Matrix; typedef struct { Int16 rows,cols; Complex *item; }CMatrix; /* item on the RPN stack */ typedef struct { rpntype type; UInt16 allocsize; /* If we should free the item or not */ union { UInt32 intval; double realval; Functype funcval; /* Internal function call */ TextFunctype textfunc; /* User defined function call */ LitemType litemval; TCHAR funcname[MAX_FUNCNAME+1]; /* Empty function */ TCHAR varname[MAX_FUNCNAME+1]; TCHAR *stringval; Complex *cplxval; TCHAR *data; List *listval; Matrix *matrixval; CMatrix *cmatrixval; }u; }Trpn; typedef struct { Boolean evalRight; Int16 priority; Int16 operpri; Trpn rpn; }Tmeq; /* stack */ typedef struct { UInt16 size; UInt16 allocated; Trpn *stack; }CodeStack; struct Tdefined_funcs { const TCHAR name[MAX_FUNCNAME+1]; Int16 funcnum; CError (*function)(Functype *func,CodeStack *stack); Int16 paramcount; Boolean listsimul; Boolean matrixsimul; }; CodeStack *text_to_stack(TCHAR *buf, CError *error); Err mlib_init_mathlib(void) MLIB; void mlib_close_mathlib(void) MLIB; TCHAR ** konvert_get_sorted_fn_list(Int16 *count); extern const struct Tdefined_funcs defined_funcs[]; extern Ttrigo_mode trigo_mode; extern TCHAR parameter_name[MAX_FUNCNAME+1]; #endif --- NEW FILE: stack.h --- /* * $Id: stack.h,v 1.1 2009/06/22 22:04:26 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 _STACK_H_ #define _STACK_H_ #include "calcDB.h" #include "segment.h" dbPackedStack * stack_pack(CodeStack *stack,Int16 *size) MLIB; CodeStack * stack_unpack(dbPackedStack *packed) MLIB; dbStackItem * rpn_pack_record(Trpn item) MLIB; Trpn rpn_unpack_record(dbStackItem *record) MLIB; void rpn_delete(Trpn item) MLIB; void rpn_duplicate(Trpn *dest,Trpn source) MLIB; CError stack_get_val(CodeStack *stack,void *arg1,rpntype reqtype) MLIB; CError stack_get_val2(CodeStack *stack,void *arg1,void *arg2,rpntype reqtype) MLIB; CError stack_add_val(CodeStack *stack,void *arg,rpntype reqtype) MLIB; CError stack_item_type(CodeStack *stack,rpntype *type,Int16 itnum) MLIB; CError stack_compute(CodeStack *instack) MLIB; Trpn stack_pop(CodeStack *stack) MLIB; void stack_push(CodeStack *stack,Trpn rpn) MLIB; CodeStack * stack_new(Int16 count) MLIB; void stack_delete(CodeStack *stack) MLIB; void stack_copy(CodeStack *dest,CodeStack *orig) MLIB; CError stack_item_type_nr(CodeStack *stack,rpntype *type,Int16 itnum) MLIB; void stack_reverse(CodeStack *stack) MLIB; double reduce_precision(double value) MLIB; void stack_fix_variables(CodeStack *stack) MLIB; #endif |
From: Mapi B. <ma...@us...> - 2009-06-22 22:05:36
|
Update of /cvsroot/easycalc/PPCport/core In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24055 Added Files: core_globals.cpp core_globals.h Log Message: 2nd upload, getting closer --- NEW FILE: core_globals.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ #ifndef CORE_GLOBALS_H #define CORE_GLOBALS_H 1 //#include "EasyCalc.h" /**********/ /* Errors */ /**********/ #define ERR_NONE 0 #define ERR_ALPHA_DATA_IS_INVALID 1 #define ERR_INSUFFICIENT_MEMORY 2 #define ERR_NOT_YET_IMPLEMENTED 3 #define ERR_OUT_OF_RANGE 4 #define ERR_DIVIDE_BY_0 5 #define ERR_INVALID_TYPE 6 #define ERR_INVALID_DATA 7 #define ERR_DIMENSION_ERROR 8 #define ERR_SIZE_ERROR 9 #define ERR_INTERNAL_ERROR 10 #define ERR_NONEXISTENT 11 #define ERR_RESTRICTED_OPERATION 12 #define ERR_YES 13 #define ERR_NO 14 #define ERR_STOP 15 #define ERR_LABEL_NOT_FOUND 16 #define ERR_NO_REAL_VARIABLES 17 #define ERR_NO_COMPLEX_VARIABLES 18 #define ERR_NO_MATRIX_VARIABLES 19 #define ERR_NO_MENU_VARIABLES 20 #define ERR_STAT_MATH_ERROR 21 #define ERR_INVALID_FORECAST_MODEL 22 #define ERR_SOLVE_INTEG_RTN_LOST 23 #define ERR_SINGULAR_MATRIX 24 #define ERR_SOLVE_SOLVE 25 #define ERR_INTEG_INTEG 26 #define ERR_RUN 27 #define ERR_INTERRUPTED 28 #define ERR_PRINTING_IS_DISABLED 29 #define ERR_INTERRUPTIBLE 30 #define ERR_NO_VARIABLES 31 /*************/ /* Key codes */ /*************/ #define NB_KEYS 37 #define KEY_SIGMA 1 #define KEY_INV 2 #define KEY_SQRT 3 #define KEY_LOG 4 #define KEY_LN 5 #define KEY_XEQ 6 #define KEY_STO 7 #define KEY_RCL 8 #define KEY_RDN 9 #define KEY_SIN 10 #define KEY_COS 11 #define KEY_TAN 12 #define KEY_ENTER 13 #define KEY_SWAP 14 #define KEY_CHS 15 #define KEY_E 16 #define KEY_BSP 17 #define KEY_UP 18 #define KEY_7 19 #define KEY_8 20 #define KEY_9 21 #define KEY_DIV 22 #define KEY_DOWN 23 #define KEY_4 24 #define KEY_5 25 #define KEY_6 26 #define KEY_MUL 27 #define KEY_SHIFT 28 #define KEY_1 29 #define KEY_2 30 #define KEY_3 31 #define KEY_SUB 32 #define KEY_EXIT 33 #define KEY_0 34 #define KEY_DOT 35 #define KEY_RUN 36 #define KEY_ADD 37 /*********************/ /* Annunciator codes */ /*********************/ #define NB_ANNUN 13 #define ANN_SHIFT 0 #define ANN_DEG 1 #define ANN_RAD 2 #define ANN_GRAD 3 #define ANN_DEC 4 #define ANN_OCT 5 #define ANN_BIN 6 #define ANN_HEX 7 #define ANN_S1 8 #define ANN_S2 9 #define ANN_S3 10 #define ANN_SG 11 #define ANN_RESMENU 12 /*********************/ /* Annunciator value */ /*********************/ #define ANNVAL_UNCH -1 #define ANNVAL_DEG 0 #define ANNVAL_RAD 1 #define ANNVAL_GRAD 2 #define ANNVAL_DEC 0 #define ANNVAL_OCT 1 #define ANNVAL_BIN 2 #define ANNVAL_HEX 3 #define ANNVAL_S1 0 #define ANNVAL_S2 1 #define ANNVAL_S3 2 #define ANNVAL_SG 3 /*********/ /* Menus */ /*********/ #define MENU_NONE -1 #define MENU_SHORTCUT -2 #define MENU_ALPHA1 0 #define MENU_ALPHA2 1 #define MENU_ALPHA_ABCDE1 2 #define MENU_ALPHA_ABCDE2 3 #define MENU_ALPHA_FGHI 4 #define MENU_ALPHA_JKLM 5 #define MENU_ALPHA_NOPQ1 6 #define MENU_ALPHA_NOPQ2 7 #define MENU_ALPHA_RSTUV1 8 #define MENU_ALPHA_RSTUV2 9 #define MENU_ALPHA_WXYZ 10 #define MENU_ALPHA_PAREN 11 #define MENU_ALPHA_ARROW 12 #define MENU_ALPHA_COMP 13 #define MENU_ALPHA_MATH 14 #define MENU_ALPHA_PUNC1 15 #define MENU_ALPHA_PUNC2 16 #define MENU_ALPHA_MISC1 17 #define MENU_ALPHA_MISC2 18 #define MENU_ST 19 #define MENU_IND_ST 20 #define MENU_IND 21 #define MENU_MODES1 22 #define MENU_MODES2 23 #define MENU_DISP 24 #define MENU_CLEAR1 25 #define MENU_CLEAR2 26 #define MENU_CONVERT1 27 #define MENU_CONVERT2 28 #define MENU_FLAGS 29 #define MENU_PROB 30 #define MENU_CUSTOM1 31 #define MENU_CUSTOM2 32 #define MENU_CUSTOM3 33 #define MENU_PGM_FCN1 34 #define MENU_PGM_FCN2 35 #define MENU_PGM_FCN3 36 #define MENU_PGM_FCN4 37 #define MENU_PGM_XCOMP0 38 #define MENU_PGM_XCOMPY 39 #define MENU_PRINT1 40 #define MENU_PRINT2 41 #define MENU_PRINT3 42 #define MENU_TOP_FCN 43 #define MENU_CATALOG 44 #define MENU_BLANK 45 #define MENU_PROGRAMMABLE 46 #define MENU_VARMENU 47 #define MENU_STAT1 48 #define MENU_STAT2 49 #define MENU_STAT_CFIT 50 #define MENU_STAT_MODL 51 #define MENU_MATRIX1 52 #define MENU_MATRIX2 53 #define MENU_MATRIX3 54 #define MENU_MATRIX_SIMQ 55 #define MENU_MATRIX_EDIT1 56 #define MENU_MATRIX_EDIT2 57 #define MENU_BASE 58 #define MENU_BASE_A_THRU_F 59 #define MENU_BASE_LOGIC 60 #define MENU_SOLVE 61 #define MENU_INTEG 62 #define MENU_INTEG_PARAMS 63 /***********************/ /* Variable data types */ /***********************/ /******************/ /* Emulator state */ /******************/ /* FLAGS * Note: flags whose names start with VIRTUAL_ are named here for reference * only; they are actually handled by virtual_flag_handler(). Setting or * clearing them in 'flags' has no effect. * Flags whose names are the letter 'f' followed by two digits have no * specified meaning according to the HP-42S manual; they are either user flags * or reserved. */ typedef union { char farray[100]; struct { char audio_enable; } f; } flags_struct; extern flags_struct flags; /****************/ /* More globals */ /****************/ extern int pending_command; extern bool mode_shift; extern bool mode_running; extern int (*mode_interruptible)(int); extern bool mode_stoppable; extern bool mode_getkey; extern int remove_program_catalog; extern int mode_plainmenu; extern int mode_transientmenu; /* Keystroke buffer - holds keystrokes received while * there is a program running. */ extern int keybuf_head; extern int keybuf_tail; extern int keybuf[16]; /*********************/ /* Utility functions */ /*********************/ #endif --- NEW FILE: core_globals.cpp --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * The name and many features come from * - EasyCalc on Palm: * * It also is reusing elements from * - Free42: Thomas Okken * for its adaptation to the PocketPC world. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ /* core_globals.cpp : contains global calc state & procedures. *****************************************************************************/ #include "stdafx.h" #include "core_globals.h" #include <stdlib.h> /* Flags */ flags_struct flags; int pending_command; bool mode_shift; bool mode_running; int (*mode_interruptible)(int) = NULL; bool mode_stoppable; bool mode_getkey; int remove_program_catalog = 0; int mode_plainmenu; int mode_transientmenu; /* Keystroke buffer - holds keystrokes received while * there is a program running. */ int keybuf_head = 0; int keybuf_tail = 0; int keybuf[16]; |
From: Mapi B. <ma...@us...> - 2009-06-22 22:04:39
|
Update of /cvsroot/easycalc/PPCport/langs/merge In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23982/merge Log Message: Directory /cvsroot/easycalc/PPCport/langs/merge added to the repository |
From: Mapi B. <ma...@us...> - 2009-06-22 22:02:22
|
Update of /cvsroot/easycalc/PPCport/discarded In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23506/discarded Log Message: Directory /cvsroot/easycalc/PPCport/discarded added to the repository |
From: Mapi B. <ma...@us...> - 2009-06-22 22:02:19
|
Update of /cvsroot/easycalc/PPCport/langs In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23519/langs Log Message: Directory /cvsroot/easycalc/PPCport/langs added to the repository |
From: Mapi B. <ma...@us...> - 2009-06-22 22:01:51
|
Update of /cvsroot/easycalc/PPCport/core/mlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23661/mlib Log Message: Directory /cvsroot/easycalc/PPCport/core/mlib added to the repository |
From: Mapi B. <ma...@us...> - 2009-06-22 21:59:46
|
Update of /cvsroot/easycalc/PPCport/core In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23480/core Log Message: Directory /cvsroot/easycalc/PPCport/core added to the repository |
From: Mapi B. <ma...@us...> - 2009-06-22 21:58:24
|
Update of /cvsroot/easycalc/PPCport/compat In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23401 Added Files: DataManager.cpp DataManager.h Lang.cpp Lang.h PalmOS.h dbutil.cpp Log Message: 2nd upload, getting closer --- NEW FILE: Lang.cpp --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ /* Lang.cpp : Lang and LibLang objects for handling language translations. *****************************************************************************/ #include "StdAfx.h" #include "compat/Lang.h" #include <locale.h> #ifdef UNICODE #define _tsetlocale _wsetlocale #else #define _tsetlocale setlocale #define mbstowcs(a,b,c) ((a == NULL) ? (strlen(b)) : ((strcpy(a,b) == NULL) ? -1 : c)) #endif #include <stdlib.h> /*------------------------------------------------------------------------------- - The Lang object Constructor and Destructor. - -------------------------------------------------------------------------------*/ Lang::Lang(const TCHAR *name) { localeInfo = NULL; langName.assign(name); // Try to set the locale with the provided string first. if ((localeInfo = _tsetlocale(LC_ALL, name)) != NULL) { } else { // Not recognized by windows. // Map using the Palm EasyCalc PilRC names if (_tcscmp(name, _T("cs")) == 0) { codePage = 1250; localeInfo = _tsetlocale(LC_ALL, _T("Czech")); } else if (_tcscmp(name, _T("de")) == 0) { codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("German")); } else if (_tcscmp(name, _T("en")) == 0) { codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("English")); } else if (_tcscmp(name, _T("fr")) == 0) { codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("French")); } else if (_tcscmp(name, _T("it")) == 0) { codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("Italian")); } else if (_tcscmp(name, _T("ja")) == 0) { codePage = 932; localeInfo = _tsetlocale(LC_ALL, _T("Japanese_Japan.932")); // This may not load correctly on western systems with Japan non installed, // so try a bypass .., which should set at least the code page correcly. if (localeInfo == NULL) { localeInfo = _tsetlocale(LC_ALL, _T(".932")); } } else if (_tcscmp(name, _T("pt")) == 0) { codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("Portuguese")); } else if (_tcscmp(name, _T("ru_koi8")) == 0) { // Note that koi8-u, for Ukrainia, is 21866 codePage = 20866; localeInfo = _tsetlocale(LC_ALL, _T("Russian_Russia.20866")); } else if (_tcscmp(name, _T("ru_win")) == 0) { codePage = 1251; localeInfo = _tsetlocale(LC_ALL, _T("Russian")); } else if (_tcscmp(name, _T("sp")) == 0) { codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("Spanish")); } if (localeInfo == NULL) { // Cannot recognize the language, use a character set by default // for converting from what is read to wide characters. codePage = 1252; localeInfo = _tsetlocale(LC_ALL, _T("English")); } } // Since the string returned by setlocale can be overwritten, save a copy localeInfo = _tcsdup(localeInfo); } Lang::~Lang(void) { langName.clear(); translation.clear(); } /*------------------------------------------------------------------------------- - Lang object methods. - -------------------------------------------------------------------------------*/ /******************************************************************************** * Insert a translation pair. * ********************************************************************************/ bool Lang::insert(const TCHAR *key, const TCHAR *value) { String s1 (key); String s2 (value); std::pair<stdext::hash_map<String,String>::iterator, bool> res; res = translation.insert(Pair(s1, s2)); return (res.second); } /******************************************************************************** * Get the text of a translation entry. * ********************************************************************************/ const TCHAR *Lang::get(TCHAR *key) { String s1 (key); stdext::hash_map<String,String>::const_iterator res; res = translation.find(s1); if (res == translation.end()) return (NULL); return (res->second.c_str()); } /*------------------------------------------------------------------------------- - The LibLang object Constructor and Destructor. - -------------------------------------------------------------------------------*/ #define SPACECHARS " \t" #define EOLCHARS "\r\n" #define ESCAPECHARS "\\" #define STRINGDELIMITERS "\"" #define ST1COMMENTCHARS "/" #define ST2COMMENTCHARS "*" #define EQUALCHARS "=" #define TRANSLATION 1 #define LANGNAME 2 #define BEGIN 3 #define STRING1_OR_END 4 #define EQUAL 6 #define STRING2 7 #define LEX_IN_NONE 0 #define LEX_IN_WORD 1 #define LEX_IN_STRING 2 #define LEX_IN_ESCAPE 3 #define LEX_END_STRING 4 #define LEX_BETWEEN_STRINGS 5 #define LEX_IN_STARTCOMMENT 6 #define LEX_IN_COMMENT 7 #define LEX_IN_ENDCOMMENT 8 #define TOK_NONE 0 #define TOK_WORD 1 #define TOK_STRING 2 #define TOK_EQUAL 3 LibLang::LibLang(FILE *langFile) { wcstr = NULL; allocLen = nbLang = 0; firstCalled = false; // Parse the lang.rcp file until EOF. // Simple parser, line oriented. // As per http://www.dtek.chalmers.se/groups/pilot/doc/pilrc.htm // TRANSLATION <Language.s> //BEGIN // <STRINGTRANSLATIONS> //END //Where <STRINGTRANSLATIONS> is one or more of: // <Original.s> = <Translated.s> //Note: a '\' at end of line means "line continued on next line". // <...> means a string between "". // /* ... */ delimit comments, which can be on multiple lines. // No nested comment support. int c, clast; int nextToken = TRANSLATION; // Start looking for TRANSLATION int token, lexState; bool complete; std::string s; std::string s1; Lang *lang = NULL; while (!feof(langFile)) { // Get a new token from the lexical "level". s.clear(); lexState = LEX_IN_NONE; // Start the lexical level in no mode token = TOK_NONE; // No lexical token recognized yet complete = false; while (!complete && (c = fgetc(langFile)) != EOF) { switch (lexState) { case LEX_IN_NONE: if ((strchr(SPACECHARS, c) != NULL) || (strchr(EOLCHARS, c) != NULL)) break; else if (strchr(STRINGDELIMITERS, c) != NULL) { // We're getting the start of a string token = TOK_STRING; lexState = LEX_IN_STRING; } else if (strchr(ST1COMMENTCHARS, c) != NULL) { // We're getting the start of a comment clast = c; lexState = LEX_IN_STARTCOMMENT; } else if (strchr(EQUALCHARS, c) != NULL) { token = TOK_EQUAL; s.append(1, c); complete = true; } else { // Anything else is a word, by default token = TOK_WORD; s.append(1, c); lexState = LEX_IN_WORD; } break; case LEX_IN_WORD: if ((strchr(SPACECHARS, c) != NULL) || (strchr(EOLCHARS, c) != NULL)) { complete = true; } else if ((strchr(STRINGDELIMITERS, c) != NULL) || (strchr(ST1COMMENTCHARS, c) != NULL) || (strchr(EQUALCHARS, c) != NULL)) { ungetc (c, langFile); // Give back the character for the next // lexical round. complete = true; } else { // Anything else is part of the word s.append(1, c); } break; case LEX_IN_STRING: if (strchr(ESCAPECHARS, c) != NULL) { // Escape character, keep the next one, // whatever it is (except end of line) s.append(1, c); lexState = LEX_IN_ESCAPE; } else if (strchr(STRINGDELIMITERS, c) != NULL) { // We're getting the end of the string lexState = LEX_END_STRING; } else if (strchr(EOLCHARS, c) != NULL) { // End of line reached, stop the string there complete = true; } else { s.append(1, c); } break; case LEX_IN_ESCAPE: if (strchr(EOLCHARS, c) != NULL) { // End of line reached, stop the string there complete = true; } else { s.append(1, c); lexState = LEX_IN_STRING; } break; case LEX_END_STRING: if (strchr(ESCAPECHARS, c) != NULL) { // Escape character, meaning the string // goes on on next line. lexState = LEX_BETWEEN_STRINGS; } else if (strchr(SPACECHARS, c) == NULL) { // Consume spaces between '"' and '\' // Not space and not '\' ungetc (c, langFile); // Give back the character for the next // lexical round. complete = true; } break; case LEX_BETWEEN_STRINGS: if (strchr(STRINGDELIMITERS, c) != NULL) { // We're getting the start of the string continuation lexState = LEX_IN_STRING; } break; case LEX_IN_STARTCOMMENT: if (strchr(ST2COMMENTCHARS, c) != NULL) { lexState = LEX_IN_COMMENT; } else { // No start of comment, so go back to a word by default s.append(1, clast); s.append(1, c); lexState = LEX_IN_WORD; } break; case LEX_IN_COMMENT: if (strchr(ST2COMMENTCHARS, c) != NULL) { lexState = LEX_IN_ENDCOMMENT; // Possible end of comment } break; case LEX_IN_ENDCOMMENT: if (strchr(ST1COMMENTCHARS, c) != NULL) { lexState = LEX_IN_NONE; // Back to normal } else if (strchr(ST2COMMENTCHARS, c) == NULL) { lexState = LEX_IN_COMMENT; // Not '*', go back to comment mode } break; } } // The lexical level is done, analyze at "grammar" level if (token != TOK_NONE) switch (nextToken) { case TRANSLATION: if (token == TOK_WORD) { const char *str = s.c_str(); char *strup = _strdup(str); _strupr(strup); if (strcmp(strup, "TRANSLATION") == 0) { nextToken = LANGNAME; } free(strup); } break; case LANGNAME: if (token == TOK_STRING) { // We've got a new language translation nextToken = BEGIN; // Create or retrieve a language object const TCHAR *langName = convert(s.c_str()); lang = (Lang *) getLang (langName); if (lang == NULL) { // Create a new one lang = new Lang (langName); insertLang(lang); } } else nextToken = TRANSLATION; break; case BEGIN: if (token == TOK_WORD) { const char *str = s.c_str(); char *strup = _strdup(str); _strupr(strup); if (strcmp(strup, "BEGIN") == 0) { nextToken = STRING1_OR_END; } else nextToken = TRANSLATION; free(strup); } else nextToken = TRANSLATION; break; case STRING1_OR_END: if (token == TOK_WORD) { const char *str = s.c_str(); char *strup = _strdup(str); _strupr(strup); if (strcmp(strup, "END") == 0) { nextToken = TRANSLATION; } free(strup); } else if (token == TOK_STRING) { s1.assign(s); nextToken = EQUAL; } break; case EQUAL: if (token == TOK_EQUAL) { nextToken = STRING2; } else nextToken = STRING1_OR_END; break; case STRING2: if (token == TOK_STRING) { // We have a new entry for translation TCHAR *str1 = _tcsdup(convert(s1.c_str())); const TCHAR *str2 = convert(s.c_str()); lang->insert(str1, str2); free(str1); } nextToken = STRING1_OR_END; break; } } // All this has manipulated the locale several times ... // Set it to english by default. setLang(_T("en")); } LibLang::~LibLang(void) { libLang.clear(); } /*------------------------------------------------------------------------------- - LibLang object methods. - -------------------------------------------------------------------------------*/ /******************************************************************************** * Insert a new Lang object in library. * ********************************************************************************/ bool LibLang::insertLang(Lang *lang) { std::pair<stdext::hash_map<String,Lang*>::iterator, bool> res; res = libLang.insert(LibPair(lang->langName, lang)); return (res.second); } /******************************************************************************** * Get a Lang object by its name. * ********************************************************************************/ const Lang *LibLang::getLang(const TCHAR *langName) { String s1 (langName); stdext::hash_map<String,Lang*>::const_iterator res; res = libLang.find(s1); if (res == libLang.end()) return (NULL); return (res->second); } /******************************************************************************** * Set current language. * * Returns 0 if ok, something else if not. * ********************************************************************************/ int LibLang::setLang(TCHAR *langName) { curLang = (Lang *) getLang(langName); TCHAR *localeInfo = _tsetlocale(LC_ALL, curLang->localeInfo); return (localeInfo == NULL); } /******************************************************************************** * Get current language. * ********************************************************************************/ const TCHAR *LibLang::getLang(void) { return (curLang->langName.c_str()); } /******************************************************************************** * Translate a token with current language. * ********************************************************************************/ const TCHAR *LibLang::translate(TCHAR *token) { return (curLang->get(token)); } /******************************************************************************** * Convert from chars in a locale to TCHAR. * ********************************************************************************/ const TCHAR *LibLang::convert(const char *str) { size_t len = mbstowcs(NULL, str, 0); size_t len2 = len * 2 + 2; if (len2 > allocLen) { if (wcstr != NULL) free(wcstr); allocLen = len2; wcstr = (TCHAR *) malloc(allocLen); } len2 = mbstowcs(wcstr, str, len+1); if (len2 < 0) return (NULL); else return (wcstr); } /******************************************************************************** * Get the number of language translations held in library. * ********************************************************************************/ int LibLang::getNbLang(void) { return (nbLang); } /******************************************************************************** * Get the first language in library. * ********************************************************************************/ const TCHAR *LibLang::getFirst(void) { firstCalled = true; libIterator = libLang.begin(); if (libIterator != libLang.end()) return (libIterator->first.c_str()); return (NULL); } /******************************************************************************** * Get the next language in library. If first time called, return the first * * entry. * ********************************************************************************/ const TCHAR *LibLang::getNext(void) { if (!firstCalled) return getFirst(); if (libIterator != libLang.end()) libIterator++; else return (NULL); if (libIterator != libLang.end()) return (libIterator->first.c_str()); return (NULL); } --- NEW FILE: DataManager.cpp --- #include "StdAfx.h" #include "compat/PalmOS.h" #include "DataManager.h" #include "defuns.h" DataManager::DataManager(void) { in_state = false; attr = 0; type = 0; creator = 0; version = 0; numRecords = 0; head = NULL; } DataManager::~DataManager(void) { } static DataManager *stateMgrHistDB; // This one comes from EasyCalc.cpp void registerDmDatabase (UINT16 cardNo, const TCHAR *nameP, LocalID dbId) { stateMgrHistDB = (DataManager *) dbId; } LocalID DmFindDatabase (UINT16 cardNo, const TCHAR *nameP) { return ((LocalID) stateMgrHistDB); } int DmDatabaseInfo ( UINT16 cardNo, LocalID dbID, TCHAR *nameP, UINT16 *attributesP, UINT16 *versionP, UINT32 *crDateP, UINT32 *modDateP, UINT32 *bckUpDateP, UINT32 *modNumP, LocalID *appInfoIDP, LocalID *sortInfoIDP, UINT32 *typeP, UINT32 *creatorP) { if (dbID == (LocalID) stateMgrHistDB) { *attributesP = stateMgrHistDB->attr; *versionP = (UINT16) (stateMgrHistDB->version); *typeP = stateMgrHistDB->type; *creatorP = stateMgrHistDB->creator; } return (0); } int DmSetDatabaseInfo ( UINT16 cardNo, LocalID dbID, const TCHAR *nameP, UINT16 *attributesP, UINT16 *versionP, UINT32 *crDateP, UINT32 *modDateP, UINT32 *bckUpDateP, UINT32 *modNumP, LocalID appInfoIDP, LocalID sortInfoIDP, UINT32 *typeP, UINT32 *creatorP) { if (dbID == (LocalID) stateMgrHistDB) { stateMgrHistDB->attr = *attributesP; stateMgrHistDB->version = *versionP; } return (0); } DmOpenRef DmOpenDatabase (UINT cardNo, LocalID dbID, UINT16 mode) { if (dbID == (LocalID) stateMgrHistDB) { return (stateMgrHistDB); } return (NULL); } int DmGetLastErr (void) { return (0); } int DmCreateDatabase ( UINT16 cardNo, const TCHAR *nameP, UINT32 creator, UINT32 type, bool resDB) { if (wcscmp (nameP, HISTORYDBNAME) == 0) { stateMgrHistDB->creator = creator; stateMgrHistDB->type = type; } return (0); } Err DmCloseDatabase (DmOpenRef dbP) { return (0); } int DmDeleteDatabase (UINT16 cardNo, LocalID dbID) { return (0); } UINT16 DmNumRecords (DmOpenRef dbP) { return (dbP->numRecords); } MemHandle DmNewRecord (DmOpenRef dbP, UInt16 *atP, UInt32 size) { if (dbP == stateMgrHistDB) { char *p = (char *) malloc ((size+8) & 0xFFFFFFFC); // Add 4 bytes, round up to next 4 bytes limit if (p == NULL) return (NULL); DataRecord *prec = NULL; DataRecord *temp = stateMgrHistDB->head; if (*atP > stateMgrHistDB->numRecords) *atP = stateMgrHistDB->numRecords; for (int i=0 ; (i<*atP) && (temp != NULL) ; i++) temp = (prec = temp)->next; stateMgrHistDB->numRecords++; if (prec == NULL) { // Insert at head temp = stateMgrHistDB->head = new DataRecord(size, p, stateMgrHistDB->head); } else { temp = prec->next = new DataRecord(size, p, temp); } // Put the father record address at beginning of the allocated space *((UInt32 *) p) = (UInt32) temp; return (p+4); } return (NULL); } Err DmRemoveRecord (DmOpenRef dbP, UInt16 index) { if (dbP == stateMgrHistDB) { DataRecord *prec = NULL; DataRecord *temp = stateMgrHistDB->head; if (index >= stateMgrHistDB->numRecords) return (-1); for (int i=0 ; (i<index) && (temp != NULL) ; i++) temp = (prec = temp)->next; stateMgrHistDB->numRecords--; if (prec == NULL) { // Delete at head stateMgrHistDB->head = stateMgrHistDB->head->next; } else { prec->next = temp->next; } free (temp->ptr); delete temp; return (0); } return (-1); } Err DmWrite ( void *recordP, UInt32 offset, const void *srcP, UInt32 bytes) { char *p = (char *) recordP; // Find the record to which this data belongs DataRecord *r = (DataRecord *) (* ((UInt32 *) (((UInt32) recordP) - 4))); if (r->magic != RECORD_MAGIC) return (-1); if (offset + bytes > r->size) return (-2); memcpy (p+offset, srcP, bytes); return (0); } MemHandle DmQueryRecord (DmOpenRef dbP, UInt16 index) { if (dbP == stateMgrHistDB) { DataRecord *temp = stateMgrHistDB->head; if (index >= stateMgrHistDB->numRecords) return (NULL); for (int i=0 ; (i<index) && (temp != NULL) ; i++) temp = temp->next; return (temp->ptr+4); } return (NULL); } //Err DmReleaseRecord (DmOpenRef dbP, UInt16 index, Boolean dirty) { // return (0); //} DataRecord::DataRecord(void) { magic = RECORD_MAGIC; size = 0; ptr = NULL; next = NULL; } DataRecord::DataRecord(UINT32 s, void *p, DataRecord *n) { size = s; ptr = (char *) p; next = n; } DataRecord::~DataRecord(void) { } --- NEW FILE: Lang.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ /* Lang.h : Lang and LibLang objects for handling language translations. *****************************************************************************/ #pragma once #include <stdio.h> #include <string> #include <string.h> #include <hash_map> typedef std::wstring String; typedef std::pair<String,String> Pair; // Object to contain one language class Lang { protected: int codePage; stdext::hash_map<String,String> translation; public: String langName; TCHAR *localeInfo; Lang(const TCHAR *name); ~Lang(void); bool insert(const TCHAR *key, const TCHAR *value); const TCHAR *get(TCHAR *key); }; // Library of languages, as read from the concatenated lang.rcp file. typedef std::pair<String,Lang*> LibPair; class LibLang { protected: int nbLang; bool firstCalled; Lang *curLang; TCHAR *wcstr; size_t allocLen; stdext::hash_map<String,Lang*> libLang; stdext::hash_map<String,Lang*>::const_iterator libIterator; bool insertLang(Lang *lang); const Lang *getLang(const TCHAR *langName); const TCHAR *convert(const char *str); public: LibLang(FILE *langFile); ~LibLang(void); int getNbLang(void); const TCHAR *getFirst(void); const TCHAR *getNext(void); int setLang(TCHAR *langName); const TCHAR *getLang(void); const TCHAR *translate(TCHAR *key); }; --- NEW FILE: PalmOS.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ #ifndef PALM_OS_H #define PALM_OS_H 1 #include <types.h> #define Int8 INT8 #define UInt8 UINT8 #define Int16 INT16 #define UInt16 UINT16 #define Int32 INT32 #define UInt32 UINT32 #define Char TCHAR #define Boolean bool #define Coord int #define Err int #define FieldPtr int #define IndexedColorType int #define StrCopy wcscpy #define StrLen wcslen #define StrNCompare wcsncmp #define StrCompare wcscmp #define MemPtrNew malloc #define MemPtrFree free typedef void *MemHandle; typedef void *WinHandle; typedef void *ListPtr; #define MemHandleLock(a) ((MemHandle) a) #define MemHandleUnlock(a) #define noListSelection -1 typedef struct PointType { Coord x; Coord y; } PointType; typedef struct RectangleType { PointType topLeft; PointType extent; } RectangleType; typedef RectangleType *RectanglePtr; #include "DataManager.h" #define ErrFatalDisplayIf(a,b) #define SYS_TRAP(a) #endif --- NEW FILE: DataManager.h --- #pragma once #ifndef DATA_MANAGER_H #define DATA_MANAGER_H 1 #include "PalmOS.h" #define dmModeReadWrite 1 #define dmHdrAttrBackup 2 #define RECORD_MAGIC 0x52454344 class DataRecord { public: UInt32 magic; UInt32 size; char *ptr; DataRecord *next; DataRecord(void); DataRecord(UINT32 s, void *p, DataRecord *n); ~DataRecord(void); }; class DataManager { public: bool in_state; UInt16 attr; UInt32 type; UInt32 creator; UInt16 version; UInt16 numRecords; DataRecord *head; DataManager(void); ~DataManager(void); }; typedef DataManager *DmOpenRef; typedef void *LocalID; void registerDmDatabase (UINT16 cardNo, const TCHAR *nameP, LocalID dbId); LocalID DmFindDatabase (UINT16 cardNo, const TCHAR *nameP); Err DmDatabaseInfo ( UInt16 cardNo, LocalID dbID, Char *nameP, UInt16 *attributesP, UInt16 *versionP, UInt32 *crDateP, UInt32 *modDateP, UInt32 *bckUpDateP, UInt32 *modNumP, LocalID appInfoIDP, LocalID sortInfoIDP, UInt32 *typeP, UInt32 *creatorP ); Err DmSetDatabaseInfo ( UInt16 cardNo, LocalID dbID, const Char *nameP, UInt16 *attributesP, UInt16 *versionP, UInt32 *crDateP, UInt32 *modDateP, UInt32 *bckUpDateP, UInt32 *modNumP, LocalID appInfoIDP, LocalID sortInfoIDP, UInt32 *typeP, UInt32 *creatorP ); DmOpenRef DmOpenDatabase (UInt16 cardNo, LocalID dbID, UInt16 mode); Err DmGetLastErr (void); Err DmCreateDatabase ( UInt16 cardNo, const Char *nameP, UInt32 creator, UInt32 type, Boolean resDB); Err DmCloseDatabase (DmOpenRef dbP); Err DmDeleteDatabase (UInt16 cardNo, LocalID dbID); UInt16 DmNumRecords (DmOpenRef dbP); MemHandle DmNewRecord (DmOpenRef dbP, UInt16 *atP, UInt32 size); Err DmWrite ( void *recordP, UInt32 offset, const void *srcP, UInt32 bytes ); Err DmRemoveRecord (DmOpenRef dbP, UInt16 index); MemHandle DmQueryRecord (DmOpenRef dbP, UInt16 index); //Err DmReleaseRecord (DmOpenRef dbP, UInt16 index, Boolean dirty); #define DmReleaseRecord(a,b,c) #endif --- NEW FILE: dbutil.cpp --- /* * $Id: dbutil.cpp,v 1.1 2009/06/22 21:57:16 mapibid Exp $ * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2007 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 "defuns.h" static Err db_open_byid(LocalID dbid, DmOpenRef *dbref) { *dbref = DmOpenDatabase(CARDNO, dbid, dmModeReadWrite); if (*dbref) return DmGetLastErr(); return 0; } /*********************************************************************** * * FUNCTION: open_db * * DESCRIPTION: Open a database for EasyCalc. Creates a new one, * if the database does not exist or if the old database * has the wrong version * * PARAMETERS: * * RETURN: 0 - on success * other - on error * ***********************************************************************/ Int16 open_db(const Char *name, UInt16 dbversion, UInt32 crid, UInt32 dbtype, DmOpenRef *dbref) { Err err; LocalID dbid; UInt16 version; UInt32 creator; UInt32 type; UInt16 attr = 0; dbid = DmFindDatabase(CARDNO, name); if (dbid) { /* Database exists */ DmDatabaseInfo(CARDNO, dbid, NULL, /* name */ &attr, /* attrib */ &version, /* version */ NULL, /* crDate */ NULL, /* modDate */ NULL, /* bckUpDate */ NULL, /* modNum */ NULL, /* appinfoID */ NULL, /* sortInfoID */ &type, /* Type */ &creator); /* Creator */ if (version == dbversion && creator == crid && type == dbtype) { if ((attr & dmHdrAttrBackup) == 0) { attr |= dmHdrAttrBackup; DmSetDatabaseInfo(CARDNO, dbid, NULL, /* name */ &attr, /* attrib */ &version, /* version */ NULL, /* crDate */ NULL, /* modDate */ NULL, /* bckupDate */ NULL, /* modNum */ NULL, /* appinfoID */ NULL, /* sortInfoID */ NULL, /* Type */ NULL); /* Creator */ } return db_open_byid(dbid, dbref); } /* Database exists, but with incorrect version */ err = DmDeleteDatabase(CARDNO, dbid); if (err) return err; } /* Database doesn't exist or old version */ err = DmCreateDatabase(CARDNO, name, crid, dbtype, false); if (err) return err; dbid = DmFindDatabase(CARDNO, name); version = dbversion; attr |= dmHdrAttrBackup; DmSetDatabaseInfo(CARDNO, dbid, NULL, /* name */ &attr, /* attrib */ &version, /* version */ NULL, /* crDate */ NULL, /* modDate */ NULL, /* bckUpDate */ NULL, /* modNum */ NULL, /* appinfoID */ NULL, /* sortInfoID */ NULL, /* Type */ NULL); /* Creator */ return db_open_byid(dbid, dbref); } |
From: Mapi B. <ma...@us...> - 2009-06-22 21:57:56
|
Update of /cvsroot/easycalc/PPCport/compat In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23068/compat Log Message: Directory /cvsroot/easycalc/PPCport/compat added to the repository |
From: Mapi B. <ma...@us...> - 2009-06-22 21:54:34
|
Update of /cvsroot/easycalc/PPCport/include In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22873/include Modified Files: MathLib.h calcDB.h cmatrix.h complex.h dbutil.h defuns.h fp.h integ.h mathem.h matrix.h meqstack.h segment.h slist.h specfun.h txtask.h Log Message: 2nd upload, getting closer |
From: Mapi B. <ma...@us...> - 2009-06-22 21:53:56
|
Update of /cvsroot/easycalc/PPCport In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22873 Modified Files: EasyCalc.vcproj Main.cpp Main.h ReadMe.txt ansops.h calcrsc.h chkstack.h core_main.cpp core_main.h core_tables.h grprefs.h prefs.h test.txt varmgr.h Log Message: 2nd upload, getting closer |
From: Mapi B. <ma...@us...> - 2009-06-22 21:45:37
|
Update of /cvsroot/easycalc/PPCport In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21796 Modified Files: EasyCalc.vcproj Main.cpp core_main.cpp Log Message: 2nd upload, getting closer Index: EasyCalc.vcproj =================================================================== RCS file: /cvsroot/easycalc/PPCport/EasyCalc.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalc.vcproj 26 May 2008 20:09:53 -0000 1.1 --- EasyCalc.vcproj 22 Jun 2009 21:44:28 -0000 1.2 *************** *** 46,50 **** ExecutionBucket="7" Optimization="0" ! AdditionalIncludeDirectories="E:\AppsDev\EasyCalc\EasyCalc;E:\AppsDev\EasyCalc\EasyCalc\include" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;POCKETPC2003_UI_MODEL;SPECFUN_ENABLED;GRAPHS_ENABLED" MinimalRebuild="true" --- 46,50 ---- ExecutionBucket="7" Optimization="0" ! AdditionalIncludeDirectories="E:\AppsDev\EasyCalc\EasyCalc;E:\AppsDev\EasyCalc\EasyCalc\include;E:\AppsDev\EasyCalc\EasyCalc\core\mlib;"E:\AppsDev\EasyCalc\EasyCalc\system - UI"" PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;POCKETPC2003_UI_MODEL;SPECFUN_ENABLED;GRAPHS_ENABLED" MinimalRebuild="true" *************** *** 53,56 **** --- 53,57 ---- WarningLevel="3" DebugInformationFormat="3" + ForcedIncludeFiles="" ShowIncludes="true" /> *************** *** 380,475 **** > <File - RelativePath=".\core_display.cpp" - > - </File> - <File - RelativePath=".\core_globals.cpp" - > - </File> - <File RelativePath=".\core_main.cpp" > </File> <File - RelativePath=".\DataManager.cpp" - > - </File> - <File - RelativePath=".\dbutil.cpp" - > - </File> - <File - RelativePath=".\EasyCalc.cpp" - > - </File> - <File RelativePath=".\Main.cpp" > </File> ! <File ! RelativePath=".\result.cpp" ! > ! </File> ! <File ! RelativePath=".\shell_loadimage.cpp" ! > ! </File> ! <File ! RelativePath=".\Skin.cpp" ! > ! </File> ! <File ! RelativePath=".\StateManager.cpp" ! > ! </File> ! <File ! RelativePath=".\stdafx.cpp" > ! <FileConfiguration ! Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! </File> <Filter ! Name="mlib" > <File ! RelativePath=".\mlib\history.cpp" > </File> <File ! RelativePath=".\mlib\konvert.cpp" > </File> <File ! RelativePath=".\mlib\stack.cpp" > </File> --- 381,496 ---- > <File RelativePath=".\core_main.cpp" > </File> <File RelativePath=".\Main.cpp" > </File> ! <Filter ! Name="system - UI" > ! <File ! RelativePath=".\system - UI\core_display.cpp" > ! </File> ! <File ! RelativePath=".\system - UI\EasyCalc.cpp" > ! </File> ! <File ! RelativePath=".\system - UI\shell_loadimage.cpp" > ! </File> ! <File ! RelativePath=".\system - UI\Skin.cpp" > ! </File> ! <File ! RelativePath=".\system - UI\StateManager.cpp" ! > ! </File> ! <File ! RelativePath=".\system - UI\stdafx.cpp" ! > ! <FileConfiguration ! Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ! > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" ! > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ! > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ! > ! <Tool ! Name="VCCLCompilerTool" ! UsePrecompiledHeader="1" ! /> ! </FileConfiguration> ! </File> ! </Filter> <Filter ! Name="core" > <File ! RelativePath=".\core\core_globals.cpp" > </File> + <Filter + Name="mlib" + > + <File + RelativePath=".\core\mlib\display.cpp" + > + </File> + <File + RelativePath=".\core\mlib\funcs.cpp" + > + </File> + <File + RelativePath=".\core\mlib\history.cpp" + > + </File> + <File + RelativePath=".\core\mlib\konvert.cpp" + > + </File> + <File + RelativePath=".\core\mlib\stack.cpp" + > + </File> + </Filter> + </Filter> + <Filter + Name="compat" + > <File ! RelativePath=".\compat\DataManager.cpp" > </File> <File ! RelativePath=".\compat\dbutil.cpp" ! > ! </File> ! <File ! RelativePath=".\compat\Lang.cpp" > </File> *************** *** 490,501 **** </File> <File - RelativePath=".\core_display.h" - > - </File> - <File - RelativePath=".\core_globals.h" - > - </File> - <File RelativePath=".\core_main.h" > --- 511,514 ---- *************** *** 506,513 **** </File> <File - RelativePath=".\EasyCalc.h" - > - </File> - <File RelativePath=".\grprefs.h" > --- 519,522 ---- *************** *** 522,549 **** </File> <File - RelativePath=".\resourceppc.h" - > - </File> - <File - RelativePath=".\result.h" - > - </File> - <File - RelativePath=".\shell_loadimage.h" - > - </File> - <File - RelativePath=".\Skin.h" - > - </File> - <File - RelativePath=".\StateManager.h" - > - </File> - <File - RelativePath=".\stdafx.h" - > - </File> - <File RelativePath=".\varmgr.h" > --- 531,534 ---- *************** *** 565,644 **** </File> <File ! RelativePath=".\DataManager.h" > </File> <File ! RelativePath=".\include\dbutil.h" > </File> <File ! RelativePath=".\include\defuns.h" > </File> <File ! RelativePath=".\include\display.h" > </File> <File ! RelativePath=".\include\fp.h" > </File> <File ! RelativePath=".\include\funcs.h" > </File> <File ! RelativePath=".\include\history.h" > </File> <File ! RelativePath=".\include\integ.h" > </File> <File ! RelativePath=".\include\konvert.h" > </File> <File ! RelativePath=".\include\mathem.h" > </File> <File ! RelativePath=".\include\MathLib.h" > </File> <File ! RelativePath=".\include\matrix.h" > </File> <File ! RelativePath=".\include\meqstack.h" > </File> <File ! RelativePath=".\include\PalmOS.h" > </File> <File ! RelativePath=".\include\segment.h" > </File> <File ! RelativePath=".\include\slist.h" > </File> <File ! RelativePath=".\include\specfun.h" > </File> <File ! RelativePath=".\include\stack.h" > </File> <File ! RelativePath=".\include\txtask.h" > </File> </Filter> </Filter> <Filter --- 550,681 ---- </File> <File ! RelativePath=".\include\dbutil.h" > </File> <File ! RelativePath=".\include\defuns.h" > </File> <File ! RelativePath=".\include\fp.h" > </File> <File ! RelativePath=".\include\integ.h" > </File> <File ! RelativePath=".\include\mathem.h" > </File> <File ! RelativePath=".\include\MathLib.h" > </File> <File ! RelativePath=".\include\matrix.h" > </File> <File ! RelativePath=".\include\meqstack.h" > </File> <File ! RelativePath=".\include\segment.h" > </File> <File ! RelativePath=".\include\slist.h" > </File> <File ! RelativePath=".\include\specfun.h" > </File> <File ! RelativePath=".\include\txtask.h" > </File> + </Filter> + <Filter + Name="system - UI" + > <File ! RelativePath=".\system - UI\core_display.h" > </File> <File ! RelativePath=".\system - UI\EasyCalc.h" > </File> <File ! RelativePath=".\system - UI\resourceppc.h" > </File> <File ! RelativePath=".\system - UI\shell_loadimage.h" > </File> <File ! RelativePath=".\system - UI\Skin.h" > </File> <File ! RelativePath=".\system - UI\StateManager.h" > </File> <File ! RelativePath=".\system - UI\stdafx.h" ! > ! </File> ! </Filter> ! <Filter ! Name="compat" ! > ! <File ! RelativePath=".\compat\DataManager.h" ! > ! </File> ! <File ! RelativePath=".\compat\Lang.h" ! > ! </File> ! <File ! RelativePath=".\compat\PalmOS.h" > </File> </Filter> + <Filter + Name="core" + > + <File + RelativePath=".\core\core_globals.h" + > + </File> + <Filter + Name="mlib" + > + <File + RelativePath=".\core\mlib\display.h" + > + </File> + <File + RelativePath=".\core\mlib\funcs.h" + > + </File> + <File + RelativePath=".\core\mlib\history.h" + > + </File> + <File + RelativePath=".\core\mlib\konvert.h" + > + </File> + <File + RelativePath=".\core\mlib\stack.h" + > + </File> + </Filter> + </Filter> </Filter> <Filter *************** *** 647,662 **** UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > ! <File ! RelativePath=".\EasyCalc.ico" ! > ! </File> ! <File ! RelativePath=".\EasyCalcppc.rc" ! > ! </File> ! <File ! RelativePath=".\EasyCalcppc.rc2" > ! </File> </Filter> <File --- 684,703 ---- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > ! <Filter ! Name="system - UI" > ! <File ! RelativePath=".\system - UI\EasyCalc.ico" ! > ! </File> ! <File ! RelativePath=".\system - UI\EasyCalcppc.rc" ! > ! </File> ! <File ! RelativePath=".\system - UI\EasyCalcppc.rc2" ! > ! </File> ! </Filter> </Filter> <File Index: Main.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/Main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.cpp 26 May 2008 20:09:53 -0000 1.1 --- Main.cpp 22 Jun 2009 21:44:28 -0000 1.2 *************** *** 1,5 **** ! /* * $Id$ ! * * Scientific Calculator for Palms. * Copyright (C) 1999,2000,2001 Ondrej Palkovsky --- 1,5 ---- ! /* * $Id$ ! * * Scientific Calculator for Palms. [...2249 lines suppressed...] ! if(k) goto exit; ! else{ ! FldSetSelection(field,j,j+1); ! calc_nil_timeout(40); ! BrH=1; ! } ! } ! else if(BrH==1) ! { ! FldSetSelection(GetObjectPtr(tdInput),start,start); ! exit: calc_nil_timeout(evtWaitForever); ! BrH=0; ! } ! handled=true; ! break; ! } ! ! return handled; ! } Index: core_main.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/core_main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** core_main.cpp 26 May 2008 20:08:14 -0000 1.1 --- core_main.cpp 22 Jun 2009 21:44:28 -0000 1.2 *************** *** 28,32 **** #include "stdafx.h" #include "core_main.h" ! #include "core_globals.h" #include "core_tables.h" #include "core_display.h" --- 28,32 ---- #include "stdafx.h" #include "core_main.h" ! #include "core/core_globals.h" #include "core_tables.h" #include "core_display.h" |
From: Mapi B. <ma...@us...> - 2009-06-22 21:45:32
|
Update of /cvsroot/easycalc/PPCport/include In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21796/include Modified Files: calcDB.h Log Message: 2nd upload, getting closer Index: calcDB.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/include/calcDB.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** calcDB.h 26 May 2008 20:17:54 -0000 1.1 --- calcDB.h 22 Jun 2009 21:44:28 -0000 1.2 *************** *** 26,30 **** #define _CALCDB_H_ ! //#include <PalmOS.h> #include "konvert.h" --- 26,30 ---- #define _CALCDB_H_ ! #include "compat/PalmOS.h" #include "konvert.h" |