Annotate API introduced for 2.30 with GLIB_AVAILABLE_IN_2_30

I didn't do this comprehensively, since there's a lot of it, mainly
due to the GDBus object manager stuff, but anyone trying to use
that would fail fast due to lack of the gdbus code generator.

My main goal was to get API additions to existing classes like
g_data_input_stream_read_line_utf8(), as well as the lower level new
API like glib-unix.h.

https://bugzilla.gnome.org/show_bug.cgi?id=676816
This commit is contained in:
Colin Walters 2012-05-25 08:42:50 -04:00
parent 9c86e1168c
commit a963712646
12 changed files with 38 additions and 0 deletions

View File

@ -58,6 +58,7 @@ struct _GActionInterface
GVariant *parameter);
};
GLIB_AVAILABLE_IN_2_30
GType g_action_get_type (void) G_GNUC_CONST;
const gchar * g_action_get_name (GAction *action);

View File

@ -102,6 +102,7 @@ char * g_data_input_stream_read_line (GDataInputStrea
gsize *length,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_30
char * g_data_input_stream_read_line_utf8 (GDataInputStream *stream,
gsize *length,
GCancellable *cancellable,
@ -115,6 +116,7 @@ char * g_data_input_stream_read_line_finish (GDataInputStrea
GAsyncResult *result,
gsize *length,
GError **error);
GLIB_AVAILABLE_IN_2_30
char * g_data_input_stream_read_line_finish_utf8(GDataInputStream *stream,
GAsyncResult *result,
gsize *length,

View File

@ -181,6 +181,7 @@ GVariant *g_dbus_connection_call_sync (GDBusConnection
gint timeout_msec,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_30
void g_dbus_connection_call_with_unix_fd_list (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
@ -194,10 +195,12 @@ void g_dbus_connection_call_with_unix_fd_list (GDBusConnection
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GLIB_AVAILABLE_IN_2_30
GVariant *g_dbus_connection_call_with_unix_fd_list_finish (GDBusConnection *connection,
GUnixFDList **out_fd_list,
GAsyncResult *res,
GError **error);
GLIB_AVAILABLE_IN_2_30
GVariant *g_dbus_connection_call_with_unix_fd_list_sync (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,

View File

@ -40,8 +40,10 @@ gboolean g_atomic_int_compare_and_exchange (volatile gint *a
gint newval);
gint g_atomic_int_add (volatile gint *atomic,
gint val);
GLIB_AVAILABLE_IN_2_30
guint g_atomic_int_and (volatile guint *atomic,
guint val);
GLIB_AVAILABLE_IN_2_30
guint g_atomic_int_or (volatile guint *atomic,
guint val);
guint g_atomic_int_xor (volatile guint *atomic,
@ -55,8 +57,10 @@ gboolean g_atomic_pointer_compare_and_exchange (volatile void *a
gpointer newval);
gssize g_atomic_pointer_add (volatile void *atomic,
gssize val);
GLIB_AVAILABLE_IN_2_30
gsize g_atomic_pointer_and (volatile void *atomic,
gsize val);
GLIB_AVAILABLE_IN_2_30
gsize g_atomic_pointer_or (volatile void *atomic,
gsize val);
gsize g_atomic_pointer_xor (volatile void *atomic,

View File

@ -100,7 +100,9 @@ gchar *g_file_read_link (const gchar *filename,
GError **error);
/* Wrapper / workalike for mkdtemp() */
GLIB_AVAILABLE_IN_2_30
gchar *g_mkdtemp (gchar *tmpl);
GLIB_AVAILABLE_IN_2_30
gchar *g_mkdtemp_full (gchar *tmpl,
gint mode);
@ -114,6 +116,7 @@ gint g_mkstemp_full (gchar *tmpl,
gint g_file_open_tmp (const gchar *tmpl,
gchar **name_used,
GError **error);
GLIB_AVAILABLE_IN_2_30
gchar *g_dir_make_tmp (const gchar *tmpl,
GError **error);

View File

@ -107,6 +107,7 @@ gboolean g_hash_table_iter_next (GHashTableIter *iter,
gpointer *value);
GHashTable* g_hash_table_iter_get_hash_table (GHashTableIter *iter);
void g_hash_table_iter_remove (GHashTableIter *iter);
GLIB_AVAILABLE_IN_2_30
void g_hash_table_iter_replace (GHashTableIter *iter,
gpointer value);
void g_hash_table_iter_steal (GHashTableIter *iter);

View File

@ -41,25 +41,34 @@ G_BEGIN_DECLS
*/
typedef struct _GHmac GHmac;
GLIB_AVAILABLE_IN_2_30
GHmac * g_hmac_new (GChecksumType digest_type,
const guchar *key,
gsize key_len);
GLIB_AVAILABLE_IN_2_30
GHmac * g_hmac_copy (const GHmac *hmac);
GLIB_AVAILABLE_IN_2_30
GHmac * g_hmac_ref (GHmac *hmac);
GLIB_AVAILABLE_IN_2_30
void g_hmac_unref (GHmac *hmac);
GLIB_AVAILABLE_IN_2_30
void g_hmac_update (GHmac *hmac,
const guchar *data,
gssize length);
GLIB_AVAILABLE_IN_2_30
const gchar * g_hmac_get_string (GHmac *hmac);
GLIB_AVAILABLE_IN_2_30
void g_hmac_get_digest (GHmac *hmac,
guint8 *buffer,
gsize *digest_len);
GLIB_AVAILABLE_IN_2_30
gchar *g_compute_hmac_for_data (GChecksumType digest_type,
const guchar *key,
gsize key_len,
const guchar *data,
gsize length);
GLIB_AVAILABLE_IN_2_30
gchar *g_compute_hmac_for_string (GChecksumType digest_type,
const guchar *key,
gsize key_len,

View File

@ -57,24 +57,30 @@ G_BEGIN_DECLS
*/
#define G_UNIX_ERROR (g_unix_error_quark())
GLIB_AVAILABLE_IN_2_30
GQuark g_unix_error_quark (void);
GLIB_AVAILABLE_IN_2_30
gboolean g_unix_open_pipe (gint *fds,
gint flags,
GError **error);
GLIB_AVAILABLE_IN_2_30
gboolean g_unix_set_fd_nonblocking (gint fd,
gboolean nonblock,
GError **error);
GLIB_AVAILABLE_IN_2_30
GSource *g_unix_signal_source_new (gint signum);
GLIB_AVAILABLE_IN_2_30
guint g_unix_signal_add_full (gint priority,
gint signum,
GSourceFunc handler,
gpointer user_data,
GDestroyNotify notify);
GLIB_AVAILABLE_IN_2_30
guint g_unix_signal_add (gint signum,
GSourceFunc handler,
gpointer user_data);

View File

@ -628,6 +628,7 @@ gchar* g_utf8_find_prev_char (const gchar *str,
glong g_utf8_strlen (const gchar *p,
gssize max) G_GNUC_PURE;
GLIB_AVAILABLE_IN_2_30
gchar *g_utf8_substring (const gchar *str,
glong start_pos,
glong end_pos) G_GNUC_MALLOC;

View File

@ -207,8 +207,10 @@ typedef enum
G_FORMAT_SIZE_IEC_UNITS = 1 << 1
} GFormatSizeFlags;
GLIB_AVAILABLE_IN_2_30
gchar *g_format_size_full (guint64 size,
GFormatSizeFlags flags);
GLIB_AVAILABLE_IN_2_30
gchar *g_format_size (guint64 size);
GLIB_DEPRECATED_FOR(g_format_size)

View File

@ -86,6 +86,7 @@ gboolean g_variant_is_signature (const g
GVariant * g_variant_new_variant (GVariant *value);
GVariant * g_variant_new_strv (const gchar * const *strv,
gssize length);
GLIB_AVAILABLE_IN_2_30
GVariant * g_variant_new_objv (const gchar * const *strv,
gssize length);
GVariant * g_variant_new_bytestring (const gchar *string);
@ -114,6 +115,7 @@ const gchar ** g_variant_get_strv (GVarian
gsize *length);
gchar ** g_variant_dup_strv (GVariant *value,
gsize *length);
GLIB_AVAILABLE_IN_2_30
const gchar ** g_variant_get_objv (GVariant *value,
gsize *length);
gchar ** g_variant_dup_objv (GVariant *value,

View File

@ -237,6 +237,7 @@ GType g_ptr_array_get_type (void) G_GNUC_CONST;
GType g_bytes_get_type (void) G_GNUC_CONST;
GType g_variant_type_get_gtype (void) G_GNUC_CONST;
GType g_regex_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_30
GType g_match_info_get_type (void) G_GNUC_CONST;
GType g_error_get_type (void) G_GNUC_CONST;
GType g_date_time_get_type (void) G_GNUC_CONST;
@ -244,8 +245,11 @@ GType g_io_channel_get_type (void) G_GNUC_CONST;
GType g_io_condition_get_type (void) G_GNUC_CONST;
GType g_variant_builder_get_type (void) G_GNUC_CONST;
GType g_key_file_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_30
GType g_main_loop_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_30
GType g_main_context_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_30
GType g_source_get_type (void) G_GNUC_CONST;
GLIB_DEPRECATED_FOR('G_TYPE_VARIANT')