mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 14:42:10 +01:00
Move hex_digits to rodata
Turn a string into a constant array.
This commit is contained in:
parent
25ff8ee748
commit
e6e82c51a6
@ -359,7 +359,7 @@ escape_byte_string (const char *str)
|
||||
int num_invalid, i;
|
||||
char *escaped_val, *p;
|
||||
unsigned char c;
|
||||
char *hex_digits = "0123456789abcdef";
|
||||
const char hex_digits[] = "0123456789abcdef";
|
||||
|
||||
len = strlen (str);
|
||||
|
||||
@ -396,7 +396,7 @@ escape_byte_string (const char *str)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_as_string:
|
||||
* _g_file_attribute_value_as_string:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Converts a #GFileAttributeValue to a string for display.
|
||||
@ -404,7 +404,7 @@ escape_byte_string (const char *str)
|
||||
*
|
||||
* Returns: a string from the @attr, %NULL on error, or "<invalid>"
|
||||
* if @attr is of type %G_FILE_ATTRIBUTE_TYPE_INVALID.
|
||||
**/
|
||||
*/
|
||||
char *
|
||||
_g_file_attribute_value_as_string (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -450,14 +450,14 @@ _g_file_attribute_value_as_string (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_string:
|
||||
* _g_file_attribute_value_get_string:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the string from a file attribute value. If the value is not the
|
||||
* right type then %NULL will be returned.
|
||||
*
|
||||
* Returns: the string value contained within the attribute, or %NULL.
|
||||
**/
|
||||
*/
|
||||
const char *
|
||||
_g_file_attribute_value_get_string (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -470,14 +470,14 @@ _g_file_attribute_value_get_string (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_byte_string:
|
||||
* _g_file_attribute_value_get_byte_string:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the byte string from a file attribute value. If the value is not the
|
||||
* right type then %NULL will be returned.
|
||||
*
|
||||
* Returns: the byte string contained within the attribute or %NULL.
|
||||
**/
|
||||
*/
|
||||
const char *
|
||||
_g_file_attribute_value_get_byte_string (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -490,14 +490,14 @@ _g_file_attribute_value_get_byte_string (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_boolean:
|
||||
* _g_file_attribute_value_get_boolean:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the boolean value from a file attribute value. If the value is not the
|
||||
* right type then %FALSE will be returned.
|
||||
*
|
||||
* Returns: the boolean value contained within the attribute, or %FALSE.
|
||||
**/
|
||||
*/
|
||||
gboolean
|
||||
_g_file_attribute_value_get_boolean (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -510,14 +510,14 @@ _g_file_attribute_value_get_boolean (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_uint32:
|
||||
* _g_file_attribute_value_get_uint32:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the unsigned 32-bit integer from a file attribute value. If the value
|
||||
* is not the right type then %0 will be returned.
|
||||
* is not the right type then 0 will be returned.
|
||||
*
|
||||
* Returns: the unsigned 32-bit integer from the attribute, or %0.
|
||||
**/
|
||||
* Returns: the unsigned 32-bit integer from the attribute, or 0.
|
||||
*/
|
||||
guint32
|
||||
_g_file_attribute_value_get_uint32 (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -530,14 +530,14 @@ _g_file_attribute_value_get_uint32 (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_int32:
|
||||
* _g_file_attribute_value_get_int32:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the signed 32-bit integer from a file attribute value. If the value
|
||||
* is not the right type then %0 will be returned.
|
||||
* is not the right type then 0 will be returned.
|
||||
*
|
||||
* Returns: the signed 32-bit integer from the attribute, or %0.
|
||||
**/
|
||||
* Returns: the signed 32-bit integer from the attribute, or 0.
|
||||
*/
|
||||
gint32
|
||||
_g_file_attribute_value_get_int32 (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -550,14 +550,14 @@ _g_file_attribute_value_get_int32 (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_uint64:
|
||||
* _g_file_attribute_value_get_uint64:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the unsigned 64-bit integer from a file attribute value. If the value
|
||||
* is not the right type then %0 will be returned.
|
||||
* is not the right type then 0 will be returned.
|
||||
*
|
||||
* Returns: the unsigned 64-bit integer from the attribute, or %0.
|
||||
**/
|
||||
* Returns: the unsigned 64-bit integer from the attribute, or 0.
|
||||
*/
|
||||
guint64
|
||||
_g_file_attribute_value_get_uint64 (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -570,14 +570,14 @@ _g_file_attribute_value_get_uint64 (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_int64:
|
||||
* _g_file_attribute_value_get_int64:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the signed 64-bit integer from a file attribute value. If the value
|
||||
* is not the right type then %0 will be returned.
|
||||
* is not the right type then 0 will be returned.
|
||||
*
|
||||
* Returns: the signed 64-bit integer from the attribute, or %0.
|
||||
**/
|
||||
* Returns: the signed 64-bit integer from the attribute, or 0.
|
||||
*/
|
||||
gint64
|
||||
_g_file_attribute_value_get_int64 (const GFileAttributeValue *attr)
|
||||
{
|
||||
@ -590,13 +590,13 @@ _g_file_attribute_value_get_int64 (const GFileAttributeValue *attr)
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_get_object:
|
||||
* _g_file_attribute_value_get_object:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
*
|
||||
* Gets the GObject from a file attribute value. If the value
|
||||
* is not the right type then %NULL will be returned.
|
||||
*
|
||||
* Returns: the GObject from the attribute, or %0.
|
||||
* Returns: the GObject from the attribute, or %NULL.
|
||||
**/
|
||||
GObject *
|
||||
_g_file_attribute_value_get_object (const GFileAttributeValue *attr)
|
||||
@ -661,13 +661,12 @@ _g_file_attribute_value_set_from_pointer (GFileAttributeValue *value,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_string:
|
||||
* _g_file_attribute_value_set_string:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @string: a string to set within the type.
|
||||
*
|
||||
* Sets the attribute value to a given string.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_string (GFileAttributeValue *attr,
|
||||
const char *string)
|
||||
@ -681,13 +680,12 @@ _g_file_attribute_value_set_string (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_byte_string:
|
||||
* _g_file_attribute_value_set_byte_string:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @string: a byte string to set within the type.
|
||||
*
|
||||
* Sets the attribute value to a given byte string.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_byte_string (GFileAttributeValue *attr,
|
||||
const char *string)
|
||||
@ -701,13 +699,12 @@ _g_file_attribute_value_set_byte_string (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_boolean:
|
||||
* _g_file_attribute_value_set_boolean:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @value: a #gboolean to set within the type.
|
||||
*
|
||||
* Sets the attribute value to the given boolean value.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_boolean (GFileAttributeValue *attr,
|
||||
gboolean value)
|
||||
@ -720,13 +717,12 @@ _g_file_attribute_value_set_boolean (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_uint32:
|
||||
* _g_file_attribute_value_set_uint32:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @value: a #guint32 to set within the type.
|
||||
*
|
||||
* Sets the attribute value to the given unsigned 32-bit integer.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_uint32 (GFileAttributeValue *attr,
|
||||
guint32 value)
|
||||
@ -739,13 +735,12 @@ _g_file_attribute_value_set_uint32 (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_int32:
|
||||
* _g_file_attribute_value_set_int32:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @value: a #gint32 to set within the type.
|
||||
*
|
||||
* Sets the attribute value to the given signed 32-bit integer.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_int32 (GFileAttributeValue *attr,
|
||||
gint32 value)
|
||||
@ -758,13 +753,12 @@ _g_file_attribute_value_set_int32 (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_uint64:
|
||||
* _g_file_attribute_value_set_uint64:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @value: a #guint64 to set within the type.
|
||||
*
|
||||
* Sets the attribute value to a given unsigned 64-bit integer.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_uint64 (GFileAttributeValue *attr,
|
||||
guint64 value)
|
||||
@ -777,13 +771,12 @@ _g_file_attribute_value_set_uint64 (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_int64:
|
||||
* _g_file_attribute_value_set_int64:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @value: a #gint64 to set within the type.
|
||||
*
|
||||
* Sets the attribute value to a given signed 64-bit integer.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_int64 (GFileAttributeValue *attr,
|
||||
gint64 value)
|
||||
@ -796,14 +789,13 @@ _g_file_attribute_value_set_int64 (GFileAttributeValue *attr,
|
||||
}
|
||||
|
||||
/*
|
||||
* g_file_attribute_value_set_object:
|
||||
* _g_file_attribute_value_set_object:
|
||||
* @attr: a #GFileAttributeValue.
|
||||
* @obj: a #GObject.
|
||||
*
|
||||
* Sets the attribute to contain the value @obj.
|
||||
* The @attr references the GObject internally.
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
_g_file_attribute_value_set_object (GFileAttributeValue *attr,
|
||||
GObject *obj)
|
||||
@ -835,7 +827,7 @@ list_update_public (GFileAttributeInfoListPriv *priv)
|
||||
* Creates a new file attribute info list.
|
||||
*
|
||||
* Returns: a #GFileAttributeInfoList.
|
||||
**/
|
||||
*/
|
||||
GFileAttributeInfoList *
|
||||
g_file_attribute_info_list_new (void)
|
||||
{
|
||||
@ -858,7 +850,7 @@ g_file_attribute_info_list_new (void)
|
||||
* Makes a duplicate of a file attribute info list.
|
||||
*
|
||||
* Returns: a copy of the given @list.
|
||||
**/
|
||||
*/
|
||||
GFileAttributeInfoList *
|
||||
g_file_attribute_info_list_dup (GFileAttributeInfoList *list)
|
||||
{
|
||||
@ -890,7 +882,7 @@ g_file_attribute_info_list_dup (GFileAttributeInfoList *list)
|
||||
* References a file attribute info list.
|
||||
*
|
||||
* Returns: #GFileAttributeInfoList or %NULL on error.
|
||||
**/
|
||||
*/
|
||||
GFileAttributeInfoList *
|
||||
g_file_attribute_info_list_ref (GFileAttributeInfoList *list)
|
||||
{
|
||||
@ -910,7 +902,7 @@ g_file_attribute_info_list_ref (GFileAttributeInfoList *list)
|
||||
*
|
||||
* Removes a reference from the given @list. If the reference count
|
||||
* falls to zero, the @list is deleted.
|
||||
**/
|
||||
*/
|
||||
void
|
||||
g_file_attribute_info_list_unref (GFileAttributeInfoList *list)
|
||||
{
|
||||
@ -960,7 +952,7 @@ g_file_attribute_info_list_bsearch (GFileAttributeInfoList *list,
|
||||
*
|
||||
* Returns: a #GFileAttributeInfo for the @name, or %NULL if an
|
||||
* attribute isn't found.
|
||||
**/
|
||||
*/
|
||||
const GFileAttributeInfo *
|
||||
g_file_attribute_info_list_lookup (GFileAttributeInfoList *list,
|
||||
const char *name)
|
||||
@ -987,12 +979,12 @@ g_file_attribute_info_list_lookup (GFileAttributeInfoList *list,
|
||||
*
|
||||
* Adds a new attribute with @name to the @list, setting
|
||||
* its @type and @flags.
|
||||
**/
|
||||
*/
|
||||
void
|
||||
g_file_attribute_info_list_add (GFileAttributeInfoList *list,
|
||||
const char *name,
|
||||
GFileAttributeType type,
|
||||
GFileAttributeInfoFlags flags)
|
||||
g_file_attribute_info_list_add (GFileAttributeInfoList *list,
|
||||
const char *name,
|
||||
GFileAttributeType type,
|
||||
GFileAttributeInfoFlags flags)
|
||||
{
|
||||
GFileAttributeInfoListPriv *priv = (GFileAttributeInfoListPriv *)list;
|
||||
GFileAttributeInfo info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user