[darwinbuild-changes] [250] trunk/darwinxref/DBDataStore.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 4 02:01:58 PDT 2006


Revision: 250
          http://trac.macosforge.org/projects/darwinbuild/changeset/250
Author:   kevin
Date:     2006-10-04 02:01:57 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
- added DBCopyBuildInheritance()
- moved arrayAppendArrayDistinct to cfutils.c

Modified Paths:
--------------
    trunk/darwinxref/DBDataStore.c

Modified: trunk/darwinxref/DBDataStore.c
===================================================================
--- trunk/darwinxref/DBDataStore.c	2005-09-15 20:44:29 UTC (rev 249)
+++ trunk/darwinxref/DBDataStore.c	2006-10-04 09:01:57 UTC (rev 250)
@@ -246,6 +246,16 @@
 	return SQL_CFARRAY(sql);
 }
 
+CFArrayRef DBCopyBuildInheritance(CFStringRef param) {
+	CFMutableArrayRef builds = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+	CFStringRef build = param;
+	do {
+		CFArrayInsertValueAtIndex(builds, 0, build);
+		if (build != param) CFRelease(build);
+		build = DBCopyOnePropString(build, NULL, CFSTR("inherits"));
+	} while (build != NULL);
+	return builds;
+}
 
 CFArrayRef DBCopyPropNames(CFStringRef build, CFStringRef project) {
 	char* cbuild = strdup_cfstr(build);
@@ -269,18 +279,6 @@
 	return res;
 }
 
-// appends each element that does not already exist in the array
-static void arrayAppendArrayDistinct(CFMutableArrayRef array, CFArrayRef other) {
-	CFIndex i, count = CFArrayGetCount(other);
-	CFRange range = CFRangeMake(0, CFArrayGetCount(array));
-	for (i = 0; i < count; ++i) {
-		CFTypeRef o = CFArrayGetValueAtIndex(other, i);
-		if (!CFArrayContainsValue(array, range, o)) {
-			CFArrayAppendValue(array, o);
-		}
-	}
-}
-
 CFArrayRef DBCopyProjectNames(CFStringRef build) {
 	CFMutableArrayRef projects = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
 	do {		

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/a2858ed7/attachment-0001.html


More information about the darwinbuild-changes mailing list