1. 04 Sep, 2001 1 commit
    • Tor Lillqvist's avatar
      Update. Don't mention pthreads. · 07741c07
      Tor Lillqvist authored
      
      2001-09-04  Tor Lillqvist  <tml@iki.fi>
      
      	* README.win32: Update. Don't mention pthreads.
      
      	* build-dll: Remove, moved to the build module.
      
      	* glibconfig.h.win32.in: Don't mention pthreds here, either.
      
      	* glib/gstrfuncs.c: Mark the correct variable for export from DLL.
      
      	* glib/giowin32.c (g_io_win32_msg_create_watch): Owen forgot to
      	rename the win32_watch_funcs variable here, too.
      
      	* */makefile.mingw.in: Don't use version number in import library
      	name. Use whole version number in DLL name. Use build-dll from the
      	build module.
      07741c07
  2. 03 Sep, 2001 1 commit
    • Owen Taylor's avatar
      Add closure_marshal/closure_callback fields to GSourceFuncs for use by · b4c3107c
      Owen Taylor authored
      Mon Aug 27 14:56:12 2001  Owen Taylor  <otaylor@redhat.com>
      
      	* glib/gmain.h: Add closure_marshal/closure_callback
      	fields to GSourceFuncs for use by g_source_set_closure().
      
      	* glib/gmain.c glib/giounix.c glib/giowin32.c
      	  glib/gmain.h: Export the SourceFuncs vtables so GObject
      	can use them to figure out closure callbacks/marshallers
      	for the default source types.
      
      Mon Aug 27 14:55:27 2001  Owen Taylor  <otaylor@redhat.com>
      
      	* gsourceclosure.[ch] (g_source_set_closure): Implement.
      
      	* gsourceclosure.[ch]: Add GType's for GIOChannel, GIOCondition.
      b4c3107c
  3. 22 Jul, 2001 1 commit
    • Hans Breuer's avatar
      make the code actually have an effect (Use |= to set bits). Not absolutely · 371fe042
      Hans Breuer authored
      2001-07-22  Hans Breuer  <hans@breuer.org>
      
      	* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
      	the code actually have an effect (Use |= to set bits). Not
      	absolutely sure if is the right one.
      
      	* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
      	watch->condition but restored the previous behaviour.
      	Now gio-test as well as The Gimp work again ...
      371fe042
  4. 21 Jul, 2001 2 commits
  5. 20 Jul, 2001 2 commits
    • Ron Steinke's avatar
      Modified Files: glib/ChangeLog glib/glib.def glib/glib/giochannel.c · e070fdea
      Ron Steinke authored
           Modified Files:
       	glib/ChangeLog glib/glib.def glib/glib/giochannel.c
       	glib/glib/giochannel.h glib/glib/giounix.c
       	glib/glib/giowin32.c
       	glib/docs/reference/glib/glib-sections.txt
       	glib/tests/iochannel-test.c glib/tests/unicode-collate.c
       	glib/tests/unicode-normalize.c
           Added Files:
       	glib/tests/iochannel-test-infile
      
              * glib/giochannel.c: API changes, fixes to
              error handling, some internal restructuring
              * glib/giochannel.h: API changes, documentation for
              elements in GIOChannel structure
              * glib/giounix.c: Matched API changes, implemented
              backend to set is_readable, is_writeable, is_seekable
              flags, added a test to catch large values of count
              for which the behavior of write() is undefined
              * glib/giowin32.c: Changed to match new prototypes for
              io_close() and io_seek(), removed references to
              G_IO_STATUS_INTR, set is_seekable flag in channel
              creation functions
              * glib.def: Renamed g_channel_error_quark() and
              g_channel_error_from_errno() to g_io_channel_error_quark() and
              g_io_channel_error_from_errno(); added new functions
              g_io_channel_get_buffered() and g_io_channel_set_buffered()
              * docs/reference/glib/glib-sections.txt: Modified iochannel
              section to reflect new functions and API changes
              * tests/iochannel-test.c: Fixed to work with API changes
              * tests/iochannel-test-infile: New file; input file
              for iochannel-test
              * tests/unicode-collate.c tests/unicode-normalize.c:
              Changed G_IO_FILE_MODE_READ to "r" to match API change
      e070fdea
    • Hans Breuer's avatar
      make it compile again · 847d8e92
      Hans Breuer authored
      2001-07-20  Hans Breuer  <hans@breuer.org>
      
      	* glib/glib/giowin32.c : make it compile again
      
      	* glib/glib.def : updated exports
      
      	* glib/makefile.msc.in :
      	* glib/makefile.mingw.in :
      	* tests/makefile.msc.in : reflect glib move
      
      	* tests/mainloop-test.c : #include <io.h> for _pipe()
      
      	* tests/gio-test.c : casts for strict compiler settings
      
      	* makefile.msc.in : new master makefile reflecting the glib
      	move. The '.in' isn't really needed anymore, because there
      	is no version number in it
      847d8e92
  6. 02 Jul, 2001 1 commit
  7. 30 Jun, 2001 2 commits
    • Owen Taylor's avatar
      Rename GSourceFuncs::destroy to GSourceFuncs::finalize. (#56858) · b37e7bbb
      Owen Taylor authored
      Sat Jun 30 16:03:16 2001  Owen Taylor  <otaylor@redhat.com>
      
      	* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
      	Rename GSourceFuncs::destroy to GSourceFuncs::finalize.
      	(#56858)
      b37e7bbb
    • Owen Taylor's avatar
      Jun 29 13:36:39 2001 Owen Taylor <otaylor@redhat.com> · 42a23950
      Owen Taylor authored
              * glib/gstring.[ch] (g_string_set_size): Add function to
              allow setting the length of a string greater than the
              current length (for buffering usage)
      
              * glib/gstring.[ch]: Expose string->allocated_len, since
              that is useful when using GString simply as a buffer.
              (Renamed from string->alloc)
      
              * glib/giochannel.[ch] glib/giounix.c glib/giowin32.c:
              Major patch from Hidetoshi Tajima and Ron Steinke
              reworking GIOChannel to have:
      
               - Buffering
               - Sane and useful error reporting
               - Streaming encoding conversion with iconv
               - Convenience functions to read by lines or
                 an entire file.
      
              Also fix remaining 64 bit cleanliness issues.
      
              * tests/iochannel-test.c tests/Makefile.am: Test case
              for IO channel streaming conversion. Still needs
              some fixing up.
      42a23950
  8. 22 Jun, 2001 1 commit
  9. 22 May, 2001 1 commit
  10. 01 Feb, 2001 1 commit
  11. 25 Jan, 2001 1 commit
    • Tor Lillqvist's avatar
      Socket support rewritten. It was utterly broken, and untested in fact. We · 8a0df0a7
      Tor Lillqvist authored
      2001-01-25  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c: Socket support rewritten. It was utterly broken, and
      	untested in fact. We still do use a thread for each socket being
      	watched, but instead of blocking in recv() (which of course was
      	plain stupid for sockets being liste()ed on), we block in
      	select(). The read method for sockets calls recv(). It is now
      	possible for the application to call accept(), recv() or send() in
      	the callback, just like on Unix. Tested with code kindly provided
      	by Andrew Lanoix.
      
      	Rename g_io_channel_win32_new_stream_socket() to
      	g_io_channel_win32_new_socket() as it isn't restricted to stream
      	sockets.
      
      	* gmain.c (g_poll): Related changes in the Win32 version of
      	g_poll(). When polling for messages, always do a PeekMessage()
      	first. We used to miss messages if several were posted between
      	calls to g_poll().
      
      	* giochannel.h: Improve Win32-related comments.
      
      	* gutf8.c: (Win32) Include <stdio.h> for sprintf.
      
      	* tests/gio-test.c: (Win32) Add tests for polling for Windows
      	messages.
      
      	* tests/makefile.mingw.in: Remove superfluous compilation command
      	line.
      8a0df0a7
  12. 09 Jan, 2001 1 commit
    • Tor Lillqvist's avatar
      Rework the changes to needed to pass mainloop-test. Now we don't need to · 9d27e6b7
      Tor Lillqvist authored
      2001-01-09  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c (create_reader_thread): Rework the changes to
      	needed to pass mainloop-test. Now we don't need to call
      	TerminateThread() after all, which is a relief, as the docs
      	have a BIG RED WARNING SIGN about using that API. Instead,
      	when closing a fd channel that has a reader thread running,
      	just mark it as non-running and additionally mark the fd as
      	ripe for closing. When the reader thread hopefully eventually
      	gets something (and EOF or some actual data), it will note
      	that it shouldn't be running, break out of the loop, and close
      	the fd.
      
      	The socket channel closing code should probably be changed
      	similarily, but that will have to wait until I have a test case.
      
      	(g_pipe_readable_msg, g_io_channel_win32_new_pipe,
      	g_io_channel_win32_new_pipe_with_wakeups,
      	g_io_channel_win32_pipe_request_wakeups,
      	g_io_channel_win32_pipe_readable): Remove these, have been
      	obsolete for some time.
      
      	* glib.def: Update.
      9d27e6b7
  13. 06 Jan, 2001 1 commit
    • Tor Lillqvist's avatar
      Get len using strlen() if arg is negative in the Win32 code, too. · deb68e15
      Tor Lillqvist authored
      2001-01-06  Tor Lillqvist  <tml@iki.fi>
      
      	* gconvert.c (g_locale_to_utf8, g_locale_from_utf8): Get len using
      	strlen() if arg is negative in the Win32 code, too.
      
      	* giowin32.c: Changes necessary to be able to run
      	mainloop-test. We can't close the fd that our (internal) reader
      	thread is sitting doing a blocking read() from. We must terminate
      	the thread first. Keep track of thread handle, and close it when
      	thread is dying. Start reader thread with the lower-level
      	CreateThread() instead of _beginthreadex() from the C runtime, in
      	order to be able to use TerminateThread(). Hopefuly this isn't
      	harmful.
      
      	* glib.def: Update.
      
      	* tests/makefile.{mingw,msc}.in (TESTS): Add mainloop-test and
      	unicode-encoding.
      
      	* tests/mainloop-test.c: Portability: <unistd.h>, need <fcntl.h>
      	on Win32.
      
      	* tests/unicode-encoding.c (process): Add missing "line" argument
      	to fail(). On Win32, convert UTF-16LE, as libiconv'c ivonf always
      	converts to UTF-16BE if we ask for unspecific UTF-16.
      	(main) Handle also '\r'.
      deb68e15
  14. 14 Dec, 2000 1 commit
    • Tor Lillqvist's avatar
      Warn if no callback. Call callback correctly. (g_io_win32_create_watch): · b74e7d2f
      Tor Lillqvist authored
      2000-12-14  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c (g_io_win32_dispatch): Warn if no callback. Call
      	callback correctly.
      	(g_io_win32_create_watch): Fix typo.
      	(g_io_win32_fd_create_watch): Ditto.
      	(g_io_channel_unix_new): If it is a file descriptor (i.e., a Unix
      	fd lookalike provided by the C library), call
      	g_io_channel_win32_new_fd(). If it is a socket (from WinSock),
      	call g_io_cahnnel_win32_new_stream_socket(). Hopefully sockets and
      	fds don't overlap. TODO: Implement also datagram sockets.
      	(g_io_channel_win32_poll): Call g_main_context_get_poll_func().
      
      	* gcompletion.h: Include <unistd.h> only on Unix. Is this
      	inclusion really needed here? OTOH, do include <stddef.h>, for
      	size_t.
      
      	* gmessages.c: (Win32) Don't define a function called "write" that
      	might clash with the prototype from <io.h>, use a #define.
      
      	* glib.def: Update.
      
      	* gmain.c (g_source_add_poll): Don't return a value from void
      	function.
      	(g_main_context_get_poll_func): Compile also for non-Win32, as
      	presumably was intended. The result var is a GPollFunc, not a
      	GPollFunc*. Return the result!
      
      gobject:
      
       2000-12-14  Tor Lillqvist  <tml@iki.fi>
      
      	* makefile.mingw.in: Update, include parts from Makefile.am to
      	build gmarshal.[ch]. Some day, we won't need these separate
      	makefiles for Win32 compilation. I hope.
      
      	* makefile.msc.in: Update. No use trying to build gmarshal.[ch]
      	here, it would require Unixish tools. MSVC users building from CVS
      	sources are out of luck.
      
      	* gobject.def: Update.
      b74e7d2f
  15. 05 Dec, 2000 1 commit
    • Owen Taylor's avatar
      Major change in API for creating sources to handle multiple main loops · e2fd4e2b
      Owen Taylor authored
      Tue Dec  5 12:23:04 2000  Owen Taylor  <otaylor@redhat.com>
      
              * gmain.[hc]: Major change in API for creating sources
      	to handle multiple main loops (GMainContext *).
      
      	GSources are now exposed as GSource * and implemented
      	with structure derivation.
      
      	* giochannel.[ch]: Changed vtable for GIOChannel to correspond
      	to the new mainloop API, add g_io_channel_create_watch().
      
      	* gtypes.h: Move GTimeVal here.
      
      	* gthread.h: Remove gmain.h include to avoid circularity.
      
              * giounix.c: Update for new GMain API.
      
      	* giowin32.c: Update for new GMain API. (No check for
      	proper compilation or working.)
      
      	* timeloop.c timeloop-basic.c: A benchmarking program for
      	the main loop comparing the main loop against a
      	hand-written (timeloop-basic.c) variant.
      
      	* tests/mainloop-test.c: New torture test of mainloop.
      
      	* docs/Changes-2.0.txt: Started. Added text about
      	changes to GMain.
      
      	* gmain.c (g_main_add_poll_unlocked): Initial fd->revents
      	to zero. (#8482, Benjamin Kahn)
      e2fd4e2b
  16. 16 Oct, 2000 1 commit
    • Tor Lillqvist's avatar
      Some more debugging output. (g_io_channel_win32_poll): Remove unused vars. · fb4de1c5
      Tor Lillqvist authored
      2000-10-16  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c (reader_thread): Some more debugging output.
      	(g_io_channel_win32_poll): Remove unused vars.
      
      	* gfileutils.c: Changes for Win32, with no unistd.h and no
      	S_ISLNK().
      
      	* gspawn-win32.c: Implementation of the g_spwan_* functions for
      	Win32. Due to the general non-Unixness of Win32, much of the
      	functionality that is relatively clean to implement on Unix, is
      	hard to do on Win32. We must use a separate helper program to
      	change directory, close extra file descriptors, redirect the std
      	ones, as needed, and only then start the child process. No child
      	process pid can be returned, unfortunately. Or if we used
      	CreateProcess directly, it probably could. (Now we use the spawnv*
      	functions from msvcrt.)
      
      	* glib.def: Add new entry points.
      
      	* glib.def
      	* giowin32.c: Remove g_io_channel_win32_wait_for_condition(),
      	g_io_channel_win32_poll() subsumes it.
      
      	* gbacktrace.h: G_BREAKPOINT for MSVC (on the ix86).
      
      	* gwin32.c (g_win32_getlocale): Use "sp" for
      	LANG_CROATIAN+SUBLANG_SERBIAN_LATIN.
      
      	* makefile.{mingw,msc}.in (glib_OBJECTS): Add new files.
      	Add gspawn-win32-helper.exe rule.
      
      	* tests/makefile.{mingw,msc}.in (TESTS): Add shell-test and
      	spawn-test.
      
      	* tests/spawn-test.c: (run_tests): On Win32, don't try to run
      	/bin/sh, but ipconfig (no special significance in choosing that,
      	just a program that outputs something to stdout).
      fb4de1c5
  17. 06 Oct, 2000 1 commit
    • Tor Lillqvist's avatar
      Revamp to be like makefile.mingw.in, make the MSVC build actually work · 8e847255
      Tor Lillqvist authored
      2000-10-06  Tor Lillqvist  <tml@iki.fi>
      
      	* makefile.msc.in: Revamp to be like makefile.mingw.in, make
      	the MSVC build actually work again.
      
      	* gmodule/makefile.msc.in
      	* gobject/makefile.msc.in
      	* gthread/makefile.msc.in: New files, like their mingw counterparts.
      
      	* gmodule/Makefile.am
      	* gobject/Makefile.am
      	* gthread/Makefile.am: Make and distribute them.
      
      	* */makefile.mingw.in: Allow override of GLib version number from
      	the build/win32/module.defs file.
      
      	* glib.def: Add new entry point.
      
      	Fixes from Hans Breuer:
      
      	* glib.h (struct DIR): Keep the last readdir result cached inside
      	the DIR struct, to enable several DIRs being open simultaneously.
      
      	* gwin32.c (g_win32_readdir): Use the above instead of static.
      
      	* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
      	MSVC happy.
      8e847255
  18. 31 Aug, 2000 2 commits
  19. 27 Aug, 2000 2 commits
  20. 11 Aug, 2000 1 commit
    • Tor Lillqvist's avatar
      Some indentation and spacing fixes. Add some more logging. · f17ed7ee
      Tor Lillqvist authored
      2000-08-12  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c: Some indentation and spacing fixes. Add some more
      	logging.
      	(g_io_win32_add_watch): New function, with common code from
      	g_io_win32_fd_add_watch and g_io_win32_sock_add_watch. Don't start
      	more than one reader thread for a GIOChannel. We should obviously
      	have just one reader thread reading a file descriptor or socket.
      f17ed7ee
  21. 31 Jul, 2000 2 commits
    • Tor Lillqvist's avatar
      Drop a few unused variables. · c58440ec
      Tor Lillqvist authored
      c58440ec
    • Tor Lillqvist's avatar
      The code didn't compile (must have been sleepy when committing). "return" · beed3997
      Tor Lillqvist authored
      2000-07-31  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c (buffer_read): The code didn't compile (must
      	have been sleepy when committing). "return" instead of "break"
      
      	(g_io_win32_fd_add_watch): Cannot check if the file descriptor is
      	readable by calling ReadFile to read zero bytes. ReadFile blocks
      	on NT even if trying to read nothing at all. So, don't check if
      	file descriptor is readable; assume this function isn't called
      	otherwise.
      beed3997
  22. 30 Jul, 2000 1 commit
    • Tor Lillqvist's avatar
      Compile in the debugging code all the time, but only output debug messages · 1860151d
      Tor Lillqvist authored
      2000-07-30  Tor Lillqvist  <tml@iki.fi>
      
      	* giowin32.c: Compile in the debugging code all the time, but only
      	output debug messages if told so. Add (unadvertised) function to
      	turn on/off debug messages for a channel.
      
      	(buffer_read): Don't loop. It is expected behaviour to return a
      	short read occasionally, for instance when reading from
      	pipes. It's the calling code that should loop if it *knows* how
      	much the writer has written.
      
      	* tests/gio-test.c: Correct the program's name in the output.
      	(recv_message): Loop calling g_io_channel_read() (in a new
      	function read_all()) until we have all the bytes we want (that we
      	know the writer has written/will write).
      1860151d
  23. 29 Jul, 2000 1 commit
    • Tor Lillqvist's avatar
      Finally, a new and improved IO Channel and condition watch implementation · b965bb5d
      Tor Lillqvist authored
      2000-07-30  Tor Lillqvist  <tml@iki.fi>
      
      	Finally, a new and improved IO Channel and condition watch
      	implementation for Win32. Based on code provided by Craig Setera.
      
      	When watching file descriptors, for which there is no select()
      	like functionality on Win32 that would work on all Win32 platforms
      	for all types of file descriptors (including anonymous pipes), we
      	start a new thread that blocks while trying to read from the file
      	descriptor. When the read returns, a Win32 Event is signalled that
      	the polling routine eventually notices. Meanwhile, the data being
      	read is stored in a circular buffer, from where the IO channel's
      	read() method picks it up.
      
      	If the buffer fills up the reading thread has to wait for space
      	becoming available. For this another Win32 Event is used. The IO
      	Channel's read() method signals this when it has read some data
      	out of the buffer.
      
      	The separate reader thread(s), and the circular buffer(s) with
      	associated events mean lots of possibilities for fun parallellism
      	errors. But it seems to work OK, i.e. GIMP runs.
      
      	* gmain.c: Small changes to the Win32 polling function.
      	(g_main_win32_get_poll_func): New function. Perhaps it would be a
      	good idea to provide this on all platforms.
      
      	* giowin32.c: The bulk of the new implementation.
      	(g_io_channel_win32_wait_for_condition): New function. To be used
      	where on Unix one does a select() on the channel's fd, like
      	libgimp's gimp_extension_process(). Could be provided on all
      	platforms.
      
      	* glib.h: Update documentation for IO Channels on Win32. Remove
      	the declarations for the as of now obsolete old functions related
      	to IO Channels for pipes with "wakeup" messages.
      
      	* glib.def: Some new functions.
      
      	* tests/gio-test.c: New file, to test GIOChannel and main loop.
      
      	* tests/Makefile.am
      	* tests/makefile.mingw.in: Add it.
      b965bb5d
  24. 26 Jul, 2000 1 commit
  25. 06 Jun, 2000 1 commit
    • Tor Lillqvist's avatar
      If we are watching the same fd several times (for different conditions, · 700b6e5f
      Tor Lillqvist authored
      2000-06-06  Tor Lillqvist  <tml@iki.fi>
      
      * giowin32.c (g_io_channel_win32_pipe_readable): If we are
      watching the same fd several times (for different conditions, with
      different callbacks), check them all. Only call the callback for
      G_IO_IN from here. (This bug popped up when a watch for
      G_IO_ERR|G_IO_HUP was added to gimplib.)
      700b6e5f
  26. 24 Feb, 1999 1 commit
  27. 16 Jan, 1999 1 commit
    • Tor Lillqvist's avatar
      Merge in current Win32 version. Almost no Unix code touched. · f477518c
      Tor Lillqvist authored
      	* README.win32: More text.
      
      	* config.h.win32 glibconfig.h.win32: Update to match the
      	corresponding generated files on Unix.
      
      	* makefile.msc: Update with new source files, and gthread
       	library. Use the compiler flag -MD instead of using -D_DLL and
      	"/nodefaultlib:libc msvcrt.lib" in the link phase.
      
      	* glib.def: Include new functions, drop removed ones.
      
      	* glib.h: Add comments about main loop and polling on Win32. (In
      	general, it's only for the GIMP's use.) Add Win32 IO Channel
      	functions. Remove the obsoleted old IO Channel stuff (which was
      	in #if 0 already).
      
      	* giowin32.c: New file.
      
      	* gmain.c: Include config.h, conditionalize <sys/time.h>
       	inclusion.  Add g_poll implementation for Win32 (only for the
       	GIMP's needs for now, it's hard or even impossible to be as clean
       	and generic as on Unix). Implement g_get_current_time on Win32. If
       	threads aren't supported, don't try to wake up main thread's
       	loop. On Win32, use a semaphore and not a pipe to wake up the main
       	loop.
      
      	* gmessages.c: On Win32, allocate a console window if the standard
      	output handle is invalid before writing to stdout, and reopen stdout
      	to that console window.
      
      	* giochannel.c: Conditionalize unistd.h inclusion. Some indentation
      	cleanup.
      
      	* gstrfuncs.c: Include <signal.h>.
      
      	* gutils.c: On Win32, also check the HOMEDRIVE and HOMEPATH
      	environment variables.
      
      	* gmodule-dl.c gmodule-dld.c: In
       	_g_module_build_path, don't add the "lib" prefix and
       	".so" or ".sl" suffix if already there.
      
      	* gmodule-win32.c: Likewise for the ".dll" suffix.
      
      	* gthread-posix.c: Conditionalize <sys/time.h> inclusion.
      f477518c