From owner-p4-projects@FreeBSD.ORG Thu Jun 30 01:25:55 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A19A816A420; Thu, 30 Jun 2005 01:25:54 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5735816A41C for ; Thu, 30 Jun 2005 01:25:54 +0000 (GMT) (envelope-from soc-tyler@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29DD643D4C for ; Thu, 30 Jun 2005 01:25:54 +0000 (GMT) (envelope-from soc-tyler@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5U1PsPk064881 for ; Thu, 30 Jun 2005 01:25:54 GMT (envelope-from soc-tyler@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5U1PrNr064878 for perforce@freebsd.org; Thu, 30 Jun 2005 01:25:53 GMT (envelope-from soc-tyler@freebsd.org) Date: Thu, 30 Jun 2005 01:25:53 GMT Message-Id: <200506300125.j5U1PrNr064878@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-tyler@freebsd.org using -f From: soc-tyler To: Perforce Change Reviews Cc: Subject: PERFORCE change 79219 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 01:25:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=79219 Change 79219 by soc-tyler@soc-tyler_launchd on 2005/06/30 01:25:31 Start documenting and removing CoreFoundation API calls in favour of more 'open' and standard libs. Affected files ... .. //depot/projects/soc2005/launchd/launchctl/launchctl.c#2 edit Differences ... ==== //depot/projects/soc2005/launchd/launchctl/launchctl.c#2 (text+ko) ==== @@ -48,8 +48,16 @@ * @APPLE_LICENSE_HEADER_END@ */ -// Mac OS specific -//#include +/* Mac OS specific + * #include + * + * CoreFoundation defines a lot of these CF* data types, documentation is here: + * http://developer.apple.com/documentation/CoreFoundation/Reference/CFAPI-date.html + * + * refer to the eXpat XML parsing library by way of 'libbsdxml' for replacement of + * the XML parsing functions + */ + #include #include #include @@ -73,9 +81,14 @@ #include #include #include -// Mac OS specific -//#include +/* Mac OS specific + * #include + * + * This includes the Zeroconf headers, why launchctl needs access to Zeroconf + * right now is beyond me... + */ + #include "launch.h" #include "launch_priv.h" @@ -85,7 +98,7 @@ static void distill_config_file(launch_data_t); static void sock_dict_cb(launch_data_t what, const char *key, void *context); static void sock_dict_edit_entry(launch_data_t tmp, const char *key, launch_data_t fdarray, launch_data_t thejob); -static launch_data_t CF2launch_data(CFTypeRef); +static launch_data_t CF2launch_data(const void *); static launch_data_t read_plist_file(const char *file, bool editondisk, bool load); static CFPropertyListRef CreateMyPropertyListFromFile(const char *); static void WriteMyPropertyListToFile(CFPropertyListRef, const char *); @@ -655,6 +668,10 @@ } } +/* + * XXX: what in the hell does this do O_o + */ +/* static launch_data_t do_rendezvous_magic(const struct addrinfo *res, const char *serv) { struct stat sb; @@ -685,6 +702,7 @@ fprintf(stderr, "DNSServiceRegister(\"%s\"): %d\n", serv, error); return NULL; } +*/ static CFPropertyListRef CreateMyPropertyListFromFile(const char *posixfile) { @@ -733,7 +751,7 @@ launch_data_free(ik); } -static launch_data_t CF2launch_data(CFTypeRef cfr) +static launch_data_t CF2launch_data(const void *cfr) { launch_data_t r; CFTypeID cft = CFGetTypeID(cfr); @@ -750,7 +768,7 @@ CFIndex i, ac = CFArrayGetCount(cfr); r = launch_data_alloc(LAUNCH_DATA_ARRAY); for (i = 0; i < ac; i++) { - CFTypeRef v = CFArrayGetValueAtIndex(cfr, i); + const void *v = CFArrayGetValueAtIndex(cfr, i); if (v) { launch_data_t iv = CF2launch_data(v); launch_data_array_set_index(r, iv, i);