(root)/
glib-2.79.0/
gio/
gfileattribute-priv.h
       1  /* GIO - GLib Input, Output and Streaming Library
       2   * 
       3   * Copyright (C) 2006-2007 Red Hat, Inc.
       4   *
       5   * SPDX-License-Identifier: LGPL-2.1-or-later
       6   *
       7   * This library is free software; you can redistribute it and/or
       8   * modify it under the terms of the GNU Lesser General Public
       9   * License as published by the Free Software Foundation; either
      10   * version 2.1 of the License, or (at your option) any later version.
      11   *
      12   * This library is distributed in the hope that it will be useful,
      13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15   * Lesser General Public License for more details.
      16   *
      17   * You should have received a copy of the GNU Lesser General
      18   * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
      19   *
      20   * Author: Alexander Larsson <alexl@redhat.com>
      21   */
      22  
      23  #ifndef __G_FILE_ATTRIBUTE_PRIV_H__
      24  #define __G_FILE_ATTRIBUTE_PRIV_H__
      25  
      26  #include "gfileattribute.h"
      27  #include "gfileinfo.h"
      28  
      29  #define G_FILE_ATTRIBUTE_VALUE_INIT {0}
      30  
      31  typedef struct  {
      32    guint type : 8; /* GFileAttributeType */
      33    guint status : 8; /* GFileAttributeStatus */
      34    union {
      35      gboolean boolean;
      36      gint32 int32;
      37      guint32 uint32;
      38      gint64 int64;
      39      guint64 uint64;
      40      char *string;
      41      GObject *obj;
      42      char **stringv;
      43    } u;
      44  } GFileAttributeValue;
      45  
      46  GFileAttributeValue *_g_file_attribute_value_new             (void);
      47  void                 _g_file_attribute_value_free            (GFileAttributeValue *attr);
      48  void                 _g_file_attribute_value_clear           (GFileAttributeValue *attr);
      49  void                 _g_file_attribute_value_set             (GFileAttributeValue *attr,
      50  							      const GFileAttributeValue *new_value);
      51  GFileAttributeValue *_g_file_attribute_value_dup             (const GFileAttributeValue *other);
      52  gpointer             _g_file_attribute_value_peek_as_pointer (GFileAttributeValue *attr);
      53  
      54  char *               _g_file_attribute_value_as_string       (const GFileAttributeValue *attr);
      55  
      56  const char *         _g_file_attribute_value_get_string      (const GFileAttributeValue *attr);
      57  const char *         _g_file_attribute_value_get_byte_string (const GFileAttributeValue *attr);
      58  gboolean             _g_file_attribute_value_get_boolean     (const GFileAttributeValue *attr);
      59  guint32              _g_file_attribute_value_get_uint32      (const GFileAttributeValue *attr);
      60  gint32               _g_file_attribute_value_get_int32       (const GFileAttributeValue *attr);
      61  guint64              _g_file_attribute_value_get_uint64      (const GFileAttributeValue *attr);
      62  gint64               _g_file_attribute_value_get_int64       (const GFileAttributeValue *attr);
      63  GObject *            _g_file_attribute_value_get_object      (const GFileAttributeValue *attr);
      64  char **              _g_file_attribute_value_get_stringv     (const GFileAttributeValue *attr);
      65  
      66  void                 _g_file_attribute_value_set_from_pointer(GFileAttributeValue *attr,
      67  							      GFileAttributeType   type,
      68  							      gpointer             value_p,
      69  							      gboolean             dup);
      70  void                 _g_file_attribute_value_set_string      (GFileAttributeValue *attr,
      71  							      const char          *string);
      72  void                 _g_file_attribute_value_set_byte_string (GFileAttributeValue *attr,
      73  							      const char          *string);
      74  void                 _g_file_attribute_value_set_boolean     (GFileAttributeValue *attr,
      75  							      gboolean             value);
      76  void                 _g_file_attribute_value_set_uint32      (GFileAttributeValue *attr,
      77  							      guint32              value);
      78  void                 _g_file_attribute_value_set_int32       (GFileAttributeValue *attr,
      79  							      gint32               value);
      80  void                 _g_file_attribute_value_set_uint64      (GFileAttributeValue *attr,
      81  							      guint64              value);
      82  void                 _g_file_attribute_value_set_int64       (GFileAttributeValue *attr,
      83  							      gint64               value);
      84  void                 _g_file_attribute_value_set_object      (GFileAttributeValue *attr,
      85  							      GObject             *obj);
      86  void                 _g_file_attribute_value_set_stringv     (GFileAttributeValue *attr,
      87  							      char               **value);
      88  
      89  
      90  GFileAttributeValue *_g_file_info_get_attribute_value (GFileInfo  *info,
      91  						       const char *attribute);
      92  
      93  #endif /* __G_FILE_ATTRIBUTE_PRIV_H__ */