Commit f9b29ca0 authored by Matthias Clasen's avatar Matthias Clasen

Add G_GNUC_DEPRECATED to deprecated APIs in glib

parent 30b320b6
......@@ -8,7 +8,7 @@
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
......@@ -43,8 +43,8 @@ typedef gchar* (*GCompletionFunc) (gpointer);
*/
typedef gint (*GCompletionStrncmpFunc) (const gchar *s1,
const gchar *s2,
gsize n);
const gchar *s2,
gsize n);
struct _GCompletion
{
......@@ -56,21 +56,21 @@ struct _GCompletion
GCompletionStrncmpFunc strncmp_func;
};
GCompletion* g_completion_new (GCompletionFunc func);
GCompletion* g_completion_new (GCompletionFunc func) G_GNUC_DEPRECATED;
void g_completion_add_items (GCompletion* cmp,
GList* items);
GList* items) G_GNUC_DEPRECATED;
void g_completion_remove_items (GCompletion* cmp,
GList* items);
GList* items) G_GNUC_DEPRECATED;
void g_completion_clear_items (GCompletion* cmp);
GList* g_completion_complete (GCompletion* cmp,
const gchar* prefix,
gchar** new_prefix);
gchar** new_prefix) G_GNUC_DEPRECATED;
GList* g_completion_complete_utf8 (GCompletion *cmp,
const gchar* prefix,
gchar** new_prefix);
gchar** new_prefix) G_GNUC_DEPRECATED;
void g_completion_set_compare (GCompletion *cmp,
GCompletionStrncmpFunc strncmp_func);
void g_completion_free (GCompletion* cmp);
GCompletionStrncmpFunc strncmp_func) G_GNUC_DEPRECATED;
void g_completion_free (GCompletion* cmp) G_GNUC_DEPRECATED;
G_END_DECLS
......
......@@ -66,31 +66,31 @@ struct _GTuples
* g_relation_count() counts ...
*/
GRelation* g_relation_new (gint fields);
void g_relation_destroy (GRelation *relation);
GRelation* g_relation_new (gint fields) G_GNUC_DEPRECATED;
void g_relation_destroy (GRelation *relation) G_GNUC_DEPRECATED;
void g_relation_index (GRelation *relation,
gint field,
GHashFunc hash_func,
GEqualFunc key_equal_func);
GEqualFunc key_equal_func) G_GNUC_DEPRECATED;
void g_relation_insert (GRelation *relation,
...);
...) G_GNUC_DEPRECATED;
gint g_relation_delete (GRelation *relation,
gconstpointer key,
gint field);
gint field) G_GNUC_DEPRECATED;
GTuples* g_relation_select (GRelation *relation,
gconstpointer key,
gint field);
gint field) G_GNUC_DEPRECATED;
gint g_relation_count (GRelation *relation,
gconstpointer key,
gint field);
gint field) G_GNUC_DEPRECATED;
gboolean g_relation_exists (GRelation *relation,
...);
void g_relation_print (GRelation *relation);
void g_relation_print (GRelation *relation) G_GNUC_DEPRECATED;
void g_tuples_destroy (GTuples *tuples);
void g_tuples_destroy (GTuples *tuples) G_GNUC_DEPRECATED;
gpointer g_tuples_index (GTuples *tuples,
gint index_,
gint field);
gint field) G_GNUC_DEPRECATED;
G_END_DECLS
......
......@@ -99,20 +99,20 @@ GLIB_VAR guint64 (*g_thread_gettime) (void);
GThread* g_thread_create (GThreadFunc func,
gpointer data,
gboolean joinable,
GError **error);
GError **error) G_GNUC_DEPRECATED_FOR(g_thread_new);
GThread* g_thread_create_full (GThreadFunc func,
gpointer data,
gulong stack_size,
gboolean joinable,
gboolean bound,
GThreadPriority priority,
GError **error);
GError **error) G_GNUC_DEPRECATED_FOR(g_thread_new_full);
void g_thread_set_priority (GThread *thread,
GThreadPriority priority);
GThreadPriority priority) G_GNUC_DEPRECATED;
void g_thread_foreach (GFunc thread_func,
gpointer user_data);
gpointer user_data) G_GNUC_DEPRECATED;
#ifdef G_OS_WIN32
typedef GMutex * GStaticMutex;
......@@ -133,8 +133,8 @@ typedef struct {
g_mutex_trylock (g_static_mutex_get_mutex (mutex))
#define g_static_mutex_unlock(mutex) \
g_mutex_unlock (g_static_mutex_get_mutex (mutex))
void g_static_mutex_init (GStaticMutex *mutex);
void g_static_mutex_free (GStaticMutex *mutex);
void g_static_mutex_init (GStaticMutex *mutex) G_GNUC_DEPRECATED_FOR(g_mutex_init);
void g_static_mutex_free (GStaticMutex *mutex) G_GNUC_DEPRECATED_FOR(g_mutex_free);
typedef struct _GStaticRecMutex GStaticRecMutex;
struct _GStaticRecMutex
......@@ -146,14 +146,14 @@ struct _GStaticRecMutex
};
#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, {{0, 0, 0, 0}} }
void g_static_rec_mutex_init (GStaticRecMutex *mutex);
void g_static_rec_mutex_lock (GStaticRecMutex *mutex);
gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex);
void g_static_rec_mutex_unlock (GStaticRecMutex *mutex);
void g_static_rec_mutex_init (GStaticRecMutex *mutex) G_GNUC_DEPRECATED_FOR(g_rec_mutex_init);
void g_static_rec_mutex_lock (GStaticRecMutex *mutex) G_GNUC_DEPRECATED_FOR(g_rec_mutex_lock);
gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex) G_GNUC_DEPRECATED_FOR(g_rec_mutex_try_lock);
void g_static_rec_mutex_unlock (GStaticRecMutex *mutex) G_GNUC_DEPRECATED_FOR(g_rec_mutex_unlock);
void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex,
guint depth);
guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
void g_static_rec_mutex_free (GStaticRecMutex *mutex);
guint depth) G_GNUC_DEPRECATED;
guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex) G_GNUC_DEPRECATED;
void g_static_rec_mutex_free (GStaticRecMutex *mutex) G_GNUC_DEPRECATED_FOR(g_rec_mutex_free);
typedef struct _GStaticRWLock GStaticRWLock;
struct _GStaticRWLock
......@@ -170,16 +170,16 @@ struct _GStaticRWLock
#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 }
void g_static_rw_lock_init (GStaticRWLock* lock);
void g_static_rw_lock_reader_lock (GStaticRWLock* lock);
gboolean g_static_rw_lock_reader_trylock (GStaticRWLock* lock);
void g_static_rw_lock_reader_unlock (GStaticRWLock* lock);
void g_static_rw_lock_writer_lock (GStaticRWLock* lock);
gboolean g_static_rw_lock_writer_trylock (GStaticRWLock* lock);
void g_static_rw_lock_writer_unlock (GStaticRWLock* lock);
void g_static_rw_lock_free (GStaticRWLock* lock);
void g_static_rw_lock_init (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_init);
void g_static_rw_lock_reader_lock (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_reader_lock);
gboolean g_static_rw_lock_reader_trylock (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_reader_trylock);
void g_static_rw_lock_reader_unlock (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_reader_unlock);
void g_static_rw_lock_writer_lock (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_writer_lock);
gboolean g_static_rw_lock_writer_trylock (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_writer_trylock);
void g_static_rw_lock_writer_unlock (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_writer_unlock);
void g_static_rw_lock_free (GStaticRWLock* lock) G_GNUC_DEPRECATED_FOR(g_rw_lock_free);
GPrivate * g_private_new (GDestroyNotify notify);
GPrivate * g_private_new (GDestroyNotify notify) G_GNUC_DEPRECATED;
typedef struct _GStaticPrivate GStaticPrivate;
struct _GStaticPrivate
......@@ -189,18 +189,18 @@ struct _GStaticPrivate
};
#define G_STATIC_PRIVATE_INIT { 0 }
void g_static_private_init (GStaticPrivate *private_key);
gpointer g_static_private_get (GStaticPrivate *private_key);
void g_static_private_init (GStaticPrivate *private_key) G_GNUC_DEPRECATED;
gpointer g_static_private_get (GStaticPrivate *private_key) G_GNUC_DEPRECATED_FOR(g_private_get);
void g_static_private_set (GStaticPrivate *private_key,
gpointer data,
GDestroyNotify notify);
void g_static_private_free (GStaticPrivate *private_key);
GDestroyNotify notify) G_GNUC_DEPRECATED_FOR(g_private_set);
void g_static_private_free (GStaticPrivate *private_key) G_GNUC_DEPRECATED;
gboolean g_once_init_enter_impl (volatile gsize *location);
gboolean g_once_init_enter_impl (volatile gsize *location) G_GNUC_DEPRECATED;
void g_thread_init (gpointer vtable);
void g_thread_init (gpointer vtable) G_GNUC_DEPRECATED;
gboolean g_thread_get_initialized (void);
gboolean g_thread_get_initialized (void) G_GNUC_DEPRECATED;
GLIB_VAR gboolean g_threads_got_initialized;
......@@ -212,10 +212,10 @@ GLIB_VAR gboolean g_threads_got_initialized;
GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
GMutex * g_mutex_new (void);
void g_mutex_free (GMutex *mutex);
GCond * g_cond_new (void);
void g_cond_free (GCond *cond);
GMutex * g_mutex_new (void) G_GNUC_DEPRECATED;
void g_mutex_free (GMutex *mutex) G_GNUC_DEPRECATED;
GCond * g_cond_new (void) G_GNUC_DEPRECATED;
void g_cond_free (GCond *cond) G_GNUC_DEPRECATED;
G_END_DECLS
......
......@@ -45,8 +45,8 @@ GAsyncQueue *g_async_queue_ref (GAsyncQueue *queue);
void g_async_queue_unref (GAsyncQueue *queue);
#ifndef G_DISABLE_DEPRECATED
void g_async_queue_ref_unlocked (GAsyncQueue *queue);
void g_async_queue_unref_and_unlock (GAsyncQueue *queue);
void g_async_queue_ref_unlocked (GAsyncQueue *queue) G_GNUC_DEPRECATED_FOR(g_async_queue_ref);
void g_async_queue_unref_and_unlock (GAsyncQueue *queue) G_GNUC_DEPRECATED_FOR(g_async_queue_unref);
#endif /* !G_DISABLE_DEPRECATED */
void g_async_queue_push (GAsyncQueue *queue,
......
......@@ -64,7 +64,7 @@ gsize g_atomic_pointer_xor (volatile void *a
#ifndef G_DISABLE_DEPRECATED
gint g_atomic_int_exchange_and_add (volatile gint *atomic,
gint val);
gint val) G_GNUC_DEPRECATED_FOR(g_atomic_add);
#endif
G_END_DECLS
......
......@@ -61,7 +61,7 @@ void g_cache_key_foreach (GCache *cache,
#ifndef G_DISABLE_DEPRECATED
void g_cache_value_foreach (GCache *cache,
GHFunc func,
gpointer user_data);
gpointer user_data) G_GNUC_DEPRECATED_FOR(g_cache_key_foreach);
#endif
G_END_DECLS
......
......@@ -176,7 +176,7 @@ void g_date_set_time_val (GDate *date,
GTimeVal *timeval);
#ifndef G_DISABLE_DEPRECATED
void g_date_set_time (GDate *date,
GTime time_);
GTime time_) G_GNUC_DEPRECATED_FOR(g_date_set_time_t);
#endif
void g_date_set_month (GDate *date,
GDateMonth month);
......
......@@ -129,7 +129,7 @@ gchar * g_format_size_full (guint64 size,
gchar * g_format_size (guint64 size);
#ifndef G_DISABLE_DEPRECATED
char *g_format_size_for_display (goffset size);
char *g_format_size_for_display (goffset size) G_GNUC_DEPRECATED_FOR(g_format_size);
#endif
gchar *g_build_path (const gchar *separator,
......
......@@ -174,18 +174,18 @@ GIOChannel *g_io_channel_ref (GIOChannel *channel);
void g_io_channel_unref (GIOChannel *channel);
#ifndef G_DISABLE_DEPRECATED
GIOError g_io_channel_read (GIOChannel *channel,
gchar *buf,
gsize count,
gsize *bytes_read);
GIOError g_io_channel_write (GIOChannel *channel,
const gchar *buf,
gsize count,
gsize *bytes_written);
GIOError g_io_channel_read (GIOChannel *channel,
gchar *buf,
gsize count,
gsize *bytes_read) G_GNUC_DEPRECATED_FOR(g_io_channel_read_for);
GIOError g_io_channel_write (GIOChannel *channel,
const gchar *buf,
gsize count,
gsize *bytes_written) G_GNUC_DEPRECATED_FOR(g_io_channel_write_chars);
GIOError g_io_channel_seek (GIOChannel *channel,
gint64 offset,
GSeekType type);
void g_io_channel_close (GIOChannel *channel);
gint64 offset,
GSeekType type) G_GNUC_DEPRECATED_FOR(g_io_channel_seek_position);
void g_io_channel_close (GIOChannel *channel) G_GNUC_DEPRECATED_FOR(g_io_channel_shutdown);
#endif /* G_DISABLE_DEPRECATED */
GIOStatus g_io_channel_shutdown (GIOChannel *channel,
......
......@@ -409,7 +409,7 @@ void g_source_remove_child_source (GSource *source,
#ifndef G_DISABLE_DEPRECATED
void g_source_get_current_time (GSource *source,
GTimeVal *timeval);
GTimeVal *timeval) G_GNUC_DEPRECATED_FOR(g_source_get_time);
#endif
gint64 g_source_get_time (GSource *source);
......
......@@ -44,7 +44,7 @@ GMappedFile *g_mapped_file_ref (GMappedFile *file);
void g_mapped_file_unref (GMappedFile *file);
#ifndef G_DISABLE_DEPRECATED
void g_mapped_file_free (GMappedFile *file);
void g_mapped_file_free (GMappedFile *file) G_GNUC_DEPRECATED_FOR(g_mapped_file_unref);
#endif
G_END_DECLS
......
......@@ -174,13 +174,13 @@ gchar* g_ascii_strup (const gchar *str,
* toupper, which is almost never the right thing.
*/
gint g_strcasecmp (const gchar *s1,
const gchar *s2);
gint g_strncasecmp (const gchar *s1,
const gchar *s2,
guint n);
gchar* g_strdown (gchar *string);
gchar* g_strup (gchar *string);
gint g_strcasecmp (const gchar *s1,
const gchar *s2) G_GNUC_DEPRECATED;
gint g_strncasecmp (const gchar *s1,
const gchar *s2,
guint n) G_GNUC_DEPRECATED;
gchar* g_strdown (gchar *string) G_GNUC_DEPRECATED;
gchar* g_strup (gchar *string) G_GNUC_DEPRECATED;
#endif /* G_DISABLE_DEPRECATED */
......
......@@ -142,8 +142,8 @@ g_string_append_c_inline (GString *gstring,
#ifndef G_DISABLE_DEPRECATED
GString* g_string_down (GString *string);
GString* g_string_up (GString *string);
GString *g_string_down (GString *string) G_GNUC_DEPRECATED;
GString *g_string_up (GString *string) G_GNUC_DEPRECATED;
#define g_string_sprintf g_string_printf
#define g_string_sprintfa g_string_append_printf
......
......@@ -77,7 +77,7 @@ void g_tree_foreach (GTree *tree,
void g_tree_traverse (GTree *tree,
GTraverseFunc traverse_func,
GTraverseType traverse_type,
gpointer user_data);
gpointer user_data) G_GNUC_DEPRECATED;
#endif /* G_DISABLE_DEPRECATED */
gpointer g_tree_search (GTree *tree,
......
......@@ -569,7 +569,7 @@ void g_unicode_canonical_ordering (gunichar *string,
#ifndef G_DISABLE_DEPRECATED
/* Deprecated. Use g_unichar_fully_decompose() */
gunichar *g_unicode_canonical_decomposition (gunichar ch,
gsize *result_len) G_GNUC_MALLOC;
gsize *result_len) G_GNUC_MALLOC G_GNUC_DEPRECATED;
#endif
/* Array of skip-bytes-per-initial character.
......
......@@ -234,7 +234,7 @@ const gchar * g_path_skip_root (const gchar *file_name);
#ifndef G_DISABLE_DEPRECATED
const gchar * g_basename (const gchar *file_name);
const gchar * g_basename (const gchar *file_name) G_GNUC_DEPRECATED_FOR(g_path_get_basename);
#define g_dirname g_path_get_dirname
#endif /* G_DISABLE_DEPRECATED */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment