diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenlib/BLI_fileops.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenlib/BLI_fileops.h')
-rw-r--r-- | source/blender/blenlib/BLI_fileops.h | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 10cac63ec33..7787ca4cdb5 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -36,7 +36,7 @@ extern "C" { /* for size_t (needed on windows) */ #include <stddef.h> -#include <limits.h> /* for PATH_MAX */ +#include <limits.h> /* for PATH_MAX */ #include "BLI_compiler_attrs.h" @@ -44,14 +44,13 @@ extern "C" { # define PATH_MAX 4096 #endif - /* Common */ -int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -int BLI_copy(const char *path, const char *to) ATTR_NONNULL(); -int BLI_rename(const char *from, const char *to) ATTR_NONNULL(); -int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL(); -#if 0 /* Unused */ +int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +int BLI_copy(const char *path, const char *to) ATTR_NONNULL(); +int BLI_rename(const char *from, const char *to) ATTR_NONNULL(); +int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL(); +#if 0 /* Unused */ int BLI_move(const char *path, const char *to) ATTR_NONNULL(); int BLI_create_symlink(const char *path, const char *to) ATTR_NONNULL(); #endif @@ -67,63 +66,69 @@ typedef struct _stat BLI_stat_t; typedef struct stat BLI_stat_t; #endif -int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); #ifdef WIN32 -int BLI_wstat(const wchar_t *path, BLI_stat_t *buffer); +int BLI_wstat(const wchar_t *path, BLI_stat_t *buffer); #endif /* Directories */ struct direntry; -bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -bool BLI_dir_create_recursive(const char *dir) ATTR_NONNULL(); +bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +bool BLI_dir_create_recursive(const char *dir) ATTR_NONNULL(); double BLI_dir_free_space(const char *dir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -char *BLI_current_working_dir(char *dir, const size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +char *BLI_current_working_dir(char *dir, const size_t maxlen) ATTR_WARN_UNUSED_RESULT + ATTR_NONNULL(); /* Filelist */ unsigned int BLI_filelist_dir_contents(const char *dir, struct direntry **r_filelist); void BLI_filelist_entry_duplicate(struct direntry *dst, const struct direntry *src); -void BLI_filelist_duplicate( - struct direntry **dest_filelist, struct direntry * const src_filelist, const unsigned int nrentries); +void BLI_filelist_duplicate(struct direntry **dest_filelist, + struct direntry *const src_filelist, + const unsigned int nrentries); void BLI_filelist_entry_free(struct direntry *entry); void BLI_filelist_free(struct direntry *filelist, const unsigned int nrentries); -void BLI_filelist_entry_size_to_string(const struct stat *st, const uint64_t sz, const bool compact, char r_size[]); +void BLI_filelist_entry_size_to_string(const struct stat *st, + const uint64_t sz, + const bool compact, + char r_size[]); void BLI_filelist_entry_mode_to_string( - const struct stat *st, const bool compact, char r_mode1[], char r_mode2[], char r_mode3[]); + const struct stat *st, const bool compact, char r_mode1[], char r_mode2[], char r_mode3[]); void BLI_filelist_entry_owner_to_string(const struct stat *st, const bool compact, char r_owner[]); void BLI_filelist_entry_datetime_to_string( - const struct stat *st, const int64_t ts, const bool compact, char r_time[], char r_date[]); + const struct stat *st, const int64_t ts, const bool compact, char r_time[], char r_date[]); /* Files */ -FILE *BLI_fopen(const char *filename, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -void *BLI_gzopen(const char *filename, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -int BLI_open(const char *filename, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -int BLI_access(const char *filename, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +FILE *BLI_fopen(const char *filename, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +void *BLI_gzopen(const char *filename, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +int BLI_open(const char *filename, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +int BLI_access(const char *filename, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -bool BLI_file_is_writable(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -bool BLI_file_touch(const char *file) ATTR_NONNULL(); +bool BLI_file_is_writable(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +bool BLI_file_touch(const char *file) ATTR_NONNULL(); -#if 0 /* UNUSED */ +#if 0 /* UNUSED */ int BLI_file_gzip(const char *from, const char *to) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); #endif -char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +char *BLI_file_ungzip_to_mem(const char *from_file, int *r_size) ATTR_WARN_UNUSED_RESULT + ATTR_NONNULL(); size_t BLI_file_descriptor_size(int file) ATTR_WARN_UNUSED_RESULT; size_t BLI_file_size(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); /* compare if one was last modified before the other */ -bool BLI_file_older(const char *file1, const char *file2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +bool BLI_file_older(const char *file1, const char *file2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); /* read ascii file as lines, empty list if reading fails */ struct LinkNode *BLI_file_read_as_lines(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -void *BLI_file_read_text_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size); -void *BLI_file_read_binary_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size); -void BLI_file_free_lines(struct LinkNode *lines); +void *BLI_file_read_text_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size); +void *BLI_file_read_binary_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size); +void BLI_file_free_lines(struct LinkNode *lines); /* this weirdo pops up in two places ... */ #if !defined(WIN32) @@ -138,4 +143,4 @@ void BLI_get_short_name(char short_name[256], const char *filename); } #endif -#endif /* __BLI_FILEOPS_H__ */ +#endif /* __BLI_FILEOPS_H__ */ |