avr-libc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-commit] [2318] Separated time.private.h variables out to '.c'


From: Mike Rice
Subject: [avr-libc-commit] [2318] Separated time.private.h variables out to '.c' files
Date: Sat, 30 Mar 2013 11:59:29 +0000

Revision: 2318
          http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2318
Author:   swfltek
Date:     2013-03-30 11:59:28 +0000 (Sat, 30 Mar 2013)
Log Message:
-----------
Separated time.private.h variables out to '.c' files
Removed time.private.h

Modified Paths:
--------------
    trunk/avr-libc/libc/time/Files.am
    trunk/avr-libc/libc/time/Makefile.am
    trunk/avr-libc/libc/time/asctime.c
    trunk/avr-libc/libc/time/asctime_r.c
    trunk/avr-libc/libc/time/ctime.c
    trunk/avr-libc/libc/time/daylight_seconds.c
    trunk/avr-libc/libc/time/difftime.c
    trunk/avr-libc/libc/time/equation_of_time.c
    trunk/avr-libc/libc/time/gmtime.c
    trunk/avr-libc/libc/time/isotime.c
    trunk/avr-libc/libc/time/lm_sidereal.c
    trunk/avr-libc/libc/time/localtime.c
    trunk/avr-libc/libc/time/localtime_r.c
    trunk/avr-libc/libc/time/mktime.c
    trunk/avr-libc/libc/time/set_dst.c
    trunk/avr-libc/libc/time/set_position.c
    trunk/avr-libc/libc/time/set_zone.c
    trunk/avr-libc/libc/time/solar_declination.c
    trunk/avr-libc/libc/time/strftime.c
    trunk/avr-libc/libc/time/sun_rise.c
    trunk/avr-libc/libc/time/sun_set.c
    trunk/avr-libc/libc/time/system_tick.c
    trunk/avr-libc/libc/time/time.c

Added Paths:
-----------
    trunk/avr-libc/libc/time/asc_store.c
    trunk/avr-libc/libc/time/dst_pointer.c
    trunk/avr-libc/libc/time/geo_location.c
    trunk/avr-libc/libc/time/system_time.c
    trunk/avr-libc/libc/time/tm_store.c
    trunk/avr-libc/libc/time/utc_offset.c

Removed Paths:
-------------
    trunk/avr-libc/libc/time/asc_store.h
    trunk/avr-libc/libc/time/time_private.h
    trunk/avr-libc/libc/time/tm_store.h

Modified: trunk/avr-libc/libc/time/Files.am
===================================================================
--- trunk/avr-libc/libc/time/Files.am   2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/Files.am   2013-03-30 11:59:28 UTC (rev 2318)
@@ -1,68 +1,68 @@
-# \xA92012 Michael Duane Rice All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer. Redistributions in binary
-# form must reproduce the above copyright notice, this list of conditions
-# and the following disclaimer in the documentation and/or other materials
-# provided with the distribution. Neither the name of the copyright holders
-# nor the names of contributors may be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
+ # (C)2012 Michael Duane Rice All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ # list of conditions and the following disclaimer. Redistributions in binary
+ # form must reproduce the above copyright notice, this list of conditions
+ # and the following disclaimer in the documentation and/or other materials
+ # provided with the distribution. Neither the name of the copyright holders
+ # nor the names of contributors may be used to endorse or promote products
+ # derived from this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ # POSSIBILITY OF SUCH DAMAGE.
 
-# $Id$
+ # $Id$
 
 time_a_c_sources = \
