Improve chance to generate unique names with less effort a bit.

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.
This commit is contained in:
Tor Lillqvist 2000-11-11 13:46:15 +00:00 committed by Tor Lillqvist
parent 40cfd305c2
commit 4f76917c6a
21 changed files with 161 additions and 18 deletions

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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)
{

View 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

View 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)
{

View 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

View 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

View 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

View 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

View File

@ -17,6 +17,8 @@
* Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include "gtypeplugin.h"
#include "gtypemodule.h"

View File

@ -38,6 +38,7 @@ gobject_OBJECTS = \
gparamspecs.o \
gsignal.o \
gtype.o \
gtypemodule.o \
gtypeplugin.o \
gvalue.o \
gvaluetypes.o

View File

@ -29,6 +29,7 @@ gobject_OBJECTS = \
gparamspecs.obj \
gsignal.obj \
gtype.obj \
gtypemodule.obj \
gtypeplugin.obj \
gvalue.obj \
gvaluetypes.obj

View 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

View File

@ -24,13 +24,24 @@
* 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;

View File

@ -24,13 +24,24 @@
* 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;