Index: include/apr_file_xattr.h
===================================================================
--- include/apr_file_xattr.h	(revision 0)
+++ include/apr_file_xattr.h	(revision 0)
@@ -0,0 +1,118 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef APR_FILE_XATTR_H
+#define APR_FILE_XATTR_H
+
+/**
+ * @file apr_file_xattr.h
+ * @brief APR File Extended Attributes
+ */
+
+#include "apr.h"
+#include "apr_pools.h"
+#include "apr_tables.h"
+#include "apr_file_io.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @defgroup apr_file_xattr File Extended Attribute Functions
+ * @ingroup APR 
+ * @{
+ */
+
+/** When setting values, fail if the attribute already exists */
+#define APR_XATTR_CREATE      1
+
+/** When setting values, fail if the attribute does not already exist */
+#define APR_XATTR_REPLACE     2
+
+
+/**
+ * Set an extended attribute on a file
+ * @param file the file to set the attribute on
+ * @param name the attribute name to set
+ * @param value the attribute value
+ * @param size the size in bytes of the attribute value
+ * @param flags to control how the attribute is set
+ * <PRE>
+ *         APR_XATTR_CREATE      return an error if the attribute name
+ *                               already exists.
+ *         APR_XATTR_REPLACE     return an error if the attribute name
+ *                               does not already exist.
+ * </PRE>
+ * @param p the pool to allocate any memory from if required
+ * @remark if neither flag APR_XATTR_CREATE or APR_XATTR_REPLACE are
+ * given then the attribute will either be created if it does not
+ * already exist or replaced if it does exist.
+ */                        
+APR_DECLARE(apr_status_t) apr_file_xattr_set(apr_file_t *file,
+                                             const char *name,
+                                             const void *value,
+                                             apr_size_t size,
+                                             apr_uint32_t flags,
+                                             apr_pool_t *p);
+
+/**
+ * Get an extended attribute from a file
+ * @param file the file to get the attribute from
+ * @param name the name of the attribute to get
+ * @param value the returned attribute value allocated from the pool
+ * @param size the returned size of the attribute value
+ * @param flags to control how the attribute is got (reserved for future use)
+ * @param p the pool to allocate any memory from if required
+ */                        
+APR_DECLARE(apr_status_t) apr_file_xattr_get(apr_file_t *file,
+                                             const char *name,
+                                             void **value,
+                                             apr_size_t *size,
+                                             apr_uint32_t flags,
+                                             apr_pool_t *p);
+
+/**
+ * List the extended attributes for a file
+ * @param file the file to list the attributes of
+ * @param list the returned array of attributes names
+ * @param flags to control how the file is listed (reserved for future use)
+ * @param p the pool to allocate any memory from if required
+ * @remark list is an array containing simple null terminated strings.
+ */                        
+APR_DECLARE(apr_status_t) apr_file_xattr_list(apr_file_t *file,
+                                              apr_array_header_t **list,
+                                              apr_uint32_t flags,
+                                              apr_pool_t *p);
+
+/**
+ * Remove an extended attribute from a file
+ * @param file tje file to remove the attribute from
+ * @param name the attribute name to remove
+ * @param flags to control how the attribute is removed (reserved for future use)
+ * @param p the pool to allocate any memory from if required
+ */                        
+APR_DECLARE(apr_status_t) apr_file_xattr_remove(apr_file_t *file,
+                                                const char *name,
+                                                apr_uint32_t flags,
+                                                apr_pool_t *p);
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* ! APR_FILE_XATTR_H */

