Merged changes in the trunk up to revision 34193.
[blender.git] / source / blender / blenkernel / intern / library.c
index 87174a4ae14a820535c9772d0067242d8d4bf14c..58167a866a3dc54817e86352af55c88ae142f0bf 100644 (file)
 #include "DNA_world_types.h"
 #include "DNA_gpencil_types.h"
 
-
 #include "BLI_blenlib.h"
 #include "BLI_dynstr.h"
+#include "BLI_utildefines.h"
+
 
-#include "BKE_utildefines.h"
 #include "BKE_animsys.h"
 #include "BKE_context.h"
 #include "BKE_library.h"
@@ -1271,18 +1271,36 @@ static void lib_indirect_test_id(ID *id, Library *lib)
        }
 }
 
-void tag_main(struct Main *mainvar, int tag)
+void tag_main_lb(ListBase *lb, const short tag)
 {
-       ListBase *lbarray[MAX_LIBARRAY];
        ID *id;
+       if(tag) {
+               for(id= lb->first; id; id= id->next) {
+                       id->flag |= LIB_DOIT;
+               }
+       }
+       else {
+               for(id= lb->first; id; id= id->next) {
+                       id->flag &= ~LIB_DOIT;
+               }
+       }
+}
+
+void tag_main_idcode(struct Main *mainvar, const short type, const short tag)
+{
+       ListBase *lb= which_libbase(mainvar, type);
+
+       tag_main_lb(lb, tag);
+}
+
+void tag_main(struct Main *mainvar, const short tag)
+{
+       ListBase *lbarray[MAX_LIBARRAY];
        int a;
 
        a= set_listbasepointers(mainvar, lbarray);
        while(a--) {
-               for(id= lbarray[a]->first; id; id= id->next) {
-                       if(tag) id->flag |= LIB_DOIT;
-                       else    id->flag &= ~LIB_DOIT;
-               }
+               tag_main_lb(lbarray[a], tag);
        }
 }