Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-06 08:41:17

0001 /*
0002  * Copyright © 2015 Canonical Limited
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public
0017  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Author: Ryan Lortie <desrt@desrt.ca>
0020  */
0021 
0022 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0023 #error "Only <glib.h> can be included directly."
0024 #endif
0025 
0026 #ifndef __GI_SCANNER__
0027 
0028 static inline void
0029 g_autoptr_cleanup_generic_gfree (void *p)
0030 {
0031   void **pp = (void**)p;
0032   g_free (*pp);
0033 }
0034 
0035 static inline void
0036 g_autoptr_cleanup_gstring_free (GString *string)
0037 {
0038   if (string)
0039     g_string_free (string, TRUE);
0040 }
0041 
0042 /* Ignore deprecations in case we refer to a type which was added in a more
0043  * recent GLib version than the user’s #GLIB_VERSION_MAX_ALLOWED definition. */
0044 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0045 
0046 /* If adding a cleanup here, please also add a test case to
0047  * glib/tests/autoptr.c
0048  */
0049 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncQueue, g_async_queue_unref)
0050 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBookmarkFile, g_bookmark_file_free)
0051 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBytes, g_bytes_unref)
0052 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GChecksum, g_checksum_free)
0053 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDateTime, g_date_time_unref)
0054 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDate, g_date_free)
0055 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDir, g_dir_close)
0056 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GError, g_error_free)
0057 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHashTable, g_hash_table_unref)
0058 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHmac, g_hmac_unref)
0059 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOChannel, g_io_channel_unref)
0060 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GKeyFile, g_key_file_unref)
0061 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GList, g_list_free)
0062 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GArray, g_array_unref)
0063 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPtrArray, g_ptr_array_unref)
0064 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GByteArray, g_byte_array_unref)
0065 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContext, g_main_context_unref)
0066 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContextPusher, g_main_context_pusher_free)
0067 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainLoop, g_main_loop_unref)
0068 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSource, g_source_unref)
0069 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMappedFile, g_mapped_file_unref)
0070 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMarkupParseContext, g_markup_parse_context_unref)
0071 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNode, g_node_destroy)
0072 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionContext, g_option_context_free)
0073 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionGroup, g_option_group_unref)
0074 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPatternSpec, g_pattern_spec_free)
0075 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GQueue, g_queue_free)
0076 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GQueue, g_queue_clear)
0077 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free)
0078 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRegex, g_regex_unref)
0079 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo, g_match_info_unref)
0080 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GScanner, g_scanner_destroy)
0081 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSequence, g_sequence_free)
0082 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSList, g_slist_free)
0083 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free)
0084 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GStringChunk, g_string_chunk_free)
0085 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GStrvBuilder, g_strv_builder_unref)
0086 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThread, g_thread_unref)
0087 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GMutex, g_mutex_clear)
0088 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMutexLocker, g_mutex_locker_free)
0089 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRecMutexLocker, g_rec_mutex_locker_free)
0090 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRWLockWriterLocker, g_rw_lock_writer_locker_free)
0091 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRWLockReaderLocker, g_rw_lock_reader_locker_free)
0092 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GCond, g_cond_clear)
0093 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimer, g_timer_destroy)
0094 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimeZone, g_time_zone_unref)
0095 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTree, g_tree_unref)
0096 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariant, g_variant_unref)
0097 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantBuilder, g_variant_builder_unref)
0098 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantBuilder, g_variant_builder_clear)
0099 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantIter, g_variant_iter_free)
0100 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
0101 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
0102 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
0103 G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
0104 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRefString, g_ref_string_release)
0105 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUri, g_uri_unref)
0106 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GPathBuf, g_path_buf_free)
0107 G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (GPathBuf, g_path_buf_clear)
0108 
0109 G_GNUC_END_IGNORE_DEPRECATIONS
0110 
0111 #endif /* __GI_SCANNER__ */