|
From: Seth D. <set...@us...> - 2005-04-07 20:59:35
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23914/source Modified Files: langverbs.c Log Message: Kernelized date.year, date.month, and date.day. Performance is now (approximately) 8 to 10 times faster. (Requires update to glue scripts.) Added the missing verbs date.hour, date.minute, date.seconds. (These require new glue scripts.) Index: langverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langverbs.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** langverbs.c 24 Jan 2005 03:17:47 -0000 1.10 --- langverbs.c 7 Apr 2005 20:59:26 -0000 1.11 *************** *** 275,278 **** --- 275,290 ---- dateversionlessthanfunc, //AR 07/07/1999 + + datedayfunc, // SMD 2005-04-07 + + datemonthfunc, // SMD 2005-04-07 + + dateyearfunc, // SMD 2005-04-07 + + datehourfunc, // SMD 2005-04-07 + + dateminutefunc, // SMD 2005-04-07 + + datesecondsfunc, // SMD 2005-04-07 /*dialog*/ *************** *** 2107,2110 **** --- 2119,2163 ---- return (true); } + + case datedayfunc: /* SMD 2005-04-07 */ + case datemonthfunc: + case dateyearfunc: + case datehourfunc: + case dateminutefunc: + case datesecondsfunc: { + tyvaluerecord vsecs; + short ctconsumed = 0; + short ctpositional = 0; + short day, month, year, hour, minute, second; + + initvalue (&vsecs, datevaluetype); + + flnextparamislast = true; + + if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, "\x04" "date", &vsecs)) + return (false); + + if (!vsecs.data.datevalue) { + if (!setdatevalue (timenow(), &vsecs)) + return (false); + } + + secondstodatetime (vsecs.data.datevalue, &day, &month, &year, &hour, &minute, &second); + + switch (token) { + case datedayfunc: + return (setintvalue (day, v)); + case datemonthfunc: + return (setintvalue (month, v)); + case dateyearfunc: + return (setintvalue (year, v)); + case datehourfunc: + return (setintvalue (hour, v)); + case dateminutefunc: + return (setintvalue (minute, v)); + case datesecondsfunc: + return (setintvalue (second, v)); + } + } case abbrevstringfunc: { |