2001-01-20 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_get_codeset): (Win32) Even if g_get_codeset() is
currently commented out from gutils.h, fix it to return the same
CP%d value as g_get_charset().
2001-01-17 Tor Lillqvist <tml@iki.fi>
* gwin32.c (g_win32_getlocale, g_win32_error_message): Add doc
comments.
(g_win32_get_package_installation_directory): Add one parameter,
the name of a DLL in the package. Add possibility to use that to
deduce the installation directory if not entered into the
Registry. Make the return value dynamically allocated.
(g_win32_get_package_installation_subdirectory): New convenience
function.
* gutils.c (GLIB_LOCALE_DIR)
* gwin32.h: Adapt accordingly.
* testglib.c (main): Adapt tests accordingly.
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
* gutils.c glibintl.h: Optimize for size rather than speed by
making _() always call _glib_gettext() instead of conditionally
calling gettext() or _glib_gettext_init. glib only uses translated
strings in slow error handling code anyways.
* glibintl.h: g'ify types.
* Makefile.am: include glibintl.h in _SOURCES
2001-01-17 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
* makefile.mingw.in
* makefile.msc.in: Use the GNU intl library.
* gwin32.c (g_win32_get_package_installation_directory): New
function. To be used by various GLib-using packages to get their
installation directory, which should be stored in the Registry by
some installer.
* gwin32.h: Declare it.
* testglib.c (main): Test it.
* gutils.c: On Win32, define GLIB_LOCALE_DIR using
g_win32_get_package_installation_directory().
* glib.def: Update.
Mon Jan 15 21:12:49 2001 Owen Taylor <otaylor@redhat.com>
* configure.in acconfig.h glibintl.h gutils.c
po/{Makefile.in.in,POTFILES.in,po2tbl.in}: Add gettext
support.
* glib-gettext.m4 acinclude.m4: Clean up the GTK+ gettext macros
some more and put them in this file, though they also need
to be included in acinclude.m4 due to the brokeness of
aclocal.
* gspawn.c gspawn-win32.c gutf8.c gconvert.c gfileutils.c
gshell.c: Remove dummy _() #defines, include glibintl.m4.
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.
2001-01-09 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_basename, g_dirname): Don't warn about deprecation
on Win32. Code written for GLib 1.2 doesn't have much choice but
to use GLib >= 1.3 on Win32.
* glib.def: Update.
2001-01-09 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gmem.c: Made g_profile_mutex a GMutex* instead of
G_LOCK_DEFINE_STATIC to avoid deadlock for thread implementations
without native static mutexes. Contruct g_profile_mutex in
g_mem_init().
Tue Jan 9 03:10:38 2001 Tim Janik <timj@gtk.org>
* gobject/tmpl/types.sgml: added some function documentations.
* gobject/gobject-sections.txt: buncha fixups.
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'.
Fri Jan 5 11:25:42 2001 Owen Taylor <otaylor@redhat.com>
* configure.in (PACKAGE): move $enable_debug down below
checks for GCC to avoid setting CFLAGS prematurely,
change checks to avoid adding -g twice.
* gutf8.c (g_ucs4_to_utf8): Support len < 0 to mean
0 termination.
* gutf8.c (g_utf8_to_ucs4): Terminate result with 0.
* tests/mainloop-test.c (main): Fix uses of
g_main_loop_destroy().
* tests/unicode-encoding.c tests/Makefile.am tests/utf8.txt:
Tests for unicode-conversion code.
* gconvert.c (g_convert, g_convert_with_fallback): work around
a couple of GNU libc bugs.
* gconvert.[ch] (g_{locale,filename}_{to,from}_utf8): Standardize
arguments to match g_convert(). Document.
* gunicode.[ch]:
- Implement conversion functions to and from UTF-16
- Standardize unicode conversion functions on prototype like
g_convert.
- Add a lot of error checking to unicode conversion functions.
* gunicode.[ch] (g_utf8_to_ucs4_fast): Add fast, non-checking
variant of g_utf8_to_ucs4.
* gutf8.c (g_utf8_validate):
- add g_return_if_fail (str != NULL).
- add checks for overlong strings, non-valid Unicode characters (>= 110000)
and single surrogates.
2001-01-05 Havoc Pennington <hp@redhat.com>
* gparamspecs.c (g_param_spec_enum): set the value_type in the
param spec; closes bug 40210
(g_param_spec_flags): ditto for flags
2001-01-05 Tor Lillqvist <tml@iki.fi>
* testglib.c (main): Add test for g_path_skip_root().
* gutils.c (g_path_skip_root): Fix bugs in code I just added ;-)
2001-01-05 Tor Lillqvist <tml@iki.fi>
* gfileutils.c (g_file_open_tmp): (Win32:) Look also for (illegal)
forward slashes in the template.
* gutils.c (g_path_skip_root): On Win32, skip the \\server\share
part of UNC paths. On all platforms, skip several initial
slashes. Add a few comments.
(g_get_any_init): On Win32, in case HOME is Unix-style with
(forward) slashes (some other applications apparently set it up
this way, convert to backslashed form.
* configure.in (glib_os): Remove stray 'v'. Add case for mingw,
although using configure for mingw surely doesn't work yet.
* glib.def: Update.
Wed Jan 3 14:10:49 2001 Owen Taylor <otaylor@redhat.com>
* gmain.[ch]: Switch GMainLoop to be ref/unref, use to
make dropping reference to running loop safe.
2001-01-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread-solaris.c, gthread-posix.c: Made g_thread_min_stack_size
static.
2CVS: ----------------------------------------------------------------------
Wed Dec 13 20:41:49 2000 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_unref_internal): Unref callback->cb_data
if it was still set when the source is freed. (Usually, this
will be done by g_source_destroy.)
* garray.h (g_array_append_val, g_array_prepend_val,
g_array_insert_val): Use parentheses around an argument to make
these cause an error if you pass a non-lvalue for the value,
rather than silently doing the wrong thing.
Fri Dec 29 14:53:18 2000 Tim Janik <timj@gtk.org>
* configure.in: we can't grow _cv_ variables by using a backticked
expr that refers back to the variable (glib_cv_sizeof_system_thread for
G_THREAD_USE_PID_SURROGATE), that'd keep the variable growing every time
it's evaluated. quantum states, anyone?)
Thu Dec 28 10:21:46 2000 Tim Janik <timj@gtk.org>
* gmem.[hc]: got rid of outdated dmalloc support. provide g_try_malloc()
and g_try_realloc() which _may_ fail and return NULL.
nuked g_mem_check(), provided GMemVTable for memory function
virtualization, alterable at program startup with g_mem_set_vtable().
provided glib_mem_profiler_table and g_mem_profile() to support limited
profiling information out of the box (uses mprotect() for free()ed areas
on linux).
provide globally visible G_MEM_ALIGN.
buncha cleanups.
* docs/macros.txt: file to get a clue about the various configuration
macros.
* docs/debugging.txt: explain debugging traps.
* configure.in: got rid of --enable-mem-check and --enable-mem-profile,
define GLIB_SIZEOF_VOID_P and GLIB_SIZEOF_LONG. check malloc prototypes
and define SANE_MALLOC_PROTOS is we can use them.
<boy, is this file a mess>
* gutils.c, gscanner.c: fix up compatibility warnings, use g_message().
Thu Dec 28 11:36:44 2000 Tim Janik <timj@gtk.org>
* gbsearcharray.c (upper_power2): disable G_BSEARCH_ALIGN_POWER2
fucntionality if DISABLE_MEM_POOLS is defined.
* gtype.c: honour DISABLE_MEM_POOLS.
* gsignal.c (g_signal_init): flag signal key bsearch array with
G_BSEARCH_ALIGN_POWER2 to avoid excessive growth time. honour
DISABLE_MEM_POOLS.
* gparam.h: added G_PARAM_READWRITE alias for (G_PARAM_READABLE |
G_PARAM_WRITABLE).
2000-12-25 Tor Lillqvist <tml@iki.fi>
* gmessages.c: (Win32) Use a MessageBox for fatal
messages. Collect eror message into a buffer, and display that.
* glib.def: Update.
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
macros, add G_MODULE_SUFFIX.
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
as recommended by Havoc.
* gdate.c, gdate.h, testgdate.c,
docs/reference/glib/glib-sections.txt,
docs/reference/glib/tmpl/date.sgml, tests/date-test.c: Rename some
of the gdate functions to use the '_get' in their name. Patch
reviewed by Havoc.
2000-12-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in: Determine the suffix of the shared librarries for
this system. This is done analogous to
ltconfig.sh. G_MODULE_SUFFIX in glibconfig.h is set to either
"sl", "dll", or (most often) "so".
* tests/Makefile.am, tests/module-test.c,
tests/libmoduletestplugin_a.c, tests/libmoduletestplugin_b.c:
Added new testcase for gmodule. This is mostly copied from
gmodule/testgmodule.c, but unlike that is is quiet. (Why BTW are
some tests that verbose, not to say loquacious...)
* gmodule.c: Make g_module_open more tolerant wrt to the module
name. First it tries to open the module as named, if that fails,
it checks, whether it is a libtool archive and parses it, if that
fails it appends the systems shared library suffix
(i.e. ".so") (if not already found) and tries again and if that
fails it tries to append the ".la" libtool suffix (if not already
found) and parses it.
* gmodule.c: Lock recursive mutex during most module functions for
safety.
* gmodule-dl.c: Return an error from _g_module_symbol only, if
dlerror says so. All other functions return an error as well, if
dlerror returns NULL.
* testgmodule.c: Thanks to the above change the #ifdefs have
vanished.
* glib/glib-sections.txt: Added G_MODULE_SUFFIX.
* glib/tmpl/modules.sgml: Updated.
2000-12-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* grand.c: Updated G_RAND_DOUBLE_TRANSFORM to be more
accurate. Redid g_rand_double() such that it returns 52 bits after
the point instead of 32 as before. That OTOH requires calling
g_rand_int() twice. Overhauled g_rand_int_range(), which is easier
now thanks to the new precision of g_rand_double(). Thanks to
Sverre Johansen <sj@ifi.uio.no> for the hint.
* grand.h: Added g_rand_boolean() and g_random_boolean()
macros. While they could be omitted due to extreme simplicity,
they make intention clearer in code and are therefore good to have.
* grand.c, grand.h: Renamed all 'min' and 'max' parameters to'
begin' and 'end' resp. to avoid making people think, that 'max' is
included in the interval. 'end' now isn't, whereas 'begin'
is. That's similar to the use in the STL.
* glib/glib-sections.txt: Added g_rand_boolean and
g_random_boolean macros.
* glib/tmpl/random_numbers.sgml: Updated.
2000-12-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gslist.c, glist.c: Ok, I'm a moron. When I originally
implemented ENABLE_GC_FRIENDLY, I forgot to include config.h into
the affected files. Now that Alex did that for those two,
inevitable typos surfaced, which are now fixed.
* garray.c, ghash.c, gqueue.c, gtree.c: Include config.h as well,
as ENABLE_GC_FRIENDLY should be known.
2000-12-17 Tor Lillqvist <tml@iki.fi>
* gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
the current ANSI codepage.
* gunicode.h: Add comment that the static string g_get_charset
sets the parameter to point to should be copied in case the
charset might be changed later in the program.
2000-12-15 Havoc Pennington <hp@pobox.com>
* gobject.c (g_object_do_class_init): use g_signal_newc
* gsignal.c (g_signal_newc): convenience function for signals
created from C
(g_signal_new_valist): added
(g_signal_new): removed
Fri Dec 15 04:40:23 2000 Tim Janik <timj@gtk.org>
* gparam.[hc]: add an instance member value_type so the default
value of the pspec class can be overridden.
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.
2000-12-13 Havoc Pennington <hp@redhat.com>
* gconvert.c (open_converter): make static
* gutf8.c (g_utf8_validate): Simplify logic a bit, maybe
speeding it up - now we just return FALSE if we had to bail out
for any reason before getting to the end of the string, as defined
by a nul byte if len was -1, defined by the len otherwise. This
also fixes a bug where nul bytes were not treated as invalid
when the length was specified.