this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Re-add our own fake SystemConfiguration

This is because the one from Apple is too hard to build, with many
closed-source dependencies.

+365 -1
+1 -1
src/CMakeLists.txt
··· 119 119 add_subdirectory(external/pcre) 120 120 add_subdirectory(external/sqlite) 121 121 add_subdirectory(external/openpam) 122 - #add_subdirectory(SystemConfiguration) 122 + add_subdirectory(SystemConfiguration) 123 123 add_subdirectory(CoreServices) 124 124 #add_subdirectory(ApplicationServices) 125 125 #add_subdirectory(VideoDecodeAcceleration)
+38
src/SystemConfiguration/CMakeLists.txt
··· 1 + project(SystemConfiguration) 2 + 3 + cmake_minimum_required(VERSION 2.4.0) 4 + if(COMMAND cmake_policy) 5 + cmake_policy(SET CMP0003 NEW) 6 + endif(COMMAND cmake_policy) 7 + 8 + 9 + #configure_file(config.h.in config.h) 10 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 11 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc") 12 + 13 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 14 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) 15 + include_directories(${CMAKE_SOURCE_DIR}/src/external/corefoundation/) 16 + include_directories(${CMAKE_SOURCE_DIR}/src/external/foundation/include) 17 + include_directories(${CMAKE_SOURCE_DIR}/src/external/libclosure) 18 + include_directories(${CMAKE_SOURCE_DIR}/src/launchd/liblaunch) 19 + 20 + set(SystemConfiguration_SRCS 21 + SCDynamicStoreCopySpecific.cpp 22 + SCSchemaDefinitions.c 23 + SCNetworkReachability.c 24 + SCNetworkConnection.c 25 + ) 26 + 27 + add_framework(SystemConfiguration 28 + FAT 29 + CURRENT_VERSION 30 + VERSION "A" 31 + SOURCES 32 + ${SystemConfiguration_SRCS} 33 + DEPENDENCIES 34 + system 35 + CoreFoundation 36 + ) 37 + 38 +
+1
src/SystemConfiguration/SCDynamicStore.h
··· 1 + typedef const struct __SCDynamicStore * SCDynamicStoreRef;
+54
src/SystemConfiguration/SCDynamicStoreCopySpecific.cpp
··· 1 + #include <unistd.h> 2 + #include <sys/types.h> 3 + #include <stdlib.h> 4 + #include <pwd.h> 5 + #include <sys/utsname.h> 6 + //#include "log.h" 7 + 8 + #include <CoreFoundation/CFString.h> 9 + #include <SystemConfiguration/SCDynamicStoreCopySpecific.h> 10 + 11 + #define MAX_PASSENTRY_LENGTH 4096 12 + 13 + CFStringRef SCDynamicStoreCopyComputerName (SCDynamicStoreRef store, CFStringEncoding *nameEncoding){ 14 + //LOG << "fixme: SCDynamicStoreCopyComputerName() - stub" << std::endl; 15 + return NULL; 16 + } 17 + 18 + CFStringRef SCDynamicStoreCopyConsoleUser (SCDynamicStoreRef store, uid_t *uid, gid_t *gid){ 19 + struct passwd pwent, *pwentp; 20 + char buffer[MAX_PASSENTRY_LENGTH]; 21 + char *user; 22 + 23 + if (uid) *uid = getuid(); 24 + if (gid) *gid = getgid(); 25 + 26 + user = getenv("USER"); 27 + if (user) 28 + return CFStringCreateWithCString(NULL, user, kCFStringEncodingUTF8); 29 + 30 + if (getpwuid_r(getuid(), &pwent, buffer, MAX_PASSENTRY_LENGTH, &pwentp)) 31 + return CFStringCreateWithCString(NULL, pwentp->pw_name, kCFStringEncodingUTF8); 32 + 33 + return NULL; 34 + } 35 + 36 + CFStringRef SCDynamicStoreCopyLocalHostName (SCDynamicStoreRef store){ 37 + struct utsname info; 38 + 39 + if (uname(&info) != 0) 40 + return NULL; 41 + 42 + return CFStringCreateWithCString(NULL, info.nodename, kCFStringEncodingUTF8); 43 + } 44 + 45 + CFStringRef SCDynamicStoreCopyLocation (SCDynamicStoreRef store){ 46 + //LOG << "fixme: SCDynamicStoreCopyLocation() - stub" << std::endl; 47 + return NULL; 48 + } 49 + 50 + CFDictionaryRef SCDynamicStoreCopyProxies (SCDynamicStoreRef store){ 51 + //LOG << "fixme: SCDynamicStoreCopyComputerName() - stub" << std::endl; 52 + /* No Proxy support yet */ 53 + return NULL; 54 + }
+23
src/SystemConfiguration/SCDynamicStoreCopySpecific.h
··· 1 + #ifndef SCDYNAMICSTORECOPYSPECIFIC_H 2 + #define SCDYNAMICSTORECOPYSPECIFIC_H 3 + 4 + #include <CoreFoundation/CoreFoundation.h> 5 + #include <SystemConfiguration/SCDynamicStore.h> 6 + #include <SystemConfiguration/SCSchemaDefinitions.h> 7 + 8 + #ifdef __cplusplus 9 + extern "C" { 10 + #endif 11 + 12 + CFStringRef SCDynamicStoreCopyComputerName (SCDynamicStoreRef store, CFStringEncoding *nameEncoding); 13 + CFStringRef SCDynamicStoreCopyConsoleUser (SCDynamicStoreRef store, uid_t *uid, gid_t *gid); 14 + CFStringRef SCDynamicStoreCopyLocalHostName (SCDynamicStoreRef store); 15 + CFStringRef SCDynamicStoreCopyLocation (SCDynamicStoreRef store); 16 + CFDictionaryRef SCDynamicStoreCopyProxies (SCDynamicStoreRef store); 17 + 18 + #ifdef __cplusplus 19 + } 20 + #endif 21 + 22 + #endif 23 +
+37
src/SystemConfiguration/SCNetworkConnection.c
··· 1 + #include "SCNetworkConnection.h" 2 + CFTypeID SCNetworkConnectionGetTypeID(void) 3 + { 4 + return 0; 5 + } 6 + 7 + Boolean SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnectionRef ref, CFRunLoopRef rl, CFStringRef rlMode) 8 + { 9 + return 0; 10 + } 11 + 12 + Boolean SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnectionRef ref, CFRunLoopRef rl, CFStringRef rlMode) 13 + { 14 + return 0; 15 + } 16 + 17 + Boolean SCNetworkConnectionStop(SCNetworkConnectionRef ref, Boolean force) 18 + { 19 + return 0; 20 + } 21 + 22 + Boolean SCNetworkConnectionStart(SCNetworkConnectionRef ref, CFDictionaryRef userOptions, Boolean linger) 23 + { 24 + return 0; 25 + } 26 + 27 + Boolean SCNetworkConnectionCopyUserPreferences(CFDictionaryRef selectionOptions, CFStringRef serviceID, CFDictionaryRef* userOptions) 28 + { 29 + return 0; 30 + } 31 + 32 + SCNetworkConnectionRef SCNetworkConnectionCreateWithServiceID(CFAllocatorRef allocator, CFStringRef serviceID, SCNetworkConnectionCallBack cb, SCNetworkConnectionContext* ctxt) 33 + { 34 + return NULL; 35 + } 36 + 37 +
+44
src/SystemConfiguration/SCNetworkConnection.h
··· 1 + #ifndef _SCNETWORKCONNECTION_H 2 + #define _SCNETWORKCONNECTION_H 3 + #include <CoreFoundation/CFString.h> 4 + #include <CoreFoundation/CFRunLoop.h> 5 + #include <CoreFoundation/CFDictionary.h> 6 + 7 + typedef struct __SCNetworkConnection* SCNetworkConnectionRef; 8 + typedef int SCNetworkConnectionFlags; 9 + typedef int SCNetworkConnectionStatus; 10 + 11 + enum { 12 + kSCNetworkConnectionInvalid = -1, 13 + kSCNetworkConnectionDisconnected, 14 + kSCNetworkConnectionConnecting, 15 + kSCNetworkConnectionConnected, 16 + kSCNetworkConnectionDisconnecting 17 + }; 18 + 19 + typedef void (*SCNetworkConnectionCallBack)(SCNetworkConnectionRef, SCNetworkConnectionStatus, void*); 20 + 21 + typedef struct 22 + { 23 + CFIndex version; 24 + void* info; 25 + const void* (*retain)(const void*); 26 + void (*release)(const void*); 27 + CFStringRef (*copyDescription)(const void*); 28 + } SCNetworkConnectionContext; 29 + 30 + CFTypeID SCNetworkConnectionGetTypeID(void); 31 + 32 + Boolean SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnectionRef ref, CFRunLoopRef rl, CFStringRef rlMode); 33 + Boolean SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnectionRef ref, CFRunLoopRef rl, CFStringRef rlMode); 34 + 35 + Boolean SCNetworkConnectionStop(SCNetworkConnectionRef ref, Boolean force); 36 + 37 + Boolean SCNetworkConnectionStart(SCNetworkConnectionRef ref, CFDictionaryRef userOptions, Boolean linger); 38 + 39 + Boolean SCNetworkConnectionCopyUserPreferences(CFDictionaryRef selectionOptions, CFStringRef serviceID, CFDictionaryRef* userOptions); 40 + 41 + SCNetworkConnectionRef SCNetworkConnectionCreateWithServiceID(CFAllocatorRef allocator, CFStringRef serviceID, SCNetworkConnectionCallBack cb, SCNetworkConnectionContext* ctxt); 42 + 43 + #endif 44 +
+42
src/SystemConfiguration/SCNetworkReachability.c
··· 1 + #include "SCNetworkReachability.h" 2 + 3 + CFTypeID SCNetworkReachabilityGetTypeID(void) 4 + { 5 + return 0; 6 + } 7 + 8 + Boolean SCNetworkReachabilityScheduleWithRunLoop(SCNetworkReachabilityRef ref, CFRunLoopRef rl, CFStringRef rlMode) 9 + { 10 + return 0; 11 + } 12 + 13 + Boolean SCNetworkReachabilityUnscheduleFromRunLoop(SCNetworkReachabilityRef ref, CFRunLoopRef rl, CFStringRef rlMode) 14 + { 15 + return 0; 16 + } 17 + 18 + Boolean SCNetworkReachabilitySetCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityCallBack cb, SCNetworkReachabilityContext* ctxt) 19 + { 20 + return 0; 21 + } 22 + 23 + Boolean SCNetworkReachabilityGetFlags(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags* flags) 24 + { 25 + return 0; 26 + } 27 + 28 + SCNetworkReachabilityRef SCNetworkReachabilityCreateWithName(CFAllocatorRef allocator, const char* nodeName) 29 + { 30 + return NULL; 31 + } 32 + 33 + SCNetworkReachabilityRef SCNetworkReachabilityCreateWithAddressPair(CFAllocatorRef allocator, const struct sockaddr* localAddress, const struct sockaddr* remoteAddress) 34 + { 35 + return NULL; 36 + } 37 + 38 + SCNetworkReachabilityRef SCNetworkReachabilityCreateWithAddress(CFAllocatorRef allocator, const struct sockaddr* remoteAddress) 39 + { 40 + return NULL; 41 + } 42 +
+40
src/SystemConfiguration/SCNetworkReachability.h
··· 1 + #ifndef _SCNETWORKREACHABILITY_H 2 + #define _SCNETWORKREACHABILITY_H 3 + #include <CoreFoundation/CFBase.h> 4 + #include <CoreFoundation/CFString.h> 5 + #include <CoreFoundation/CFRunLoop.h> 6 + #include <sys/types.h> 7 + #include <sys/socket.h> 8 + 9 + typedef struct __SCNetworkReachability* SCNetworkReachabilityRef; 10 + 11 + CFTypeID SCNetworkReachabilityGetTypeID(void); 12 + 13 + enum { 14 + kSCNetworkReachabilityFlagsReachable = 1 << 1, 15 + }; 16 + 17 + typedef int SCNetworkReachabilityFlags; 18 + typedef void (*SCNetworkReachabilityCallBack)(SCNetworkReachabilityRef, SCNetworkConnectionFlags, void*); 19 + 20 + typedef struct 21 + { 22 + CFIndex version; 23 + void* info; 24 + const void* (*retain)(const void*); 25 + void (*release)(const void*); 26 + CFStringRef (*copyDescription)(const void*); 27 + } SCNetworkReachabilityContext; 28 + 29 + Boolean SCNetworkReachabilityScheduleWithRunLoop(SCNetworkReachabilityRef ref, CFRunLoopRef rl, CFStringRef rlMode); 30 + Boolean SCNetworkReachabilityUnscheduleFromRunLoop(SCNetworkReachabilityRef ref, CFRunLoopRef rl, CFStringRef rlMode); 31 + 32 + Boolean SCNetworkReachabilitySetCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityCallBack cb, SCNetworkReachabilityContext* ctxt); 33 + 34 + Boolean SCNetworkReachabilityGetFlags(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags* flags); 35 + SCNetworkReachabilityRef SCNetworkReachabilityCreateWithName(CFAllocatorRef allocator, const char* nodeName); 36 + SCNetworkReachabilityRef SCNetworkReachabilityCreateWithAddressPair(CFAllocatorRef allocator, const struct sockaddr* localAddress, const struct sockaddr* remoteAddress); 37 + SCNetworkReachabilityRef SCNetworkReachabilityCreateWithAddress(CFAllocatorRef allocator, const struct sockaddr* remoteAddress); 38 + 39 + #endif 40 +
+33
src/SystemConfiguration/SCSchemaDefinitions.c
··· 1 + #include "SCSchemaDefinitions.h" 2 + #include <CoreFoundation/CFString.h> 3 + 4 + #ifndef CONST_STRING_DECL 5 + # define CONST_STRING_DECL(name, value) const CFStringRef name = CFSTR(value) 6 + #endif 7 + 8 + CONST_STRING_DECL(kSCPropNetProxiesExceptionsList, "ExceptionsList"); 9 + CONST_STRING_DECL(kSCPropNetProxiesExcludeSimpleHostnames, "ExcludeSimpleHostnames"); 10 + CONST_STRING_DECL(kSCPropNetProxiesFTPEnable, "FTPEnable"); 11 + CONST_STRING_DECL(kSCPropNetProxiesFTPPassive, "FTPPassive"); 12 + CONST_STRING_DECL(kSCPropNetProxiesFTPPort, "FTPPort"); 13 + CONST_STRING_DECL(kSCPropNetProxiesFTPProxy, "FTPProxy"); 14 + CONST_STRING_DECL(kSCPropNetProxiesGopherEnable, "GopherEnable"); 15 + CONST_STRING_DECL(kSCPropNetProxiesGopherPort, "GopherPort"); 16 + CONST_STRING_DECL(kSCPropNetProxiesGopherProxy, "GopherProxy"); 17 + CONST_STRING_DECL(kSCPropNetProxiesHTTPEnable, "HTTPEnable"); 18 + CONST_STRING_DECL(kSCPropNetProxiesHTTPPort, "HTTPPort"); 19 + CONST_STRING_DECL(kSCPropNetProxiesHTTPProxy, "HTTPProxy"); 20 + CONST_STRING_DECL(kSCPropNetProxiesHTTPSEnable, "HTTPSEnable"); 21 + CONST_STRING_DECL(kSCPropNetProxiesHTTPSPort, "HTTPSPort"); 22 + CONST_STRING_DECL(kSCPropNetProxiesHTTPSProxy, "HTTPSProxy"); 23 + CONST_STRING_DECL(kSCPropNetProxiesRTSPEnable, "RTSPEnable"); 24 + CONST_STRING_DECL(kSCPropNetProxiesRTSPPort, "RTSPPort"); 25 + CONST_STRING_DECL(kSCPropNetProxiesRTSPProxy, "RTSPProxy"); 26 + CONST_STRING_DECL(kSCPropNetProxiesSOCKSEnable, "SOCKSEnable"); 27 + CONST_STRING_DECL(kSCPropNetProxiesSOCKSPort, "SOCKSPort"); 28 + CONST_STRING_DECL(kSCPropNetProxiesSOCKSProxy, "SOCKSProxy"); 29 + CONST_STRING_DECL(kSCPropNetProxiesProxyAutoConfigEnable, "ProxyAutoConfigEnable"); 30 + CONST_STRING_DECL(kSCPropNetProxiesProxyAutoConfigJavaScript, "ProxyAutoConfigJavaScript"); 31 + CONST_STRING_DECL(kSCPropNetProxiesProxyAutoConfigURLString, "ProxyAutoConfigURLString"); 32 + CONST_STRING_DECL(kSCPropNetProxiesProxyAutoDiscoveryEnable, "ProxyAutoDiscoveryEnable"); 33 +
+40
src/SystemConfiguration/SCSchemaDefinitions.h
··· 1 + #ifndef SCSCHEMADEFINITIONS_H 2 + #define SCSCHEMADEFINITIONS_H 3 + #include <CoreFoundation/CFString.h> 4 + 5 + #ifdef __cplusplus 6 + extern "C" { 7 + #endif 8 + 9 + extern const CFStringRef kSCPropNetProxiesExceptionsList; 10 + extern const CFStringRef kSCPropNetProxiesExcludeSimpleHostnames; 11 + extern const CFStringRef kSCPropNetProxiesFTPEnable; 12 + extern const CFStringRef kSCPropNetProxiesFTPPassive; 13 + extern const CFStringRef kSCPropNetProxiesFTPPort; 14 + extern const CFStringRef kSCPropNetProxiesFTPProxy; 15 + extern const CFStringRef kSCPropNetProxiesGopherEnable; 16 + extern const CFStringRef kSCPropNetProxiesGopherPort; 17 + extern const CFStringRef kSCPropNetProxiesGopherProxy; 18 + extern const CFStringRef kSCPropNetProxiesHTTPEnable; 19 + extern const CFStringRef kSCPropNetProxiesHTTPPort; 20 + extern const CFStringRef kSCPropNetProxiesHTTPProxy; 21 + extern const CFStringRef kSCPropNetProxiesHTTPSEnable; 22 + extern const CFStringRef kSCPropNetProxiesHTTPSPort; 23 + extern const CFStringRef kSCPropNetProxiesHTTPSProxy; 24 + extern const CFStringRef kSCPropNetProxiesRTSPEnable; 25 + extern const CFStringRef kSCPropNetProxiesRTSPPort; 26 + extern const CFStringRef kSCPropNetProxiesRTSPProxy; 27 + extern const CFStringRef kSCPropNetProxiesSOCKSEnable; 28 + extern const CFStringRef kSCPropNetProxiesSOCKSPort; 29 + extern const CFStringRef kSCPropNetProxiesSOCKSProxy; 30 + extern const CFStringRef kSCPropNetProxiesProxyAutoConfigEnable; 31 + extern const CFStringRef kSCPropNetProxiesProxyAutoConfigJavaScript; 32 + extern const CFStringRef kSCPropNetProxiesProxyAutoConfigURLString; 33 + extern const CFStringRef kSCPropNetProxiesProxyAutoDiscoveryEnable; 34 + 35 + #ifdef __cplusplus 36 + } 37 + #endif 38 + 39 + #endif 40 +
+1
src/SystemConfiguration/SystemConfiguration
··· 1 + .
+11
src/SystemConfiguration/SystemConfiguration.h
··· 1 + #ifndef _SYSTEMCONFIGURATION_H 2 + #define _SYSTEMCONFIGURATION_H 3 + 4 + #include <SystemConfiguration/SCDynamicStoreCopySpecific.h> 5 + #include <SystemConfiguration/SCDynamicStore.h> 6 + #include <SystemConfiguration/SCSchemaDefinitions.h> 7 + #include <SystemConfiguration/SCNetworkConnection.h> 8 + #include <SystemConfiguration/SCNetworkReachability.h> 9 + 10 + #endif 11 +