Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
girepository.h
Go to the documentation of this file.
1/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
2 * GObject introspection: Repository
3 *
4 * Copyright (C) 2005 Matthias Clasen
5 * Copyright (C) 2008,2009 Red Hat, Inc.
6 *
7 * SPDX-License-Identifier: LGPL-2.1-or-later
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
23 */
24
25#pragma once
26
27#include <glib-object.h>
28#include <gmodule.h>
29
31
32#define __GIREPOSITORY_H_INSIDE__
33
56
58
59#define GI_TYPE_REPOSITORY (gi_repository_get_type ())
61G_DECLARE_FINAL_TYPE (GIRepository, gi_repository, GI, REPOSITORY, GObject)
62
63/**
64 * GIRepositoryLoadFlags:
65 * @GI_REPOSITORY_LOAD_FLAG_NONE: No flags set.
66 * @GI_REPOSITORY_LOAD_FLAG_LAZY: Lazily load the typelib.
67 *
68 * Flags that control how a typelib is loaded.
69 *
70 * Since: 2.80
71 */
77
78/* Repository */
79
81GIRepository *gi_repository_new (void);
82
84void gi_repository_prepend_search_path (GIRepository *repository,
85 const char *directory);
86
88void gi_repository_prepend_library_path (GIRepository *repository,
89 const char *directory);
90
92const char * const * gi_repository_get_search_path (GIRepository *repository,
93 size_t *n_paths_out);
94
96const char * const *gi_repository_get_library_path (GIRepository *repository,
97 size_t *n_paths_out);
98
100const char * gi_repository_load_typelib (GIRepository *repository,
101 GITypelib *typelib,
103 GError **error);
104
106gboolean gi_repository_is_registered (GIRepository *repository,
107 const char *namespace_,
108 const char *version);
109
111GIBaseInfo * gi_repository_find_by_name (GIRepository *repository,
112 const char *namespace_,
113 const char *name);
114
116char ** gi_repository_enumerate_versions (GIRepository *repository,
117 const char *namespace_,
118 size_t *n_versions_out);
119
121GITypelib * gi_repository_require (GIRepository *repository,
122 const char *namespace_,
123 const char *version,
125 GError **error);
126
128GITypelib * gi_repository_require_private (GIRepository *repository,
129 const char *typelib_dir,
130 const char *namespace_,
131 const char *version,
133 GError **error);
134
136char ** gi_repository_get_immediate_dependencies (GIRepository *repository,
137 const char *namespace_,
138 size_t *n_dependencies_out);
139
141char ** gi_repository_get_dependencies (GIRepository *repository,
142 const char *namespace_,
143 size_t *n_dependencies_out);
144
146char ** gi_repository_get_loaded_namespaces (GIRepository *repository,
147 size_t *n_namespaces_out);
148
150GIBaseInfo * gi_repository_find_by_gtype (GIRepository *repository,
151 GType gtype);
152
154void gi_repository_get_object_gtype_interfaces (GIRepository *repository,
155 GType gtype,
156 size_t *n_interfaces_out,
157 GIInterfaceInfo ***interfaces_out);
158
160unsigned int gi_repository_get_n_infos (GIRepository *repository,
161 const char *namespace_);
162
164GIBaseInfo * gi_repository_get_info (GIRepository *repository,
165 const char *namespace_,
166 unsigned int idx);
167
170 GQuark domain);
171
173const char * gi_repository_get_typelib_path (GIRepository *repository,
174 const char *namespace_);
176const char * const *gi_repository_get_shared_libraries (GIRepository *repository,
177 const char *namespace_,
178 size_t *out_n_elements);
180const char * gi_repository_get_c_prefix (GIRepository *repository,
181 const char *namespace_);
183const char * gi_repository_get_version (GIRepository *repository,
184 const char *namespace_);
185
186
189
190
192gboolean gi_repository_dump (const char *input_filename,
193 const char *output_filename,
194 GError **error);
195
196/**
197 * GIRepositoryError:
198 * @GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found.
199 * @GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the
200 * requested namespace.
201 * @GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the
202 * typelib does not match the requested version.
203 * @GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib
204 * could not be found.
205 *
206 * An error code used with `GI_REPOSITORY_ERROR` in a [type@GLib.Error]
207 * returned from a [class@GIRepository.Repository] routine.
208 *
209 * Since: 2.80
210 */
218
219/**
220 * GI_REPOSITORY_ERROR:
221 *
222 * Error domain for [class@GIRepository.Repository].
223 *
224 * Errors in this domain will be from the [enum@GIRepository.Error] enumeration.
225 * See [type@GLib.Error] for more information on error domains.
226 *
227 * Since: 2.80
228 */
229#define GI_REPOSITORY_ERROR (gi_repository_error_quark ())
230
233
234
235/* Global utility functions */
236
239 GValue *return_gvalue,
240 unsigned int n_param_values,
241 const GValue *param_values,
242 void *invocation_hint,
243 void *marshal_data);
244
246
#define GI_AVAILABLE_IN_ALL
GI_AVAILABLE_IN_ALL GIRepository * gi_repository_new(void)
GIRepositoryError
@ GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH
@ GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND
@ GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND
@ GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT
GI_AVAILABLE_IN_ALL char ** gi_repository_enumerate_versions(GIRepository *repository, const char *namespace_, size_t *n_versions_out)
GI_AVAILABLE_IN_ALL const char *const * gi_repository_get_search_path(GIRepository *repository, size_t *n_paths_out)
GI_AVAILABLE_IN_ALL const char * gi_repository_get_c_prefix(GIRepository *repository, const char *namespace_)
GI_AVAILABLE_IN_ALL GIBaseInfo * gi_repository_find_by_gtype(GIRepository *repository, GType gtype)
GI_AVAILABLE_IN_ALL gboolean gi_repository_is_registered(GIRepository *repository, const char *namespace_, const char *version)
GI_AVAILABLE_IN_ALL char ** gi_repository_get_loaded_namespaces(GIRepository *repository, size_t *n_namespaces_out)
GI_AVAILABLE_IN_ALL GOptionGroup * gi_repository_get_option_group(void)
GI_AVAILABLE_IN_ALL const char * gi_repository_get_typelib_path(GIRepository *repository, const char *namespace_)
GI_AVAILABLE_IN_ALL void gi_repository_get_object_gtype_interfaces(GIRepository *repository, GType gtype, size_t *n_interfaces_out, GIInterfaceInfo ***interfaces_out)
GI_AVAILABLE_IN_ALL GIEnumInfo * gi_repository_find_by_error_domain(GIRepository *repository, GQuark domain)
GI_AVAILABLE_IN_ALL char ** gi_repository_get_immediate_dependencies(GIRepository *repository, const char *namespace_, size_t *n_dependencies_out)
GI_AVAILABLE_IN_ALL char ** gi_repository_get_dependencies(GIRepository *repository, const char *namespace_, size_t *n_dependencies_out)
GI_AVAILABLE_IN_ALL GITypelib * gi_repository_require_private(GIRepository *repository, const char *typelib_dir, const char *namespace_, const char *version, GIRepositoryLoadFlags flags, GError **error)
GI_AVAILABLE_IN_ALL const char *const * gi_repository_get_shared_libraries(GIRepository *repository, const char *namespace_, size_t *out_n_elements)
GI_AVAILABLE_IN_ALL const char *const * gi_repository_get_library_path(GIRepository *repository, size_t *n_paths_out)
GI_AVAILABLE_IN_ALL const char * gi_repository_load_typelib(GIRepository *repository, GITypelib *typelib, GIRepositoryLoadFlags flags, GError **error)
GI_AVAILABLE_IN_ALL GQuark gi_repository_error_quark(void)
GI_AVAILABLE_IN_ALL GITypelib * gi_repository_require(GIRepository *repository, const char *namespace_, const char *version, GIRepositoryLoadFlags flags, GError **error)
GI_AVAILABLE_IN_ALL unsigned int gi_repository_get_n_infos(GIRepository *repository, const char *namespace_)
GI_AVAILABLE_IN_ALL void gi_cclosure_marshal_generic(GClosure *closure, GValue *return_gvalue, unsigned int n_param_values, const GValue *param_values, void *invocation_hint, void *marshal_data)
GIRepositoryLoadFlags
@ GI_REPOSITORY_LOAD_FLAG_NONE
@ GI_REPOSITORY_LOAD_FLAG_LAZY
GI_AVAILABLE_IN_ALL const char * gi_repository_get_version(GIRepository *repository, const char *namespace_)
GI_AVAILABLE_IN_ALL void gi_repository_prepend_search_path(GIRepository *repository, const char *directory)
GI_AVAILABLE_IN_ALL GIBaseInfo * gi_repository_get_info(GIRepository *repository, const char *namespace_, unsigned int idx)
GI_AVAILABLE_IN_ALL GIBaseInfo * gi_repository_find_by_name(GIRepository *repository, const char *namespace_, const char *name)
GI_AVAILABLE_IN_ALL gboolean gi_repository_dump(const char *input_filename, const char *output_filename, GError **error)
GI_AVAILABLE_IN_ALL void gi_repository_prepend_library_path(GIRepository *repository, const char *directory)
typedefG_BEGIN_DECLS struct _GITypelib GITypelib
Definition gitypelib.h:37
typedefG_BEGIN_DECLS struct _GIBaseInfo GIBaseInfo
Definition gitypes.h:41
struct _GIEnumInfo GIEnumInfo
Definition gitypes.h:80
struct _GIInterfaceInfo GIInterfaceInfo
Definition gitypes.h:92
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
struct _GOptionGroup GOptionGroup
Definition goption.h:53
G_BEGIN_DECLS typedef guint32 GQuark
Definition gquark.h:38
#define G_DECLARE_FINAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName)
Definition gtype.h:1602
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
const char * name
Definition lsqlite3.c:2154
static void error(LoadState *S, const char *why)