addattr: minor cleanup.
This commit is contained in:
+10
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2006, Axel Dörfler, [email protected].
|
* Copyright 2004-2015, Axel Dörfler, [email protected].
|
||||||
* Copyright 2002, Sebastian Nozzi.
|
* Copyright 2002, Sebastian Nozzi.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
@@ -33,13 +33,12 @@ writeAttrValue(int fd, const char *name, type_code type, Type value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Writes an attribute to a node, taking the type into account and
|
/*! Writes an attribute to a node, taking the type into account and
|
||||||
* converting the value accordingly
|
converting the value accordingly
|
||||||
*
|
|
||||||
* On success it will return the amount of bytes written
|
|
||||||
* On failure it returns an error code (negative number)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
On success it will return the amount of bytes written
|
||||||
|
On failure it returns an error code (negative number)
|
||||||
|
*/
|
||||||
static ssize_t
|
static ssize_t
|
||||||
writeAttr(int fd, type_code type, const char* name, const char* value, size_t length)
|
writeAttr(int fd, type_code type, const char* name, const char* value, size_t length)
|
||||||
{
|
{
|
||||||
@@ -129,12 +128,11 @@ writeAttr(int fd, type_code type, const char *name, const char *value, size_t le
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Adds an attribute to a file for the given type, name and value
|
/*! Adds an attribute to a file for the given type, name and value
|
||||||
* Converts the value accordingly in case of numeric or boolean types
|
Converts the value accordingly in case of numeric or boolean types
|
||||||
*
|
|
||||||
* On success, it returns B_OK, or else an appropriate error code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
On success, it returns B_OK, or else an appropriate error code.
|
||||||
|
*/
|
||||||
status_t
|
status_t
|
||||||
addAttr(const char* file, type_code type, const char* name,
|
addAttr(const char* file, type_code type, const char* name,
|
||||||
const char* value, size_t length, bool resolveLinks)
|
const char* value, size_t length, bool resolveLinks)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2006, Axel Dörfler, [email protected].
|
* Copyright 2004-2015, Axel Dörfler, [email protected].
|
||||||
* Copyright 2002, Sebastian Nozzi.
|
* Copyright 2002, Sebastian Nozzi.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
@@ -14,4 +14,5 @@
|
|||||||
status_t addAttr(const char* file, type_code attrType, const char* attrName,
|
status_t addAttr(const char* file, type_code attrType, const char* attrName,
|
||||||
const char* attrValue, size_t length, bool resolveLinks);
|
const char* attrValue, size_t length, bool resolveLinks);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _ADD_ATTR_H */
|
#endif /* _ADD_ATTR_H */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, Jérôme Duval.
|
* Copyright 2010, Jérôme Duval.
|
||||||
* Copyright 2004-2007, Axel Dörfler, [email protected].
|
* Copyright 2004-2015, Axel Dörfler, [email protected].
|
||||||
* Copyright 2002, Sebastian Nozzi.
|
* Copyright 2002, Sebastian Nozzi.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
|
|||||||
Reference in New Issue
Block a user