PERFORCE change 79219 for review
soc-tyler
soc-tyler at FreeBSD.org
Thu Jun 30 01:25:55 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79219
Change 79219 by soc-tyler at 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 <CoreFoundation/CoreFoundation.h>
+/* Mac OS specific
+ * #include <CoreFoundation/CoreFoundation.h>
+ *
+ * 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 <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
@@ -73,9 +81,14 @@
#include <syslog.h>
#include <readline/readline.h>
#include <readline/history.h>
-// Mac OS specific
-//#include <dns_sd.h>
+/* Mac OS specific
+ * #include <dns_sd.h>
+ *
+ * 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);
More information about the p4-projects
mailing list