LCOV - code coverage report
Current view: top level - glib/girepository - girepository.h (source / functions) Hit Total Coverage
Test: unnamed Lines: 1 1 100.0 %
Date: 2024-05-07 05:15:23 Functions: 4 4 100.0 %
Branches: 4 6 66.7 %

           Branch data     Line data    Source code
       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                 :            : 
      30                 :            : #include <girepository/gi-visibility.h>
      31                 :            : 
      32                 :            : #define __GIREPOSITORY_H_INSIDE__
      33                 :            : 
      34                 :            : #include <girepository/giarginfo.h>
      35                 :            : #include <girepository/gibaseinfo.h>
      36                 :            : #include <girepository/gicallableinfo.h>
      37                 :            : #include <girepository/gicallbackinfo.h>
      38                 :            : #include <girepository/giconstantinfo.h>
      39                 :            : #include <girepository/gienuminfo.h>
      40                 :            : #include <girepository/gifieldinfo.h>
      41                 :            : #include <girepository/giflagsinfo.h>
      42                 :            : #include <girepository/gifunctioninfo.h>
      43                 :            : #include <girepository/giinterfaceinfo.h>
      44                 :            : #include <girepository/giobjectinfo.h>
      45                 :            : #include <girepository/gipropertyinfo.h>
      46                 :            : #include <girepository/giregisteredtypeinfo.h>
      47                 :            : #include <girepository/gisignalinfo.h>
      48                 :            : #include <girepository/gistructinfo.h>
      49                 :            : #include <girepository/gitypeinfo.h>
      50                 :            : #include <girepository/gitypelib.h>
      51                 :            : #include <girepository/gitypes.h>
      52                 :            : #include <girepository/giunioninfo.h>
      53                 :            : #include <girepository/giunresolvedinfo.h>
      54                 :            : #include <girepository/givalueinfo.h>
      55                 :            : #include <girepository/givfuncinfo.h>
      56                 :            : 
      57                 :            : G_BEGIN_DECLS
      58                 :            : 
      59                 :            : #define GI_TYPE_REPOSITORY (gi_repository_get_type ())
      60                 :            : GI_AVAILABLE_IN_ALL
      61   [ +  +  +  -  :       5384 : G_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                 :            :  */
      72                 :            : typedef enum
      73                 :            : {
      74                 :            :   GI_REPOSITORY_LOAD_FLAG_NONE = 0,
      75                 :            :   GI_REPOSITORY_LOAD_FLAG_LAZY = 1 << 0
      76                 :            : } GIRepositoryLoadFlags;
      77                 :            : 
      78                 :            : /* Repository */
      79                 :            : 
      80                 :            : GI_AVAILABLE_IN_ALL
      81                 :            : GIRepository *gi_repository_new (void);
      82                 :            : 
      83                 :            : GI_AVAILABLE_IN_ALL
      84                 :            : void          gi_repository_prepend_search_path (GIRepository *repository,
      85                 :            :                                                  const char   *directory);
      86                 :            : 
      87                 :            : GI_AVAILABLE_IN_ALL
      88                 :            : void          gi_repository_prepend_library_path (GIRepository *repository,
      89                 :            :                                                   const char   *directory);
      90                 :            : 
      91                 :            : GI_AVAILABLE_IN_ALL
      92                 :            : const char * const * gi_repository_get_search_path (GIRepository *repository,
      93                 :            :                                                     size_t       *n_paths_out);
      94                 :            : 
      95                 :            : GI_AVAILABLE_IN_ALL
      96                 :            : const char * const *gi_repository_get_library_path (GIRepository *repository,
      97                 :            :                                                     size_t       *n_paths_out);
      98                 :            : 
      99                 :            : GI_AVAILABLE_IN_ALL
     100                 :            : const char *  gi_repository_load_typelib  (GIRepository           *repository,
     101                 :            :                                            GITypelib              *typelib,
     102                 :            :                                            GIRepositoryLoadFlags   flags,
     103                 :            :                                            GError                **error);
     104                 :            : 
     105                 :            : GI_AVAILABLE_IN_ALL
     106                 :            : gboolean      gi_repository_is_registered (GIRepository *repository,
     107                 :            :                                            const char   *namespace_,
     108                 :            :                                            const char   *version);
     109                 :            : 
     110                 :            : GI_AVAILABLE_IN_ALL
     111                 :            : GIBaseInfo *  gi_repository_find_by_name  (GIRepository *repository,
     112                 :            :                                            const char   *namespace_,
     113                 :            :                                            const char   *name);
     114                 :            : 
     115                 :            : GI_AVAILABLE_IN_ALL
     116                 :            : char       ** gi_repository_enumerate_versions (GIRepository *repository,
     117                 :            :                                                 const char   *namespace_,
     118                 :            :                                                 size_t       *n_versions_out);
     119                 :            : 
     120                 :            : GI_AVAILABLE_IN_ALL
     121                 :            : GITypelib *    gi_repository_require       (GIRepository           *repository,
     122                 :            :                                             const char             *namespace_,
     123                 :            :                                             const char             *version,
     124                 :            :                                             GIRepositoryLoadFlags   flags,
     125                 :            :                                             GError                **error);
     126                 :            : 
     127                 :            : GI_AVAILABLE_IN_ALL
     128                 :            : GITypelib *    gi_repository_require_private (GIRepository           *repository,
     129                 :            :                                               const char             *typelib_dir,
     130                 :            :                                               const char             *namespace_,
     131                 :            :                                               const char             *version,
     132                 :            :                                               GIRepositoryLoadFlags   flags,
     133                 :            :                                               GError                **error);
     134                 :            : 
     135                 :            : GI_AVAILABLE_IN_ALL
     136                 :            : char       ** gi_repository_get_immediate_dependencies (GIRepository *repository,
     137                 :            :                                                         const char   *namespace_,
     138                 :            :                                                         size_t       *n_dependencies_out);
     139                 :            : 
     140                 :            : GI_AVAILABLE_IN_ALL
     141                 :            : char       ** gi_repository_get_dependencies (GIRepository *repository,
     142                 :            :                                               const char   *namespace_,
     143                 :            :                                               size_t       *n_dependencies_out);
     144                 :            : 
     145                 :            : GI_AVAILABLE_IN_ALL
     146                 :            : char       ** gi_repository_get_loaded_namespaces (GIRepository *repository,
     147                 :            :                                                    size_t       *n_namespaces_out);
     148                 :            : 
     149                 :            : GI_AVAILABLE_IN_ALL
     150                 :            : GIBaseInfo *  gi_repository_find_by_gtype (GIRepository *repository,
     151                 :            :                                            GType         gtype);
     152                 :            : 
     153                 :            : GI_AVAILABLE_IN_ALL
     154                 :            : void          gi_repository_get_object_gtype_interfaces (GIRepository      *repository,
     155                 :            :                                                          GType              gtype,
     156                 :            :                                                          size_t            *n_interfaces_out,
     157                 :            :                                                          GIInterfaceInfo ***interfaces_out);
     158                 :            : 
     159                 :            : GI_AVAILABLE_IN_ALL
     160                 :            : unsigned int  gi_repository_get_n_infos   (GIRepository *repository,
     161                 :            :                                            const char   *namespace_);
     162                 :            : 
     163                 :            : GI_AVAILABLE_IN_ALL
     164                 :            : GIBaseInfo *  gi_repository_get_info      (GIRepository *repository,
     165                 :            :                                            const char   *namespace_,
     166                 :            :                                            unsigned int  idx);
     167                 :            : 
     168                 :            : GI_AVAILABLE_IN_ALL
     169                 :            : GIEnumInfo *  gi_repository_find_by_error_domain (GIRepository *repository,
     170                 :            :                                                   GQuark        domain);
     171                 :            : 
     172                 :            : GI_AVAILABLE_IN_ALL
     173                 :            : const char  * gi_repository_get_typelib_path   (GIRepository *repository,
     174                 :            :                                                 const char   *namespace_);
     175                 :            : GI_AVAILABLE_IN_ALL
     176                 :            : const char * const *gi_repository_get_shared_libraries (GIRepository *repository,
     177                 :            :                                                         const char   *namespace_,
     178                 :            :                                                         size_t       *out_n_elements);
     179                 :            : GI_AVAILABLE_IN_ALL
     180                 :            : const char  * gi_repository_get_c_prefix (GIRepository *repository,
     181                 :            :                                           const char   *namespace_);
     182                 :            : GI_AVAILABLE_IN_ALL
     183                 :            : const char  * gi_repository_get_version (GIRepository *repository,
     184                 :            :                                          const char   *namespace_);
     185                 :            : 
     186                 :            : 
     187                 :            : GI_AVAILABLE_IN_ALL
     188                 :            : GOptionGroup * gi_repository_get_option_group (void);
     189                 :            : 
     190                 :            : 
     191                 :            : GI_AVAILABLE_IN_ALL
     192                 :            : gboolean       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                 :            :  */
     211                 :            : typedef enum
     212                 :            : {
     213                 :            :   GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND,
     214                 :            :   GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH,
     215                 :            :   GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
     216                 :            :   GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND
     217                 :            : } GIRepositoryError;
     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                 :            : 
     231                 :            : GI_AVAILABLE_IN_ALL
     232                 :            : GQuark gi_repository_error_quark (void);
     233                 :            : 
     234                 :            : 
     235                 :            : /* Global utility functions */
     236                 :            : 
     237                 :            : GI_AVAILABLE_IN_ALL
     238                 :            : void gi_cclosure_marshal_generic (GClosure       *closure,
     239                 :            :                                   GValue         *return_gvalue,
     240                 :            :                                   unsigned int    n_param_values,
     241                 :            :                                   const GValue   *param_values,
     242                 :            :                                   void           *invocation_hint,
     243                 :            :                                   void           *marshal_data);
     244                 :            : 
     245                 :            : #include <girepository/girepository-autocleanups.h>
     246                 :            : 
     247                 :            : G_END_DECLS

Generated by: LCOV version 1.14