s/time_t/GTime/ and s/g_print/g_message/ include time.h.

Wed Dec  2 02:10:59 1998  Tim Janik  <timj@gtk.org>

        * gdate.c: s/time_t/GTime/ and s/g_print/g_message/
        include time.h.

        * glib.h: removed #include <time.h>, changed time_t paramter of
        g_date_set_time() to time_t, changed struct tm parameter of
        g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
        nice, but including time.h actually breaks a bunch of code.
This commit is contained in:
Tim Janik 1998-12-02 02:24:14 +00:00 committed by Tim Janik
parent a3e59c3ebf
commit 2886be294a
13 changed files with 523 additions and 419 deletions

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -1,3 +1,15 @@
Wed Dec 2 02:10:59 1998 Tim Janik <timj@gtk.org>
* gdate.c: s/time_t/GTime/ and s/g_print/g_message/
include time.h.
* glib.h: removed #include <time.h>, changed time_t paramter of
g_date_set_time() to time_t, changed struct tm parameter of
g_date_to_struct_tm to `gpointer struct_tm_p'. yes, this is not
nice, but including time.h actually breaks a bunch of code.
* incremented GLib version to 1.1.6.
1998-11-30 Havoc Pennington <hp@pobox.com> 1998-11-30 Havoc Pennington <hp@pobox.com>
* gdate.c: New file, implements calendrical calculations. * gdate.c: New file, implements calendrical calculations.

View File

@ -18,7 +18,7 @@ cflags_set=${CFLAGS+set}
# #
GLIB_MAJOR_VERSION=1 GLIB_MAJOR_VERSION=1
GLIB_MINOR_VERSION=1 GLIB_MINOR_VERSION=1
GLIB_MICRO_VERSION=5 GLIB_MICRO_VERSION=6
GLIB_INTERFACE_AGE=0 GLIB_INTERFACE_AGE=0
GLIB_BINARY_AGE=0 GLIB_BINARY_AGE=0
GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION

26
gdate.c
View File

@ -18,6 +18,7 @@
*/ */
#include "glib.h" #include "glib.h"
#include <time.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
@ -603,16 +604,16 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt)
} }
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
g_print ("\n**GDate prepared a new set of locale-specific parse rules.\n"); g_message ("**GDate prepared a new set of locale-specific parse rules.");
i = 1; i = 1;
while (i < 13) while (i < 13)
{ {
g_print (" %s %s\n", long_month_names[i], short_month_names[i]); g_message (" %s %s", long_month_names[i], short_month_names[i]);
++i; ++i;
} }
if (using_twodigit_years) if (using_twodigit_years)
{ {
g_print ("**Using twodigit years with cutoff year: %u\n", twodigit_start_year); g_message ("**Using twodigit years with cutoff year: %u", twodigit_start_year);
} }
{ {
gchar *strings[3]; gchar *strings[3];
@ -636,8 +637,8 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt)
} }
++i; ++i;
} }
g_print ("**Order: %s, %s, %s\n", strings[0], strings[1], strings[2]); g_message ("**Order: %s, %s, %s", strings[0], strings[1], strings[2]);
g_print ("**Sample date in this locale: `%s'\n\n", buf); g_message ("**Sample date in this locale: `%s'", buf);
} }
#endif #endif
} }
@ -660,7 +661,7 @@ g_date_set_parse (GDate *d,
g_date_prepare_to_parse (str, &pt); g_date_prepare_to_parse (str, &pt);
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
g_print ("Found %d ints, `%d' `%d' `%d' and written out month %d\n", g_message ("Found %d ints, `%d' `%d' `%d' and written out month %d",
pt.num_ints, pt.n[0], pt.n[1], pt.n[2], pt.month); pt.num_ints, pt.n[0], pt.n[1], pt.n[2], pt.month);
#endif #endif
@ -779,13 +780,15 @@ g_date_set_parse (GDate *d,
} }
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
else else
g_print ("Rejected MDY %u %u %u\n", m, day, y); g_message ("Rejected MDY %u %u %u", m, day, y);
#endif #endif
} }
void void
g_date_set_time (GDate *d, time_t t) g_date_set_time (GDate *d,
GTime time)
{ {
time_t t = time;
struct tm *tm; struct tm *tm;
g_return_if_fail (d != NULL); g_return_if_fail (d != NULL);
@ -1209,13 +1212,16 @@ g_date_compare (GDate *lhs,
void void
g_date_to_struct_tm (GDate *d, g_date_to_struct_tm (GDate *d,
struct tm *tm) gpointer struct_tm_p)
{ {
GDateWeekday day; GDateWeekday day;
struct tm *tm;
g_return_if_fail (d != NULL); g_return_if_fail (d != NULL);
g_return_if_fail (g_date_valid (d)); g_return_if_fail (g_date_valid (d));
g_return_if_fail (tm != NULL); g_return_if_fail (struct_tm_p != NULL);
tm = struct_tm_p;
if (!d->mdy) if (!d->mdy)
{ {

6
glib.h
View File

@ -2039,8 +2039,6 @@ void g_completion_free (GCompletion* cmp);
* Pennington <hp@pobox.com> * Pennington <hp@pobox.com>
*/ */
#include <time.h>
/* this enum is used to specify order of appearance in parsed date /* this enum is used to specify order of appearance in parsed date
* strings * strings
*/ */
@ -2172,7 +2170,7 @@ void g_date_set_parse (GDate *d,
const gchar *str); const gchar *str);
void g_date_set_time (GDate *d, void g_date_set_time (GDate *d,
time_t t); GTime time);
void g_date_set_month (GDate *d, void g_date_set_month (GDate *d,
GDateMonth m); GDateMonth m);
@ -2222,7 +2220,7 @@ gint g_date_compare (GDate *lhs,
void g_date_to_struct_tm (GDate *d, void g_date_to_struct_tm (GDate *d,
struct tm *tm); gpointer struct_tm_p);
/* Just like strftime() except you can only use date-related formats. /* Just like strftime() except you can only use date-related formats.
* Using a time format is undefined. * Using a time format is undefined.

View File

@ -18,6 +18,7 @@
*/ */
#include "glib.h" #include "glib.h"
#include <time.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
@ -603,16 +604,16 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt)
} }
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
g_print ("\n**GDate prepared a new set of locale-specific parse rules.\n"); g_message ("**GDate prepared a new set of locale-specific parse rules.");
i = 1; i = 1;
while (i < 13) while (i < 13)
{ {
g_print (" %s %s\n", long_month_names[i], short_month_names[i]); g_message (" %s %s", long_month_names[i], short_month_names[i]);
++i; ++i;
} }
if (using_twodigit_years) if (using_twodigit_years)
{ {
g_print ("**Using twodigit years with cutoff year: %u\n", twodigit_start_year); g_message ("**Using twodigit years with cutoff year: %u", twodigit_start_year);
} }
{ {
gchar *strings[3]; gchar *strings[3];
@ -636,8 +637,8 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt)
} }
++i; ++i;
} }
g_print ("**Order: %s, %s, %s\n", strings[0], strings[1], strings[2]); g_message ("**Order: %s, %s, %s", strings[0], strings[1], strings[2]);
g_print ("**Sample date in this locale: `%s'\n\n", buf); g_message ("**Sample date in this locale: `%s'", buf);
} }
#endif #endif
} }
@ -660,7 +661,7 @@ g_date_set_parse (GDate *d,
g_date_prepare_to_parse (str, &pt); g_date_prepare_to_parse (str, &pt);
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
g_print ("Found %d ints, `%d' `%d' `%d' and written out month %d\n", g_message ("Found %d ints, `%d' `%d' `%d' and written out month %d",
pt.num_ints, pt.n[0], pt.n[1], pt.n[2], pt.month); pt.num_ints, pt.n[0], pt.n[1], pt.n[2], pt.month);
#endif #endif
@ -779,13 +780,15 @@ g_date_set_parse (GDate *d,
} }
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
else else
g_print ("Rejected MDY %u %u %u\n", m, day, y); g_message ("Rejected MDY %u %u %u", m, day, y);
#endif #endif
} }
void void
g_date_set_time (GDate *d, time_t t) g_date_set_time (GDate *d,
GTime time)
{ {
time_t t = time;
struct tm *tm; struct tm *tm;
g_return_if_fail (d != NULL); g_return_if_fail (d != NULL);
@ -1209,13 +1212,16 @@ g_date_compare (GDate *lhs,
void void
g_date_to_struct_tm (GDate *d, g_date_to_struct_tm (GDate *d,
struct tm *tm) gpointer struct_tm_p)
{ {
GDateWeekday day; GDateWeekday day;
struct tm *tm;
g_return_if_fail (d != NULL); g_return_if_fail (d != NULL);
g_return_if_fail (g_date_valid (d)); g_return_if_fail (g_date_valid (d));
g_return_if_fail (tm != NULL); g_return_if_fail (struct_tm_p != NULL);
tm = struct_tm_p;
if (!d->mdy) if (!d->mdy)
{ {

View File

@ -2039,8 +2039,6 @@ void g_completion_free (GCompletion* cmp);
* Pennington <hp@pobox.com> * Pennington <hp@pobox.com>
*/ */
#include <time.h>
/* this enum is used to specify order of appearance in parsed date /* this enum is used to specify order of appearance in parsed date
* strings * strings
*/ */
@ -2172,7 +2170,7 @@ void g_date_set_parse (GDate *d,
const gchar *str); const gchar *str);
void g_date_set_time (GDate *d, void g_date_set_time (GDate *d,
time_t t); GTime time);
void g_date_set_month (GDate *d, void g_date_set_month (GDate *d,
GDateMonth m); GDateMonth m);
@ -2222,7 +2220,7 @@ gint g_date_compare (GDate *lhs,
void g_date_to_struct_tm (GDate *d, void g_date_to_struct_tm (GDate *d,
struct tm *tm); gpointer struct_tm_p);
/* Just like strftime() except you can only use date-related formats. /* Just like strftime() except you can only use date-related formats.
* Using a time format is undefined. * Using a time format is undefined.