Improve chance to generate unique names with less effort a bit.
authorTor Lillqvist <tml@iki.fi>
Sat, 11 Nov 2000 13:46:15 +0000 (13:46 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 11 Nov 2000 13:46:15 +0000 (13:46 +0000)
2000-11-11  Tor Lillqvist  <tml@iki.fi>

* gfileutils.c (g_mkstemp): Improve chance to generate unique
names with less effort a bit.

* gfileutils.h: Add g_file_open_tmp() declaration.

* testglib.c: Include <io.h> on Win32.

* makefile.mingw.in: Correct the way to invoke sub-makes.

2000-11-11  Tor Lillqvist  <tml@iki.fi>

* gtypemodule.c: Include stdlib.h for exit().

* makefile.{mingw,msc}.in (gobject_OBJECTS): Add gtypemodule.

* gobject.def: Add new functions.

21 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gfileutils.c
gfileutils.h
glib/gfileutils.c
glib/gfileutils.h
glib/makefile.mingw.in
gobject/ChangeLog
gobject/gobject.def
gobject/gtypemodule.c
gobject/makefile.mingw.in
gobject/makefile.msc.in
makefile.mingw.in
testglib.c
tests/testglib.c

index 9bbe5e2..8b8d153 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index 9bbe5e2..8b8d153 100644 (file)
@@ -1,3 +1,14 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gfileutils.c (g_mkstemp): Improve chance to generate unique
+       names with less effort a bit.
+
+       * gfileutils.h: Add g_file_open_tmp() declaration.
+
+       * testglib.c: Include <io.h> on Win32.
+
+       * makefile.mingw.in: Correct the way to invoke sub-makes.
+
 Sun Nov  5 13:20:54 2000  Owen Taylor  <otaylor@redhat.com>
 
        * glib-object.h: Add gtypemodule.h
index c8bb0a7..b897e1b 100644 (file)
@@ -538,6 +538,7 @@ g_mkstemp (char *tmpl)
   static const int NLETTERS = sizeof (letters) - 1;
   glong value;
   GTimeVal tv;
+  static int counter = 0;
 
   len = strlen (tmpl);
   if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
@@ -548,7 +549,7 @@ g_mkstemp (char *tmpl)
 
   /* Get some more or less random data.  */
   g_get_current_time (&tv);
-  value = tv.tv_usec ^ tv.tv_sec;
+  value = (tv.tv_usec ^ tv.tv_sec) + counter++;
 
   for (count = 0; count < 100; value += 7777, ++count)
     {
index dba134e..0e80543 100644 (file)
@@ -81,7 +81,12 @@ gboolean g_file_get_contents (const gchar  *filename,
 
 
 /* Wrapper / workalike for mkstemp() */
-int     g_mkstemp (char *tmpl);
+int     g_mkstemp            (char         *tmpl);
+
+/* Wrapper for g_mkstemp */
+int     g_file_open_tmp      (const char   *template,
+                             char        **name_used,
+                             GError      **error);
 
 G_END_DECLS
 
index c8bb0a7..b897e1b 100644 (file)
@@ -538,6 +538,7 @@ g_mkstemp (char *tmpl)
   static const int NLETTERS = sizeof (letters) - 1;
   glong value;
   GTimeVal tv;
+  static int counter = 0;
 
   len = strlen (tmpl);
   if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
@@ -548,7 +549,7 @@ g_mkstemp (char *tmpl)
 
   /* Get some more or less random data.  */
   g_get_current_time (&tv);
-  value = tv.tv_usec ^ tv.tv_sec;
+  value = (tv.tv_usec ^ tv.tv_sec) + counter++;
 
   for (count = 0; count < 100; value += 7777, ++count)
     {
index dba134e..0e80543 100644 (file)
@@ -81,7 +81,12 @@ gboolean g_file_get_contents (const gchar  *filename,
 
 
 /* Wrapper / workalike for mkstemp() */
-int     g_mkstemp (char *tmpl);
+int     g_mkstemp            (char         *tmpl);
+
+/* Wrapper for g_mkstemp */
+int     g_file_open_tmp      (const char   *template,
+                             char        **name_used,
+                             GError      **error);
 
 G_END_DECLS
 
index 5e7c948..2ae090a 100644 (file)
@@ -24,10 +24,9 @@ DEPCFLAGS = $(LIBICONV_CFLAGS)
 
 DLLS_TO_BUILD =                                \
        glib-$(GLIB_VER).dll            \
-       gmodule/gmodule-$(GLIB_VER).dll \
-       gthread/gthread-$(GLIB_VER).dll \
-       gobject/gobject-$(GLIB_VER).dll
-
+       sub-gmodule                     \
+       sub-gthread                     \
+       sub-gobject
 
 all :                          \
        config.h                \
@@ -102,13 +101,13 @@ gspawn-win32-helper.exe : gspawn-win32.c
 
 ################ subdirectories
 
-gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+sub-gmodule :
        cd gmodule && $(MAKE) -f makefile.mingw all
 
-gthread/gthread-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+sub-gthread :
        cd gthread && $(MAKE) -f makefile.mingw all
 
-gobject/gobject-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+sub-gobject :
        cd gobject && $(MAKE) -f makefile.mingw all
 
 ################ test progs
index f8a0f79..6443eb9 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-11  Tor Lillqvist  <tml@iki.fi>
+
+       * gtypemodule.c: Include stdlib.h for exit().
+
+       * makefile.{mingw,msc}.in (gobject_OBJECTS): Add gtypemodule.
+
+       * gobject.def: Add new functions.
+
 Sun Nov  5 13:21:28 2000  Owen Taylor  <otaylor@redhat.com>
 
        * Makefile.am gtypemodule.[ch]: New basic implementation of
index c0bb1f3..ca84959 100644 (file)
@@ -110,9 +110,20 @@ EXPORTS
        g_type_interface_peek
        g_type_interfaces
        g_type_is_a
+       g_type_module_add_interface
+       g_type_module_get_type
+       g_type_module_register_type
+       g_type_module_set_name
+       g_type_module_unuse
+       g_type_module_use
        g_type_name
        g_type_next_base
        g_type_parent
+       g_type_plugin_complete_interface_info
+       g_type_plugin_complete_type_info
+       g_type_plugin_get_type
+       g_type_plugin_unuse
+       g_type_plugin_use
        g_type_qname
        g_type_register_dynamic
        g_type_register_fundamental
index 32f07f7..4e5848e 100644 (file)
@@ -17,6 +17,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <stdlib.h>
+
 #include "gtypeplugin.h"
 #include "gtypemodule.h"
 
index eccd5b6..a0f0669 100644 (file)
@@ -38,6 +38,7 @@ gobject_OBJECTS =             \
        gparamspecs.o           \
        gsignal.o               \
        gtype.o                 \
+       gtypemodule.o           \
        gtypeplugin.o           \
        gvalue.o                \
        gvaluetypes.o
index eb69589..db24b23 100644 (file)
@@ -29,6 +29,7 @@ gobject_OBJECTS =             \
        gparamspecs.obj         \
        gsignal.obj             \
        gtype.obj               \
+       gtypemodule.obj         \
        gtypeplugin.obj         \
        gvalue.obj              \
        gvaluetypes.obj
index 5e7c948..2ae090a 100644 (file)
@@ -24,10 +24,9 @@ DEPCFLAGS = $(LIBICONV_CFLAGS)
 
 DLLS_TO_BUILD =                                \
        glib-$(GLIB_VER).dll            \
-       gmodule/gmodule-$(GLIB_VER).dll \
-       gthread/gthread-$(GLIB_VER).dll \
-       gobject/gobject-$(GLIB_VER).dll
-
+       sub-gmodule                     \
+       sub-gthread                     \
+       sub-gobject
 
 all :                          \
        config.h                \
@@ -102,13 +101,13 @@ gspawn-win32-helper.exe : gspawn-win32.c
 
 ################ subdirectories
 
-gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+sub-gmodule :
        cd gmodule && $(MAKE) -f makefile.mingw all
 
-gthread/gthread-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+sub-gthread :
        cd gthread && $(MAKE) -f makefile.mingw all
 
-gobject/gobject-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+sub-gobject :
        cd gobject && $(MAKE) -f makefile.mingw all
 
 ################ test progs
index 3eedc81..2f7b615 100644 (file)
  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include "config.h"
+
 #undef G_LOG_DOMAIN
 
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+
 #include "glib.h"
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef G_OS_WIN32
+#include <io.h>                        /* For read(), write() etc */
+#endif
+
 int array[10000];
 gboolean failed = FALSE;
 
index 3eedc81..2f7b615 100644 (file)
  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include "config.h"
+
 #undef G_LOG_DOMAIN
 
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+
 #include "glib.h"
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef G_OS_WIN32
+#include <io.h>                        /* For read(), write() etc */
+#endif
+
 int array[10000];
 gboolean failed = FALSE;