-       asctime.c \
-       asctime_r.c \
-       ctime.c \
-       ctime_r.c \
-       daylight_seconds.c \
-       difftime.c \
-       equation_of_time.c \
-       fatfs_time.c \
-       gm_sidereal.c \
-       gmtime.c \
-       gmtime_r.c \
-       isLeap.c \
-       isotime.c \
-       isotime_r.c \
-       lm_sidereal.c \
-       localtime.c \
-       localtime_r.c \
-       mk_gmtime.c \
-       mktime.c \
-       month_length.c \
-       moon_phase.c \
-       set_dst.c \
-       set_position.c \
-       set_system_time.c \
-       set_zone.c \
-       solar_declination.c \
-       strftime.c \
-       sun_rise.c \
-       sun_set.c \
-       system_tick.c \
-       time.c \
-       week_of_month.c \
-       week_of_year.c
-       
-time_a_extra_dist = \
-       asc_store.h \
-       time_private.h \
-       tm_store.h 
+    asc_store.c \
+    asctime.c \
+    asctime_r.c \
+    ctime.c \
+    ctime_r.c \
+    daylight_seconds.c \
+    difftime.c \
+    dst_pointer.c \
+    equation_of_time.c \
+    fatfs_time.c \
+    geo_location.c \
+    gm_sidereal.c \
+    gmtime.c \
+    gmtime_r.c \
+    isLeap.c \
+    isotime.c \
+    isotime_r.c \
+    lm_sidereal.c \
+    localtime.c \
+    localtime_r.c \
+    mk_gmtime.c \
+    mktime.c \
+    month_length.c \
+    moon_phase.c \
+    set_dst.c \
+    set_position.c \
+    set_system_time.c \
+    set_zone.c \
+    solar_declination.c \
+    strftime.c \
+    sun_rise.c \
+    sun_set.c \
+    system_tick.c \
+    system_time.c \
+    time.c \
+    tm_store.c \
+    utc_offset.c \
+    week_of_month.c \
+    week_of_year.c 

Modified: trunk/avr-libc/libc/time/Makefile.am
===================================================================
--- trunk/avr-libc/libc/time/Makefile.am        2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/Makefile.am        2013-03-30 11:59:28 UTC (rev 
2318)
@@ -30,5 +30,4 @@
 include $(top_srcdir)/libc/time/Files.am
 
 EXTRA_DIST = \
-       $(time_a_c_sources) \
-       $(time_a_extra_dist)
+       $(time_a_c_sources)

Added: trunk/avr-libc/libc/time/asc_store.c
===================================================================
--- trunk/avr-libc/libc/time/asc_store.c                                (rev 0)
+++ trunk/avr-libc/libc/time/asc_store.c        2013-03-30 11:59:28 UTC (rev 
2318)
@@ -0,0 +1,39 @@
+/*
+ * (c)2012 Michael Duane Rice All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions
+ * and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the copyright holders
+ * nor the names of contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+/*
+       Private allocation, shared between asctime() and isotime()
+*/
+
+#include <time.h>
+
+char            __store[26];
+
+char           *__asc_store = __store;


Property changes on: trunk/avr-libc/libc/time/asc_store.c
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Deleted: trunk/avr-libc/libc/time/asc_store.h
===================================================================
--- trunk/avr-libc/libc/time/asc_store.h        2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/asc_store.h        2013-03-30 11:59:28 UTC (rev 
2318)
@@ -1,42 +0,0 @@
-/*(c)2012 Michael Duane Rice
-       All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-
-   * Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-   * Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-   * Neither the name of the copyright holders nor the names of
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  POSSIBILITY OF SUCH DAMAGE. 
-*/
-
-/* $Id$ */
-
-/*
-       Private allocation, shared between asctime() and isotime()
-*/
-#ifndef ASC_STOR_H
-#define ASC_STOR_H
-
-#include "time_private.h"
-
-char __asc_store[ASCTIME_BUFFER_SIZE];
-
-#endif

Modified: trunk/avr-libc/libc/time/asctime.c
===================================================================
--- trunk/avr-libc/libc/time/asctime.c  2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/asctime.c  2013-03-30 11:59:28 UTC (rev 2318)
@@ -33,8 +33,9 @@
 */
 
 #include <time.h>
