X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fapply-default-acl.c;h=f6aa5be75e860a6cf459fbf788d77614dfabcbe5;hb=4a9f4deb191a691978a1ee57ca7580f39ad5c9e6;hp=4f7b3b06a0e1f2cc835038f5701550c57c696859;hpb=0c390cb042843e8091cbff0d82538a64e17a7d9f;p=apply-default-acl.git diff --git a/src/apply-default-acl.c b/src/apply-default-acl.c index 4f7b3b0..f6aa5be 100644 --- a/src/apply-default-acl.c +++ b/src/apply-default-acl.c @@ -1,3 +1,10 @@ +/** + * @file apply-default-acl.c + * + * @brief The entire implementation. + * + */ + /* On Linux, ftw.h needs this special voodoo to work. */ #define _XOPEN_SOURCE 500 @@ -23,10 +30,16 @@ static bool no_exec_mask = false; +/** + * @brief Get the mode bits from the given path. + * + * @param path + * The path (file or directory) whose mode we want. + * + * @return A mode_t (st_mode) structure containing the mode bits. + * See sys/stat.h for details. + */ mode_t get_mode(const char* path) { - /* - * Get the mode bits from path. - */ if (path == NULL) { errno = ENOENT; return -1; @@ -45,10 +58,15 @@ mode_t get_mode(const char* path) { } +/** + * @brief Determine whether or not the given path is a regular file. + * + * @param path + * The path to test. + * + * @return true if @c path is a regular file, false otherwise. + */ bool is_regular_file(const char* path) { - /* - * Returns true if path is a regular file, false otherwise. - */ if (path == NULL) { return false; } @@ -63,10 +81,16 @@ bool is_regular_file(const char* path) { } } + +/** + * @brief Determine whether or not the given path is a directory. + * + * @param path + * The path to test. + * + * @return true if @c path is a directory, false otherwise. + */ bool is_directory(const char* path) { - /* - * Returns true if path is a directory, false otherwise. - */ if (path == NULL) { return false; }