Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:00

0001 /* GIO - GLib Input, Output and Streaming Library
0002  *
0003  * Copyright (C) 2011 Collabora, Ltd.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: Stef Walter <stefw@collabora.co.uk>
0021  */
0022 
0023 #ifndef __G_TLS_PASSWORD_H__
0024 #define __G_TLS_PASSWORD_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/giotypes.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 #define G_TYPE_TLS_PASSWORD         (g_tls_password_get_type ())
0035 #define G_TLS_PASSWORD(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TLS_PASSWORD, GTlsPassword))
0036 #define G_TLS_PASSWORD_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_TLS_PASSWORD, GTlsPasswordClass))
0037 #define G_IS_TLS_PASSWORD(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TLS_PASSWORD))
0038 #define G_IS_TLS_PASSWORD_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_TLS_PASSWORD))
0039 #define G_TLS_PASSWORD_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_TLS_PASSWORD, GTlsPasswordClass))
0040 
0041 typedef struct _GTlsPasswordClass   GTlsPasswordClass;
0042 typedef struct _GTlsPasswordPrivate GTlsPasswordPrivate;
0043 
0044 struct _GTlsPassword
0045 {
0046   GObject parent_instance;
0047 
0048   GTlsPasswordPrivate *priv;
0049 };
0050 
0051 /**
0052  * GTlsPasswordClass:
0053  * @get_value: virtual method for g_tls_password_get_value()
0054  * @set_value: virtual method for g_tls_password_set_value()
0055  * @get_default_warning: virtual method for g_tls_password_get_warning() if no
0056  *  value has been set using g_tls_password_set_warning()
0057  *
0058  * Class structure for #GTlsPassword.
0059  */
0060 struct _GTlsPasswordClass
0061 {
0062   GObjectClass parent_class;
0063 
0064   /* methods */
0065 
0066   const guchar *    ( *get_value)            (GTlsPassword  *password,
0067                                               gsize         *length);
0068 
0069   void              ( *set_value)            (GTlsPassword  *password,
0070                                               guchar        *value,
0071                                               gssize         length,
0072                                               GDestroyNotify destroy);
0073 
0074   const gchar*      ( *get_default_warning)  (GTlsPassword  *password);
0075 
0076   /*< private >*/
0077   /* Padding for future expansion */
0078   gpointer padding[4];
0079 };
0080 
0081 GIO_AVAILABLE_IN_ALL
0082 GType             g_tls_password_get_type            (void) G_GNUC_CONST;
0083 
0084 GIO_AVAILABLE_IN_ALL
0085 GTlsPassword *    g_tls_password_new                 (GTlsPasswordFlags  flags,
0086                                                       const gchar       *description);
0087 
0088 GIO_AVAILABLE_IN_ALL
0089 const guchar *    g_tls_password_get_value           (GTlsPassword      *password,
0090                                                       gsize             *length);
0091 GIO_AVAILABLE_IN_ALL
0092 void              g_tls_password_set_value           (GTlsPassword      *password,
0093                                                       const guchar      *value,
0094                                                       gssize             length);
0095 GIO_AVAILABLE_IN_ALL
0096 void              g_tls_password_set_value_full      (GTlsPassword      *password,
0097                                                       guchar            *value,
0098                                                       gssize             length,
0099                                                       GDestroyNotify     destroy);
0100 
0101 GIO_AVAILABLE_IN_ALL
0102 GTlsPasswordFlags g_tls_password_get_flags           (GTlsPassword      *password);
0103 GIO_AVAILABLE_IN_ALL
0104 void              g_tls_password_set_flags           (GTlsPassword      *password,
0105                                                       GTlsPasswordFlags  flags);
0106 
0107 GIO_AVAILABLE_IN_ALL
0108 const gchar*      g_tls_password_get_description     (GTlsPassword      *password);
0109 GIO_AVAILABLE_IN_ALL
0110 void              g_tls_password_set_description     (GTlsPassword      *password,
0111                                                       const gchar       *description);
0112 
0113 GIO_AVAILABLE_IN_ALL
0114 const gchar *     g_tls_password_get_warning         (GTlsPassword      *password);
0115 GIO_AVAILABLE_IN_ALL
0116 void              g_tls_password_set_warning         (GTlsPassword      *password,
0117                                                       const gchar       *warning);
0118 
0119 G_END_DECLS
0120 
0121 #endif /* __G_TLS_PASSWORD_H__ */