Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-02-13 14:56:10 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-13 18:23:42 +0300
commitf28bb6992fa9773fb1e7918d569f4c88427f4c96 (patch)
treee69240c9ab26ba00bf4ca1f54636e4e837b8f465 /source/blender/blenkernel/BKE_lib_query.h
parent0d750d7c064bbb1e1fb5fe2ae14a8496863a890b (diff)
Refactor libquery ID looper callback to take a single parameter.
Using a struct here allows to change given parameters to the callbacks without having to edit all callbacks functions, which is always noisy and time consuming.
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_query.h')
-rw-r--r--source/blender/blenkernel/BKE_lib_query.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_lib_query.h b/source/blender/blenkernel/BKE_lib_query.h
index 36aa69bf795..4d1b924b0d3 100644
--- a/source/blender/blenkernel/BKE_lib_query.h
+++ b/source/blender/blenkernel/BKE_lib_query.h
@@ -83,15 +83,19 @@ enum {
IDWALK_RET_STOP_RECURSION = 1 << 1,
};
+typedef struct LibraryIDLinkCallbackData {
+ void *user_data;
+ struct ID *id_self;
+ struct ID **id_pointer;
+ int cb_flag;
+} LibraryIDLinkCallbackData;
+
/**
* Call a callback for each ID link which the given ID uses.
*
* \return a set of flags to control further iteration (0 to keep going).
*/
-typedef int (*LibraryIDLinkCallback)(void *user_data,
- struct ID *id_self,
- struct ID **id_pointer,
- int cb_flag);
+typedef int (*LibraryIDLinkCallback)(LibraryIDLinkCallbackData *cb_data);
/* Flags for the foreach function itself. */
enum {