cvs: pecl /xattr xattr.c /xattr/tests 001.phpt

From: Date: Sat, 14 Aug 2004 11:47:47 +0000
Subject: cvs: pecl /xattr xattr.c /xattr/tests 001.phpt
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-1657@lists.php.net to get a copy of this message
mg Sat Aug 14 07:47:47 2004 EDT Modified files: /pecl/xattr xattr.c /pecl/xattr/tests 001.phpt Log: Fix comments. http://cvs.php.net/diff.php/pecl/xattr/xattr.c?r1=1.5&r2=1.6&ty=u Index: pecl/xattr/xattr.c diff -u pecl/xattr/xattr.c:1.5 pecl/xattr/xattr.c:1.6 --- pecl/xattr/xattr.c:1.5 Fri Aug 13 18:10:29 2004 +++ pecl/xattr/xattr.c Sat Aug 14 07:47:47 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xattr.c,v 1.5 2004/08/13 22:10:29 mg Exp $ */ +/* $Id: xattr.c,v 1.6 2004/08/14 11:47:47 mg Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -24,7 +24,7 @@ #define XATTR_BUFFER_SIZE 1024 /* Initial size for internal buffers, feel free to change it */ -/* These prefixes has been taken from attr(5) man page */ +/* These prefixes have been taken from attr(5) man page */ #define XATTR_USER_PREFIX "user." #define XATTR_ROOT_PREFIX "trusted." @@ -38,7 +38,7 @@ /* * One beautiful day libattr will implement listing extended attributes, - * but until then we must to it on our own, so these headers are required. + * but until then we must do it on our own, so these headers are required. */ #include <sys/types.h> #include <attr/xattr.h> @@ -119,7 +119,7 @@ /* Ensure that only allowed bits are set */ flags &= ATTR_ROOT | ATTR_DONTFOLLOW | ATTR_CREATE | ATTR_REPLACE; - /* Try to set an attribute and give some warning if it fails... */ + /* Attempt to set an attribute, warn if failed. */ error = attr_set(path, attr_name, attr_value, value_len, flags); if (error == -1) { switch (errno) { @@ -147,7 +147,7 @@ /* }}} */ /* {{{ proto string xattr_get(string path, string name [, int flags]) - Return a value of an extended attribute */ + Returns a value of an extended attribute */ PHP_FUNCTION(xattr_get) { char *attr_name = NULL; @@ -170,7 +170,7 @@ /* * If buffer is too small then attr_get sets errno to E2BIG and tells us - * how many bytes is required by setting buffer_size variable. + * how many bytes are required by setting buffer_size variable. */ error = attr_get(path, attr_name, attr_value, &buffer_size, flags); @@ -231,7 +231,7 @@ /* Ensure that only allowed bits are set */ flags &= ATTR_ROOT | ATTR_DONTFOLLOW; - /* Try to remove an attribute and give some warning if it fails... */ + /* Attempt to remove an attribute, warn if failed. */ error = attr_remove(path, attr_name, flags); if (error == -1) { switch (errno) { @@ -276,11 +276,11 @@ if (!buffer) RETURN_FALSE; - /* Loop is required to take a list reliably */ + /* Loop is required to get a list reliably */ do { /* * Call to this function with zero size buffer will return us - * required size of our buffer (or an error). + * required size of our buffer in return (or an error). */ if (flags & ATTR_DONTFOLLOW) { error = llistxattr(path, buffer, 0); @@ -307,7 +307,7 @@ RETURN_FALSE; } - /* Resize buffer to required size */ + /* Resize buffer to the required size */ buffer_size = error; buffer = erealloc(buffer, buffer_size); if (!buffer) @@ -320,13 +320,13 @@ } /* - * Preceding functions may fail if extended attributes - * have been changed after we had read required buffer size. - * That's why we will retry if errno is ERANGE. - */ +  * Preceding functions may fail if extended attributes +  * have been changed after we read required buffer size. +  * That's why we will retry if errno is ERANGE. +  */ } while (error == -1 && errno == ERANGE); - /* If there is still an error and it's not ERANGE than return false */ + /* If there is still an error and it's not ERANGE then return false */ if (error == -1) { efree(buffer); RETURN_FALSE; @@ -339,8 +339,7 @@ p = buffer; /* - * Root namespace has prefix "trusted." and users namespace - * has prefix "user.". + * Root namespace has the prefix "trusted." and users namespace "user.". */ if (flags & ATTR_ROOT) { prefix = XATTR_ROOT_PREFIX; @@ -351,7 +350,7 @@ prefix_len = strlen(prefix); /* - * We go through whole list and add entries beginning with selected + * We go through the whole list and add entries beginning with selected * prefix to the return_value array. */ while (i != buffer_size) { http://cvs.php.net/diff.php/pecl/xattr/tests/001.phpt?r1=1.1&r2=1.2&ty=u Index: pecl/xattr/tests/001.phpt diff -u pecl/xattr/tests/001.phpt:1.1 pecl/xattr/tests/001.phpt:1.2 --- pecl/xattr/tests/001.phpt:1.1 Fri Aug 13 16:46:29 2004 +++ pecl/xattr/tests/001.phpt Sat Aug 14 07:47:47 2004 @@ -5,17 +5,6 @@ --FILE-- <?php echo "xattr extension is available"; -/* - you can add regression tests for your extension here - - the output of your test code has to be equal to the - text in the --EXPECT-- section below for the tests - to pass, differences between the output and the - expected text are interpreted as failure - - see php5/README.TESTING for further information on - writing regression tests -*/ ?> --EXPECT-- xattr extension is available

« previous php.pecl.cvs (#1657) next »