* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Stef Walter <stefw@collabora.co.uk>
*/
gchar *warning;
};
-G_DEFINE_TYPE (GTlsPassword, g_tls_password, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (GTlsPassword, g_tls_password, G_TYPE_OBJECT)
static void
g_tls_password_init (GTlsPassword *password)
{
- password->priv = G_TYPE_INSTANCE_GET_PRIVATE (password, G_TYPE_TLS_PASSWORD,
- GTlsPasswordPrivate);
+ password->priv = g_tls_password_get_instance_private (password);
}
static const guchar *
}
static void
-g_tls_password_real_set_value (GTlsPassword *password,
- guchar *value,
- gssize length,
- GDestroyNotify destroy)
+g_tls_password_real_set_value (GTlsPassword *password,
+ guchar *value,
+ gssize length,
+ GDestroyNotify destroy)
{
if (password->priv->destroy)
(password->priv->destroy) (password->priv->value);
}
static void
-g_tls_password_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+g_tls_password_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GTlsPassword *password = G_TLS_PASSWORD (object);
gobject_class->set_property = g_tls_password_set_property;
gobject_class->finalize = g_tls_password_finalize;
- g_type_class_add_private (klass, sizeof (GTlsPasswordPrivate));
-
g_object_class_install_property (gobject_class, PROP_FLAGS,
- g_param_spec_flags ("flags", "Flags", "Flags about the password",
- G_TYPE_TLS_PASSWORD_FLAGS, G_TLS_PASSWORD_NONE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_flags ("flags",
+ P_("Flags"),
+ P_("Flags about the password"),
+ G_TYPE_TLS_PASSWORD_FLAGS,
+ G_TLS_PASSWORD_NONE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_DESCRIPTION,
- g_param_spec_string ("description", "Description", "Description of what the password is for",
- "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_string ("description",
+ P_("Description"),
+ P_("Description of what the password is for"),
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_WARNING,
- g_param_spec_string ("warning", "Warning", "Warning about the password",
- "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_string ("warning",
+ P_("Warning"),
+ P_("Warning about the password"),
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
}
* @password: a #GTlsPassword object
* @length: (allow-none): location to place the length of the password.
*
- * Get the password value. If @length is not %NULL then it will be filled
- * in with the length of the password value.
+ * Get the password value. If @length is not %NULL then it will be
+ * filled in with the length of the password value. (Note that the
+ * password value is not nul-terminated, so you can only pass %NULL
+ * for @length in contexts where you know the password will have a
+ * certain fixed length.)
*
- * Returns: The password value owned by the password object.
+ * Returns: The password value (owned by the password object).
*
* Since: 2.30
*/
* Set the value for this password. The @value will be copied by the password
* object.
*
- * Specify the @length, for a non-null-terminated password. Pass -1 as
- * @length if using a null-terminated password, and @length will be calculated
- * automatically.
+ * Specify the @length, for a non-nul-terminated password. Pass -1 as
+ * @length if using a nul-terminated password, and @length will be
+ * calculated automatically. (Note that the terminating nul is not
+ * considered part of the password in this case.)
*
* Since: 2.30
*/
* The @value will be owned by the password object, and later freed using
* the @destroy function callback.
*
- * Specify the @length, for a non-null-terminated password. Pass -1 as
- * @length if using a null-terminated password, and @length will be calculated
- * automatically.
+ * Specify the @length, for a non-nul-terminated password. Pass -1 as
+ * @length if using a nul-terminated password, and @length will be
+ * calculated automatically. (Note that the terminating nul is not
+ * considered part of the password in this case.)
*
+ * Virtual: set_value
* Since: 2.30
*/
void
-g_tls_password_set_value_full (GTlsPassword *password,
- guchar *value,
- gssize length,
- GDestroyNotify destroy)
+g_tls_password_set_value_full (GTlsPassword *password,
+ guchar *value,
+ gssize length,
+ GDestroyNotify destroy)
{
g_return_if_fail (G_IS_TLS_PASSWORD (password));
G_TLS_PASSWORD_GET_CLASS (password)->set_value (password, value,
*
* Get flags about the password.
*
- * Return value: The flags about the password.
+ * Returns: The flags about the password.
*
* Since: 2.30
*/
*
* Get a description string about what the password will be used for.
*
- * Return value: The description of the password.
+ * Returns: The description of the password.
*
* Since: 2.30
*/
* representation of the password flags returned from
* g_tls_password_get_flags().
*
- * Return value: The warning.
+ * Returns: The warning.
*
* Since: 2.30
*/