From: <ai...@us...> - 2009-02-21 00:32:29
|
Revision: 9568 http://plplot.svn.sourceforge.net/plplot/?rev=9568&view=rev Author: airwin Date: 2009-02-21 00:32:28 +0000 (Sat, 21 Feb 2009) Log Message: ----------- Set default time configuration for plinit and properly close qsastime library for plend1. Drop time configuration and closing of qsastime library from plbox.c. Modified Paths: -------------- trunk/src/plbox.c trunk/src/plcore.c Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2009-02-21 00:30:02 UTC (rev 9567) +++ trunk/src/plbox.c 2009-02-21 00:32:28 UTC (rev 9568) @@ -1251,10 +1251,8 @@ for (tn = tp; BETW(tn, vpwxmi, vpwxma); tn += xtick1) { if (ldx) { t = (double) tn; - configqsas(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0., &(plsc->qsasconfig)); ctimeqsas(1970,0,1,0,0,t,&tm, plsc->qsasconfig); strfqsas(string, STRING_LEN, timefmt, tm, plsc->qsasconfig); - closeqsas(&(plsc->qsasconfig)); } else { plform(tn, xscale, xprec, string, STRING_LEN, llx, lfx); @@ -1302,10 +1300,8 @@ for (tn = tp; BETW(tn, vpwymi, vpwyma); tn += ytick1) { if (ldy) { t = (double) tn; - configqsas(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0., &(plsc->qsasconfig)); ctimeqsas(1970,0,1,0,0,t,&tm, plsc->qsasconfig); strfqsas(string, STRING_LEN, timefmt, tm, plsc->qsasconfig); - closeqsas(&(plsc->qsasconfig)); } else { plform(tn, yscale, yprec, string, STRING_LEN, lly, lfy); Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-02-21 00:30:02 UTC (rev 9567) +++ trunk/src/plcore.c 2009-02-21 00:32:28 UTC (rev 9568) @@ -1716,8 +1716,14 @@ plsc->zdigmax = 3; if (plsc->timefmt == NULL) - pltimefmt("%c"); + c_pltimefmt("%c"); + /* Default transformation between continuous and broken-down time + (and vice versa) defined here for PLplot. */ + /* Temporarily the default is defined to be seconds past the Unix epoch. */ + if (plsc->qsasconfig == NULL) + c_plconfigtime(1./86400., 0., 0., 0x0, 1, 1970, 0, 1, 0, 0, 0.); + /* Switch to graphics mode and set color and arrow style*/ plgra(); @@ -1848,6 +1854,11 @@ if (plsc->timefmt) free_mem(plsc->timefmt); + /* Close qsastime library for this stream that was opened by + plconfigtime call in plinit. */ + + closeqsas(&(plsc->qsasconfig)); + /* Free malloc'ed stream if not in initial stream, else clear it out */ if (ipls > 0) { @@ -2957,17 +2968,6 @@ *p_prec = plsc->precis; } -void -c_pltimefmt(const char *fmt) -{ - if (plsc->timefmt) - free_mem(plsc->timefmt); - - plsc->timefmt = (char *) malloc((size_t) (strlen(fmt)+1)); - strcpy(plsc->timefmt, fmt); - -} - const char * plP_gtimefmt() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |