From 641d4e2b7fc4fd563c3c2dd880c8c412dd35ce9a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Dec 2015 17:17:25 +1100 Subject: Cleanup: use BLI_libblock prefix for id functions - test_idbutton -> BLI_libblock_ensure_unique_name (not only used from UI) - BKE_rename_id -> BKE_libblock_rename (always pass valid main) also rename: - name_uiprefix_id -> BKE_id_uiprefix --- source/blender/blenkernel/BKE_library.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/blenkernel/BKE_library.h') diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 336928575af..7af126faa6a 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -57,6 +57,16 @@ void *BKE_libblock_copy_nolib(struct ID *id, const bool do_action) ATTR_NONNULL( void *BKE_libblock_copy(struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void BKE_libblock_copy_data(struct ID *id, const struct ID *id_from, const bool do_action); void BKE_libblock_relink(struct ID *id); +void BKE_libblock_rename(struct Main *bmain, struct ID *id, const char *name) ATTR_NONNULL(); +void BLI_libblock_ensure_unique_name(struct Main *bmain, const char *name) ATTR_NONNULL(); + +void BKE_libblock_free(struct Main *bmain, void *idv) ATTR_NONNULL(); +void BKE_libblock_free_ex(struct Main *bmain, void *idv, bool do_id_user) ATTR_NONNULL(); +void BKE_libblock_free_us(struct Main *bmain, void *idv) ATTR_NONNULL(); +void BKE_libblock_free_data(struct Main *bmain, struct ID *id) ATTR_NONNULL(); + +struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id); void id_lib_extern(struct ID *id); @@ -81,12 +91,6 @@ struct ListBase *which_libbase(struct Main *mainlib, short type); #define MAX_LIBARRAY 34 int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]); -void BKE_libblock_free(struct Main *bmain, void *idv); -void BKE_libblock_free_ex(struct Main *bmain, void *idv, bool do_id_user); -void BKE_libblock_free_us(struct Main *bmain, void *idv); -void BKE_libblock_free_data(struct Main *bmain, struct ID *id); - - /* Main API */ struct Main *BKE_main_new(void); void BKE_main_free(struct Main *mainvar); @@ -109,15 +113,11 @@ void BKE_main_id_clear_newpoins(struct Main *bmain); void BKE_main_lib_objects_recalc_all(struct Main *bmain); -void BKE_rename_id(struct Main *bmain, struct ID *id, const char *name); -void name_uiprefix_id(char *name, const struct ID *id); -void test_idbutton(char *name); +/* (MAX_ID_NAME - 2) + 3 */ +void BKE_id_ui_prefix(char name[66 + 1], const struct ID *id); void BKE_library_make_local(struct Main *bmain, struct Library *lib, bool untagged_only); -struct ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -struct ID *BKE_libblock_find_name(const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); - typedef void (*BKE_library_free_window_manager_cb)(struct bContext *, struct wmWindowManager *); typedef void (*BKE_library_free_notifier_reference_cb)(const void *); typedef void (*BKE_library_free_editor_id_reference_cb)(const struct ID *); -- cgit v1.2.3