Commit dc0b74d4 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

got rid of g_set_error_handler(), g_set_warning_handler(),

Mon Sep 10 17:13:36 2001  Tim Janik  <timj@gtk.org>

        * glib/gmessages.h: got rid of g_set_error_handler(),
        g_set_warning_handler(), g_set_message_handler().

Wed Sep  5 05:24:07 2001  Tim Janik  <timj@gtk.org>

        * gobject/tmpl/gboxed.sgml: documented some functions.

        * gobject/tmpl/objects.sgml: some fixups.

Mon Sep 10 19:27:47 2001  Tim Janik  <timj@gtk.org>

        * gtype.[hc]:
        g_type_add_interface*(): implement the ability to add an interface to
        a type whose parents already conform to this interface.
        such "overriding" interfaces, when initialized, are not just initialized
        with 0, but with a copy of the interface they override.
        g_type_interface_peek_parent(): new function, return the interface
        that this interface "overrides", if any.

        * testgruntime.c: test new interface stuff.
parent ae2c2ca6
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
2001-09-10 Alex Larsson <alexl@redhat.com>
Mon Sep 10 17:13:36 2001 Tim Janik <timj@gtk.org>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
* glib/gmessages.h: got rid of g_set_error_handler(),
g_set_warning_handler(), g_set_message_handler().
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
......
......@@ -40,3 +40,8 @@
@max_tokens + 1
Code depending on either of these bugs will need to be fixed.
* deprecated functions that got removed:
g_set_error_handler(), g_set_warning_handler(),
g_set_message_handler(), use g_log_set_handler() instead.
Wed Sep 5 05:24:07 2001 Tim Janik <timj@gtk.org>
* gobject/tmpl/gboxed.sgml: documented some functions.
* gobject/tmpl/objects.sgml: some fixups.
Mon Sep 10 11:37:02 2001 Owen Taylor <otaylor@redhat.com>
* glib/glib-sections.txt: Update.
......
......@@ -777,14 +777,6 @@ g_log_set_always_fatal
g_log_set_fatal_mask
g_log_default_handler
<SUBSECTION>
g_set_error_handler
GErrorFunc
g_set_warning_handler
GWarningFunc
g_set_message_handler
</SECTION>
<SECTION>
<TITLE>Timers</TITLE>
<FILE>timers</FILE>
......
<!-- ##### SECTION ./tmpl/messages.sgml:Long_Description ##### -->
<para>
These functions provide support for logging error messages or messages
used for debugging.
</para>
<para>
There are several built-in levels of messages, defined in #GLogLevelFlags.
These can be extended with user-defined levels.
</para>
<!-- ##### SECTION ./tmpl/messages.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### SECTION ./tmpl/messages.sgml:Short_Description ##### -->
versatile support for logging messages with different levels of importance.
<!-- ##### SECTION ./tmpl/messages.sgml:Title ##### -->
Message Logging
<!-- ##### ENUM GChannelError ##### -->
<para>
......@@ -51,6 +77,13 @@
@s2:
@Returns:
<!-- ##### USER_FUNCTION GErrorFunc ##### -->
<para>
Specifies the type of function passed to g_set_error_handler().
</para>
@str: the error message.
<!-- ##### USER_FUNCTION GHookFreeFunc ##### -->
<para>
......@@ -71,6 +104,13 @@
@G_IO_FILE_MODE_READ_WRITE_TRUNCATE:
@G_IO_FILE_MODE_READ_WRITE_APPEND:
<!-- ##### USER_FUNCTION GWarningFunc ##### -->
<para>
Specifies the type of function passed to g_set_warning_handler().
</para>
@str: the warning message.
<!-- ##### MACRO G_CHANNEL_ERROR ##### -->
<para>
......@@ -223,6 +263,33 @@ documentation.
@filename: the file name.
@Returns: the file attributes.
<!-- ##### FUNCTION g_set_error_handler ##### -->
<para>
Sets the function to be called to handle error messages.
This function is deprecated in favour of the new logging facilities.
</para>
@func: the function to be called to handle error messages.
@Returns: the old error handler.
<!-- ##### FUNCTION g_set_message_handler ##### -->
<para>
Sets the function to be called to handle messages.
This function is deprecated in favour of the new logging facilities.
</para>
@func: the function to be called to handle normal messages.
@Returns: the old message handler.
<!-- ##### FUNCTION g_set_warning_handler ##### -->
<para>
Sets the function to be called to handle warning messages.
This function is deprecated in favour of the new logging facilities.
</para>
@func: the function to be called to handle warning messages.
@Returns: the old warning handler.
<!-- ##### FUNCTION g_source_add ##### -->
<para>
</para>
......
......@@ -242,49 +242,3 @@ stderr is used for levels %G_LOG_LEVEL_ERROR, %G_LOG_LEVEL_CRITICAL, and
@unused_data: data passed from g_log which is unused.
<!-- ##### FUNCTION g_set_error_handler ##### -->
<para>
Sets the function to be called to handle error messages.
This function is deprecated in favour of the new logging facilities.
</para>
@func: the function to be called to handle error messages.
@Returns: the old error handler.
<!-- ##### USER_FUNCTION GErrorFunc ##### -->
<para>
Specifies the type of function passed to g_set_error_handler().
</para>
@str: the error message.
<!-- ##### FUNCTION g_set_warning_handler ##### -->
<para>
Sets the function to be called to handle warning messages.
This function is deprecated in favour of the new logging facilities.
</para>
@func: the function to be called to handle warning messages.
@Returns: the old warning handler.
<!-- ##### USER_FUNCTION GWarningFunc ##### -->
<para>
Specifies the type of function passed to g_set_warning_handler().
</para>
@str: the warning message.
<!-- ##### FUNCTION g_set_message_handler ##### -->
<para>
Sets the function to be called to handle messages.
This function is deprecated in favour of the new logging facilities.
</para>
@func: the function to be called to handle normal messages.
@Returns: the old message handler.
......@@ -234,6 +234,7 @@ g_flags_complete_type_info
<FILE>gboxed</FILE>
<TITLE>Boxed Types</TITLE>
GBoxed
GBoxedInitFunc
GBoxedCopyFunc
GBoxedFreeFunc
g_boxed_copy
......
<!-- ##### SECTION Title ##### -->
Enumeration and Flag Types
Enums and Flags
<!-- ##### SECTION Short_Description ##### -->
Enumeration and flags types.
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
......
<!-- ##### SECTION Title ##### -->
gboxed
GBoxed
<!-- ##### SECTION Short_Description ##### -->
Mechanism to wrap opaque C structures registered by the type system.
<!-- ##### SECTION Long_Description ##### -->
<para>
......@@ -11,52 +11,55 @@ gboxed
<!-- ##### SECTION See_Also ##### -->
<para>
#GParamSpecBoxed, g_param_spec_boxed()
</para>
<!-- ##### USER_FUNCTION GBoxedCopyFunc ##### -->
<para>
This function is provided by the user and should produce a copy of the passed
in boxed structure.
</para>
@boxed:
@Returns:
@boxed: The boxed structure to be copied.
@Returns: The newly created copy of the boxed structure.
<!-- ##### USER_FUNCTION GBoxedFreeFunc ##### -->
<para>
This function is provided by the user and should free the boxed
structure passed.
</para>
@boxed:
@boxed: The boxed structure to be freed.
<!-- ##### FUNCTION g_boxed_copy ##### -->
<para>
Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
</para>
@boxed_type:
@src_boxed:
@Returns:
@boxed_type: The type of @src_boxed.
@src_boxed: The boxed structure to be copied.
@Returns: The newly created copy of the boxed structure.
<!-- ##### FUNCTION g_boxed_free ##### -->
<para>
Free the boxed structure @boxed which is of type @boxed_type.
</para>
@boxed_type:
@boxed:
@boxed_type: The type of @boxed.
@boxed: The boxed structure to be freed.
<!-- ##### FUNCTION g_value_set_boxed ##### -->
<para>
Assign a #GValue which is initialized with a certain boxed type a
boxed structure of that very same type.
</para>
@value:
@boxed:
@value: The #GValue to be assigned a value to.
@boxed: The boxed structure which has to be of the same type the #GValue got initialized with.
<!-- ##### FUNCTION g_value_set_static_boxed ##### -->
......@@ -97,14 +100,17 @@ This is an internal function introduced mainly for C marshallers.
<!-- ##### FUNCTION g_boxed_type_register_static ##### -->
<para>
This function creates a new %G_TYPE_BOXED derived type id for a new
boxed type with name @name. Boxed type handling functions have to be
provided to copy and free opaque boxed structures of this type.
</para>
@name:
@name: Name of the new boxed type.
@boxed_copy: Boxed structure copy function.
@boxed_free: Boxed structure free function.
@Returns: New %G_TYPE_BOXED derived type id for @name.
<!-- # Unused Parameters # -->
@boxed_init:
@boxed_copy:
@boxed_free:
@is_refcounted:
@Returns:
......@@ -4,6 +4,13 @@
</para>
<!-- ##### USER_FUNCTION GBoxedInitFunc ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION g_closure_add_fnotify ##### -->
<para>
......
<!-- ##### SECTION Title ##### -->
The Base Object Type
GObject
<!-- ##### SECTION Short_Description ##### -->
The base object type.
<!-- ##### SECTION Long_Description ##### -->
<para>
......@@ -16,7 +16,8 @@ The Base Object Type
<!-- ##### STRUCT GObject ##### -->
<para>
All the fields in the GObject structure are private to the #GObject implementation
and should never be accessed directly.
</para>
@g_type_instance:
......@@ -71,26 +72,30 @@ The Base Object Type
<!-- ##### MACRO G_TYPE_IS_OBJECT ##### -->
<para>
Return a boolean value of %FALSE or %TRUE indicating whether
the passed in type id is a %G_TYPE_OBJECT or derived from it.
</para>
@type:
@type: Type id to check for is a %G_TYPE_OBJECT relationship.
@Returns: %FALSE or %TRUE, indicating whether @type is a %G_TYPE_OBJECT.
<!-- ##### MACRO G_OBJECT ##### -->
<para>
Cast a #GObject or derived pointer into a (GObject*) pointer.
Depending on the current debugging level, this function may invoke
certain runtime checks to identify invalid casts.
</para>
@object:
@object: Object which is subject to casting.
<!-- ##### MACRO G_IS_OBJECT ##### -->
<para>
Check whether a valid #GTypeInstance pointer is of type %G_TYPE_OBJECT.
</para>
@object:
@object: Instance to check for being a %G_TYPE_OBJECT.
<!-- ##### MACRO G_OBJECT_CLASS ##### -->
......@@ -119,10 +124,11 @@ The Base Object Type
<!-- ##### MACRO G_OBJECT_TYPE ##### -->
<para>
Return the type id of an object.
</para>
@object:
@object: Object to return the type id for.
@Returns: Type id of @object.
<!-- ##### MACRO G_OBJECT_TYPE_NAME ##### -->
......@@ -256,8 +262,8 @@ lifetime of @object. When the @object is finalized, @weak_pointer will
be set to %NULL.
</para>
@object: the object that should be weak referenced.
@weak_pointer_location: the memory address of a pointer.
@object: The object that should be weak referenced.
@weak_pointer_location: The memory address of a pointer.
<!-- ##### FUNCTION g_object_remove_weak_pointer ##### -->
......@@ -267,8 +273,8 @@ using g_object_add_weak_pointer(). The @weak_pointer_location has
to match the one used with g_object_add_weak_pointer().
</para>
@object: the object that is weak referenced.
@weak_pointer_location: the memory address of a pointer.
@object: The object that is weak referenced.
@weak_pointer_location: The memory address of a pointer.
<!-- ##### FUNCTION g_object_connect ##### -->
......@@ -302,8 +308,6 @@ to match the one used with g_object_add_weak_pointer().
@first_property_name:
@Varargs:
@Returns:
<!-- # Unused Parameters # -->
@first_param_name:
<!-- ##### FUNCTION g_object_get ##### -->
......@@ -314,8 +318,6 @@ to match the one used with g_object_add_weak_pointer().
@object:
@first_property_name:
@Varargs:
<!-- # Unused Parameters # -->
@first_param_name:
<!-- ##### FUNCTION g_object_notify ##### -->
......@@ -454,8 +456,6 @@ to match the one used with g_object_add_weak_pointer().
@first_property_name:
@var_args:
@Returns:
<!-- # Unused Parameters # -->
@first_param_name:
<!-- ##### FUNCTION g_object_set_valist ##### -->
......@@ -466,8 +466,6 @@ to match the one used with g_object_add_weak_pointer().
@object:
@first_property_name:
@var_args:
<!-- # Unused Parameters # -->
@first_param_name:
<!-- ##### FUNCTION g_object_get_valist ##### -->
......@@ -478,8 +476,6 @@ to match the one used with g_object_add_weak_pointer().
@object:
@first_property_name:
@var_args:
<!-- # Unused Parameters # -->
@first_param_name:
<!-- ##### FUNCTION g_object_watch_closure ##### -->
......
......@@ -13,7 +13,7 @@ in order for it to be used as a boxed type through %G_TYPE_VALUE_ARRAY.
<!-- ##### SECTION See_Also ##### -->
<para>
#GValue, #GParamSpecValueArray
#GValue, #GParamSpecValueArray, g_param_spec_value_array()
</para>
<!-- ##### STRUCT GValueArray ##### -->
......
......@@ -98,7 +98,7 @@ typedef enum
G_IO_FLAG_IS_SEEKABLE = 1 << 4, /* Read only flag */
G_IO_FLAG_MASK = (1 << 5) - 1,
G_IO_FLAG_GET_MASK = G_IO_FLAG_MASK,
G_IO_FLAG_SET_MASK = G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK,
G_IO_FLAG_SET_MASK = G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK
} GIOFlags;
struct _GIOChannel
......
......@@ -85,9 +85,6 @@ static GLogDomain *g_log_domains = NULL;
static GLogLevelFlags g_log_always_fatal = G_LOG_FATAL_MASK;
static GPrintFunc glib_print_func = NULL;
static GPrintFunc glib_printerr_func = NULL;
static GErrorFunc glib_error_func = NULL;
static GWarningFunc glib_warning_func = NULL;
static GPrintFunc glib_message_func = NULL;
static GPrivate* g_log_depth = NULL;
......@@ -581,9 +578,6 @@ g_log_default_handler (const gchar *log_domain,
GFileDescriptor fd;
gboolean in_recursion;
gboolean is_fatal;
GErrorFunc local_glib_error_func;
GWarningFunc local_glib_warning_func;
GPrintFunc local_glib_message_func;
in_recursion = (log_level & G_LOG_FLAG_RECURSION) != 0;
is_fatal = (log_level & G_LOG_FLAG_FATAL) != 0;
......@@ -602,21 +596,9 @@ g_log_default_handler (const gchar *log_domain,
fd = (log_level > G_LOG_LEVEL_MESSAGE) ? 1 : 2;
#endif
g_mutex_lock (g_messages_lock);
local_glib_error_func = glib_error_func;
local_glib_warning_func = glib_warning_func;
local_glib_message_func = glib_message_func;
g_mutex_unlock (g_messages_lock);
switch (log_level)
{
case G_LOG_LEVEL_ERROR:
if (!log_domain && local_glib_error_func)
{
/* compatibility code */
local_glib_error_func (message);
return;
}
/* use write(2) for output, in case we are out of memeory */
ensure_stdout_valid ();
write (fd, "\n", 1);
......@@ -662,12 +644,6 @@ g_log_default_handler (const gchar *log_domain,
write (fd, "\n", 1);
break;
case G_LOG_LEVEL_WARNING:
if (!log_domain && local_glib_warning_func)
{
/* compatibility code */
local_glib_warning_func (message);
return;
}
ensure_stdout_valid ();
write (fd, "\n", 1);
g_log_write_prefix (fd, log_level);
......@@ -690,12 +666,6 @@ g_log_default_handler (const gchar *log_domain,
write (fd, "\n", 1);
break;
case G_LOG_LEVEL_MESSAGE:
if (!log_domain && local_glib_message_func)
{
/* compatibility code */
local_glib_message_func (message);
return;
}
ensure_stdout_valid ();
g_log_write_prefix (fd, log_level);
......@@ -884,48 +854,6 @@ g_printerr (const gchar *format,
g_free (string);
}
/* compatibility code */
GErrorFunc
g_set_error_handler (GErrorFunc func)
{
GErrorFunc old_error_func;
g_mutex_lock (g_messages_lock);
old_error_func = glib_error_func;
glib_error_func = func;
g_mutex_unlock (g_messages_lock);
return old_error_func;
}
/* compatibility code */
GWarningFunc
g_set_warning_handler (GWarningFunc func)
{
GWarningFunc old_warning_func;
g_mutex_lock (g_messages_lock);
old_warning_func = glib_warning_func;
glib_warning_func = func;
g_mutex_unlock (g_messages_lock);
return old_warning_func;
}
/* compatibility code */
GPrintFunc
g_set_message_handler (GPrintFunc func)
{
GPrintFunc old_message_func;
g_mutex_lock (g_messages_lock);
old_message_func = glib_message_func;
glib_message_func = func;
g_mutex_unlock (g_messages_lock);
return old_message_func;
}
#ifndef MB_LEN_MAX
# define MB_LEN_MAX 8
#endif
......
......@@ -170,12 +170,6 @@ void g_printerr (const gchar *format,
...) G_GNUC_PRINTF (1, 2);
GPrintFunc g_set_printerr_handler (GPrintFunc func);
/* deprecated compatibility functions, use g_log_set_handler() instead */
typedef void (*GErrorFunc) (const gchar *str);
typedef void (*GWarningFunc) (const gchar *str);
GErrorFunc g_set_error_handler (GErrorFunc func);
GWarningFunc g_set_warning_handler (GWarningFunc func);
GPrintFunc g_set_message_handler (GPrintFunc func);
/* Provide macros for error handling. The "assert" macros will
* exit on failure. The "return" macros will exit the current
......
Mon Sep 10 19:27:47 2001 Tim Janik <timj@gtk.org>
* gtype.[hc]:
g_type_add_interface*(): implement the ability to add an interface to
a type whose parents already conform to this interface.
such "overriding" interfaces, when initialized, are not just initialized
with 0, but with a copy of the interface they override.
g_type_interface_peek_parent(): new function, return the interface
that this interface "overrides", if any.
* testgruntime.c: test new interface stuff.
2001-09-10 Alex Larsson <alexl@redhat.com>
* gobject/gboxed.[ch]:
* gobject/gsourceclosure.c:
Removed is_refcounted and GBoxedInitFunc from
g_boxed_type_register_static().
Sat Sep 8 14:13:57 2001 Owen Taylor <otaylor@redhat.com>
* gobject/Makefile.am: Move gbsearcharray.[ch] to glib
......
......@@ -132,6 +132,8 @@ static inline gpointer type_get_qdata_L (TypeNode *node,
static inline void type_set_qdata_W (TypeNode *node,
GQuark quark,
gpointer data);
static IFaceHolder* type_iface_peek_holder_L (TypeNode *iface,
GType instance_type);
/* --- structures --- */
......@@ -333,10 +335,14 @@ type_node_any_new_W (TypeNode *pnode,
}
else
{
guint j;
CLASSED_NODE_N_IFACES (node) = CLASSED_NODE_N_IFACES (pnode);
CLASSED_NODE_IFACES_ENTRIES (node) = g_memdup (CLASSED_NODE_IFACES_ENTRIES (pnode),
sizeof (CLASSED_NODE_IFACES_ENTRIES (pnode)[0]) *
CLASSED_NODE_N_IFACES (node));
for (j = 0; j < CLASSED_NODE_N_IFACES (node); j++)
CLASSED_NODE_IFACES_ENTRIES (node)[j].vtable = NULL;
}
i = pnode->n_children++;
......@@ -778,8 +784,8 @@ check_type_info_L (TypeNode *pnode,
}
static TypeNode*
find_conforming_type_L (TypeNode *pnode,
TypeNode *iface)
find_conforming_child_type_L (TypeNode *pnode,
TypeNode *iface)
{
TypeNode *node = NULL;
guint i;
......@@ -788,7 +794,7 @@ find_conforming_type_L (TypeNode *pnode,