-#include "time_private.h"
-#include "asc_store.h"
+
+extern char    *__asc_store;
+
 char           *
 asctime(const struct tm * timeptr)
 {

Modified: trunk/avr-libc/libc/time/asctime_r.c
===================================================================
--- trunk/avr-libc/libc/time/asctime_r.c        2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/asctime_r.c        2013-03-30 11:59:28 UTC (rev 
2318)
@@ -32,7 +32,6 @@
        Re-entrant version of asctime().
        
 */
-#include "time_private.h"
 #include <time.h>
 #include <stdio.h>
 

Modified: trunk/avr-libc/libc/time/ctime.c
===================================================================
--- trunk/avr-libc/libc/time/ctime.c    2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/ctime.c    2013-03-30 11:59:28 UTC (rev 2318)
@@ -33,8 +33,9 @@
        private buffer, and return the buffer.
 */
 #include <time.h>
-#include "asc_store.h"
 
+extern char    *__asc_store;
+
 char           *
 ctime(const time_t * timeptr)
 {

Modified: trunk/avr-libc/libc/time/daylight_seconds.c
===================================================================
--- trunk/avr-libc/libc/time/daylight_seconds.c 2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/daylight_seconds.c 2013-03-30 11:59:28 UTC (rev 
2318)
@@ -35,11 +35,9 @@
 
 #include <time.h>
 #include <math.h>
-#include "time_private.h"
 
-extern long     _latitude;
+extern long     __latitude;
 
-
 long
 daylight_seconds(time_t * timer)
 {
@@ -47,7 +45,7 @@
        long            n;
 
        /* convert latitude to radians */
-       l = _latitude / 206264.806;
+       l = __latitude / 206264.806;
 
        d = -solar_declination(timer);
 

Modified: trunk/avr-libc/libc/time/difftime.c
===================================================================
--- trunk/avr-libc/libc/time/difftime.c 2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/difftime.c 2013-03-30 11:59:28 UTC (rev 2318)
@@ -30,7 +30,7 @@
 
 /*
        The C90 standard specifies this returns a 'double. Since we do not have 
a true double,
-       we return a work alike type. 
+       we return a work alike type.
 */
 #include <time.h>
 

Added: trunk/avr-libc/libc/time/dst_pointer.c
===================================================================
--- trunk/avr-libc/libc/time/dst_pointer.c                              (rev 0)
+++ trunk/avr-libc/libc/time/dst_pointer.c      2013-03-30 11:59:28 UTC (rev 
2318)
@@ -0,0 +1,34 @@
+/*
+ * (C)2012 Michael Duane Rice All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions
+ * and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the copyright holders
+ * nor the names of contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+#include <inttypes.h>
+#include <time.h>
+
+int             (*__dst_ptr) (const time_t *, int32_t *);


Property changes on: trunk/avr-libc/libc/time/dst_pointer.c
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Modified: trunk/avr-libc/libc/time/equation_of_time.c
===================================================================
--- trunk/avr-libc/libc/time/equation_of_time.c 2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/equation_of_time.c 2013-03-30 11:59:28 UTC (rev 
2318)
@@ -35,7 +35,6 @@
 */
 
 #include <time.h>
-#include "time_private.h"
 #include <math.h>
 
 int
@@ -51,7 +50,7 @@
        p = *timer - 191857UL;
 
        /* limit to 1 tropical year */
-       y = tropical_year;
+       y = 31556926;
        s %= y;
        p %= y;
 

Added: trunk/avr-libc/libc/time/geo_location.c
===================================================================
--- trunk/avr-libc/libc/time/geo_location.c                             (rev 0)
+++ trunk/avr-libc/libc/time/geo_location.c     2013-03-30 11:59:28 UTC (rev 
2318)
@@ -0,0 +1,32 @@
+/*
+ * (C)2012 Michael Duane Rice All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions
+ * and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the copyright holders
+ * nor the names of contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+long            __latitude;
+long            __longitude;


Property changes on: trunk/avr-libc/libc/time/geo_location.c
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Modified: trunk/avr-libc/libc/time/gmtime.c
===================================================================
--- trunk/avr-libc/libc/time/gmtime.c   2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/gmtime.c   2013-03-30 11:59:28 UTC (rev 2318)
@@ -34,12 +34,12 @@
 */
 
 #include <time.h>
-#include "tm_store.h"
 
+extern struct tm __tm_store;
+
 struct tm      *
 gmtime(const time_t * timeptr)
 {
-
        gmtime_r(timeptr, &__tm_store);
        return &__tm_store;
 }

Modified: trunk/avr-libc/libc/time/isotime.c
===================================================================
--- trunk/avr-libc/libc/time/isotime.c  2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/isotime.c  2013-03-30 11:59:28 UTC (rev 2318)
@@ -33,8 +33,9 @@
 */
 
 #include <time.h>
-#include "asc_store.h"
 
+extern char    *__asc_store;
+
 char           *
 isotime(struct tm * tmptr)
 {

Modified: trunk/avr-libc/libc/time/lm_sidereal.c
===================================================================
--- trunk/avr-libc/libc/time/lm_sidereal.c      2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/lm_sidereal.c      2013-03-30 11:59:28 UTC (rev 
2318)
@@ -33,14 +33,14 @@
 */
 #include <time.h>
 
-extern long     _longitude;
+extern long     __longitude;
 
 unsigned long
 lm_sidereal(const time_t * timer)
 {
        long            n;
 
-       n = gm_sidereal(timer) + _longitude / 15L;
+       n = gm_sidereal(timer) + __longitude / 15L;
        n += 86400L;
        n %= 86400L;
        return n;

Modified: trunk/avr-libc/libc/time/localtime.c
===================================================================
--- trunk/avr-libc/libc/time/localtime.c        2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/localtime.c        2013-03-30 11:59:28 UTC (rev 
2318)
@@ -32,9 +32,10 @@
        Standard localtime() function.
 */
 
-#include "tm_store.h"
 #include <time.h>
 
+extern struct tm __tm_store;
+
 struct tm      *
 localtime(const time_t * timer)
 {

Modified: trunk/avr-libc/libc/time/localtime_r.c
===================================================================
--- trunk/avr-libc/libc/time/localtime_r.c      2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/localtime_r.c      2013-03-30 11:59:28 UTC (rev 
2318)
@@ -33,9 +33,12 @@
        zone and Daylight savings offset, then break it down into calendar time.
 */
 
-#include "time_private.h"
 #include <time.h>
 
+extern long     __utc_offset;
+
+extern int      (*__dst_ptr) (const time_t *, int32_t *);
+
 void
 localtime_r(const time_t * timer, struct tm * timeptr)
 {
@@ -44,10 +47,10 @@
 
        dst = -1;
 
-       if (_dst_ptr)
-               dst = _dst_ptr(timer, &_utc_offset);
+       if (__dst_ptr)
+               dst = __dst_ptr(timer, &__utc_offset);
 
-       lt = *timer + _utc_offset;
+       lt = *timer + __utc_offset;
 
        if (dst > 0)
                lt += dst;

Modified: trunk/avr-libc/libc/time/mktime.c
===================================================================
--- trunk/avr-libc/libc/time/mktime.c   2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/mktime.c   2013-03-30 11:59:28 UTC (rev 2318)
@@ -34,8 +34,11 @@
 */
 
 #include <time.h>
-#include "time_private.h"
 
+extern long     __utc_offset;
+
+extern int      (*__dst_ptr) (const time_t *, int32_t *);
+
 time_t
 mktime(struct tm * timeptr)
 {
@@ -44,13 +47,13 @@
        ret = mk_gmtime(timeptr);
 
        if (timeptr->tm_isdst < 0) {
-               if (_dst_ptr)
-                       timeptr->tm_isdst = _dst_ptr(&ret, &_utc_offset);
+               if (__dst_ptr)
+                       timeptr->tm_isdst = __dst_ptr(&ret, &__utc_offset);
        }
        if (timeptr->tm_isdst > 0)
                ret -= timeptr->tm_isdst;
 
-       ret -= _utc_offset;
+       ret -= __utc_offset;
 
        localtime_r(&ret, timeptr);
 

Modified: trunk/avr-libc/libc/time/set_dst.c
===================================================================
--- trunk/avr-libc/libc/time/set_dst.c  2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/set_dst.c  2013-03-30 11:59:28 UTC (rev 2318)
@@ -32,10 +32,13 @@
        Set the dst function pointer.
 */
 
-#include "time_private.h"
+#include <inttypes.h>
+#include <time.h>
 
+extern int      (*__dst_ptr) (const time_t *, int32_t *);
+
 void
 set_dst(int (*d) (const time_t *, int32_t *))
 {
-       _dst_ptr = d;
+       __dst_ptr = d;
 }

Modified: trunk/avr-libc/libc/time/set_position.c
===================================================================
--- trunk/avr-libc/libc/time/set_position.c     2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/set_position.c     2013-03-30 11:59:28 UTC (rev 
2318)
@@ -33,12 +33,12 @@
        North latitude and East longitude being positive values.
 */
 
-long            _latitude;
-long            _longitude;
+extern long     __latitude;
+extern long     __longitude;
 
 void
 set_position(long lat, long lon)
 {
-       _latitude = lat;
-       _longitude = lon;
+       __latitude = lat;
+       __longitude = lon;
 }

Modified: trunk/avr-libc/libc/time/set_zone.c
===================================================================
--- trunk/avr-libc/libc/time/set_zone.c 2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/set_zone.c 2013-03-30 11:59:28 UTC (rev 2318)
@@ -32,10 +32,10 @@
        Set the system time zone. The parameter is seconds offset from UTC.
 */
 
-#include "time_private.h"
+extern long     __utc_offset;
 
 void
 set_zone(long z)
 {
-       _utc_offset = z;
+       __utc_offset = z;
 }

Modified: trunk/avr-libc/libc/time/solar_declination.c
===================================================================
--- trunk/avr-libc/libc/time/solar_declination.c        2013-03-29 21:29:35 UTC 
(rev 2317)
+++ trunk/avr-libc/libc/time/solar_declination.c        2013-03-30 11:59:28 UTC 
(rev 2318)
@@ -33,7 +33,6 @@
 */
 
 #include <time.h>
-#include "time_private.h"
 #include <math.h>
 
 double
@@ -43,7 +42,7 @@
        double          d;
 
        /* what is our orbital position? */
-       y = tropical_year;
+       y = 31556926;           /* one tropical year */
        i = *timer % y;
 
        /* convert position to radians */

Modified: trunk/avr-libc/libc/time/strftime.c
===================================================================
--- trunk/avr-libc/libc/time/strftime.c 2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/strftime.c 2013-03-30 11:59:28 UTC (rev 2318)
@@ -32,9 +32,15 @@
        Standard strftime(). This is a memory hungry monster.
 */
 
+#include <stdlib.h>
 #include <stdio.h>
-#include "time_private.h"
+#include <time.h>
 
+extern long     __utc_offset;
+
+//extern int    (*__dst_ptr) (const time_t *, int32_t *);
+
+
 #ifdef __MEMX
 
 const __memx char strfwkdays[] = "Sunday Monday Tuesday Wednesday Thursday 
Friday Saturday ";
@@ -266,7 +272,7 @@
                                break;
 
                        case ('z'):
-                               d = _utc_offset / 60;
+                               d = __utc_offset / 60;
                                w = timeptr->tm_isdst / 60;
                                if (w > 0)
                                        d += w;

Modified: trunk/avr-libc/libc/time/sun_rise.c
===================================================================
--- trunk/avr-libc/libc/time/sun_rise.c 2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/sun_rise.c 2013-03-30 11:59:28 UTC (rev 2318)
@@ -33,7 +33,7 @@
 */
 
 #include <time.h>
-extern long     _longitude;
+extern long     __longitude;
 
 time_t
 sun_rise(time_t * timer)
@@ -49,7 +49,7 @@
        n = daylight_seconds(timer) / 2L;
        t -= n;
 
-       n = _longitude / 15L;
+       n = __longitude / 15L;
        t -= n;
 
        return t;

Modified: trunk/avr-libc/libc/time/sun_set.c
===================================================================
--- trunk/avr-libc/libc/time/sun_set.c  2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/sun_set.c  2013-03-30 11:59:28 UTC (rev 2318)
@@ -33,7 +33,7 @@
 */
 
 #include <time.h>
-extern long     _longitude;
+extern long     __longitude;
 
 time_t
 sun_set(time_t * timer)
@@ -49,7 +49,7 @@
        n = daylight_seconds(timer) / 2L;
        t += n;
 
-       n = _longitude / 15L;
+       n = __longitude / 15L;
        t -= n;
 
        return t;

Modified: trunk/avr-libc/libc/time/system_tick.c
===================================================================
--- trunk/avr-libc/libc/time/system_tick.c      2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/system_tick.c      2013-03-30 11:59:28 UTC (rev 
2318)
@@ -35,6 +35,7 @@
 */
 
 #include <time.h>
+
 extern volatile time_t __system_time;
 
 void

Added: trunk/avr-libc/libc/time/system_time.c
===================================================================
--- trunk/avr-libc/libc/time/system_time.c                              (rev 0)
+++ trunk/avr-libc/libc/time/system_time.c      2013-03-30 11:59:28 UTC (rev 
2318)
@@ -0,0 +1,36 @@
+/*
+ * (c)2012 Michael Duane Rice All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions
+ * and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the copyright holders
+ * nor the names of contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+/*
+       The system time stamp.
+*/
+#include <time.h>
+
+volatile time_t __system_time;

Modified: trunk/avr-libc/libc/time/time.c
===================================================================
--- trunk/avr-libc/libc/time/time.c     2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/time.c     2013-03-30 11:59:28 UTC (rev 2318)
@@ -35,9 +35,8 @@
 #include <time.h>
 #include <inttypes.h>
 
+extern volatile time_t __system_time;
 
-volatile time_t __system_time;
-
 time_t
 time(time_t * timer)
 {

Deleted: trunk/avr-libc/libc/time/time_private.h
===================================================================
--- trunk/avr-libc/libc/time/time_private.h     2013-03-29 21:29:35 UTC (rev 
2317)
+++ trunk/avr-libc/libc/time/time_private.h     2013-03-30 11:59:28 UTC (rev 
2318)
@@ -1,47 +0,0 @@
-/*     (c)2012 Michael Duane Rice
-       All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-
-   * Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-   * Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-   * Neither the name of the copyright holders nor the names of
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  POSSIBILITY OF SUCH DAMAGE. 
-*/
-
-/* $Id$ */
-
-#ifndef TIME_PRIVATE_H
-#define TIME_PRIVATE_H
-
-#include <inttypes.h>
-#include <time.h>
-
-#define ASCTIME_BUFFER_SIZE 26
-
-#define tropical_year 31556926 /* seconds */
-
-int (*_dst_ptr)(const time_t*, int32_t*);
-
-long _utc_offset;
-
-
-#endif
\ No newline at end of file

Added: trunk/avr-libc/libc/time/tm_store.c
===================================================================
--- trunk/avr-libc/libc/time/tm_store.c                         (rev 0)
+++ trunk/avr-libc/libc/time/tm_store.c 2013-03-30 11:59:28 UTC (rev 2318)
@@ -0,0 +1,37 @@
+/*
+ * (c)2012 Michael Duane Rice All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions
+ * and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the copyright holders
+ * nor the names of contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+/*
+       Private allocation, used by gmtime() and localtime()
+*/
+
+#include <time.h>
+
+struct tm       __tm_store;


Property changes on: trunk/avr-libc/libc/time/tm_store.c
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id

Deleted: trunk/avr-libc/libc/time/tm_store.h
===================================================================
--- trunk/avr-libc/libc/time/tm_store.h 2013-03-29 21:29:35 UTC (rev 2317)
+++ trunk/avr-libc/libc/time/tm_store.h 2013-03-30 11:59:28 UTC (rev 2318)
@@ -1,40 +0,0 @@
-/*     (c)2012 Michael Duane Rice
-       All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-
-   * Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-   * Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-   * Neither the name of the copyright holders nor the names of
-     contributors may be used to endorse or promote products derived
-     from this software without specific prior written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  POSSIBILITY OF SUCH DAMAGE. 
-*/
-
-/* $Id$ */
-
-/*
-       Private allocation, used by gmtime() and localtime()
-*/
-#ifndef TM_STORE_H
-#define TM_STORE_H
-
-struct tm __tm_store;
-
-#endif
\ No newline at end of file

Added: trunk/avr-libc/libc/time/utc_offset.c
===================================================================
--- trunk/avr-libc/libc/time/utc_offset.c                               (rev 0)
+++ trunk/avr-libc/libc/time/utc_offset.c       2013-03-30 11:59:28 UTC (rev 
2318)
@@ -0,0 +1,35 @@
+/*
+ * (c)2012 Michael Duane Rice All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions
+ * and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the copyright holders
+ * nor the names of contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+/*
+       UTC offset in seconds East
+*/
+
+long            __utc_offset;


Property changes on: trunk/avr-libc/libc/time/utc_offset.c
___________________________________________________________________
Added: svn:keywords
   + Id




reply via email to

[Prev in Thread] Current Thread [Next in Thread]