diff --git a/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Headers b/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Headers new file mode 120000 index 000000000..a177d2a6b --- /dev/null +++ b/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Versions/A/Headers b/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Versions/A/Headers new file mode 120000 index 000000000..e636a186e --- /dev/null +++ b/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Versions/A/Headers @@ -0,0 +1 @@ +../../../../../../../../../../../../src/private-frameworks/ServerInformation/include/ServerInformation \ No newline at end of file diff --git a/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Versions/Current b/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Versions/Current new file mode 120000 index 000000000..8c7e5a667 --- /dev/null +++ b/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/framework-include/ServerInformation b/framework-include/ServerInformation new file mode 120000 index 000000000..56285f4d1 --- /dev/null +++ b/framework-include/ServerInformation @@ -0,0 +1 @@ +../Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ServerInformation.framework/Headers \ No newline at end of file diff --git a/src/private-frameworks/CMakeLists.txt b/src/private-frameworks/CMakeLists.txt index 73c8eb16d..78c39be14 100644 --- a/src/private-frameworks/CMakeLists.txt +++ b/src/private-frameworks/CMakeLists.txt @@ -33,6 +33,7 @@ add_subdirectory(PerformanceAnalysis) add_subdirectory(PlugInKit) add_subdirectory(PowerLog) add_subdirectory(ProtocolBuffer) +add_subdirectory(ServerInformation) add_subdirectory(SkyLight) add_subdirectory(Spotlight) add_subdirectory(SpotlightDaemon) diff --git a/src/private-frameworks/ServerInformation/CMakeLists.txt b/src/private-frameworks/ServerInformation/CMakeLists.txt new file mode 100644 index 000000000..4349ac07c --- /dev/null +++ b/src/private-frameworks/ServerInformation/CMakeLists.txt @@ -0,0 +1,20 @@ +project(ServerInformation) + +set(DYLIB_COMPAT_VERSION "1.0.0") +set(DYLIB_CURRENT_VERSION "1.0.0") + +add_framework(ServerInformation + FAT + CURRENT_VERSION + PRIVATE + VERSION "A" + + SOURCES + src/ServerInformation.m + src/ServerInformationComputerModelInfo.m + + DEPENDENCIES + system + objc + Foundation +) diff --git a/src/private-frameworks/ServerInformation/include/ServerInformation/ServerInformation.h b/src/private-frameworks/ServerInformation/include/ServerInformation/ServerInformation.h new file mode 100644 index 000000000..95f018559 --- /dev/null +++ b/src/private-frameworks/ServerInformation/include/ServerInformation/ServerInformation.h @@ -0,0 +1,41 @@ +/* + This file is part of Darling. + + Copyright (C) 2021 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + + +#ifndef _ServerInformation_H_ +#define _ServerInformation_H_ + +#if __OBJC__ +#import +#endif + +void* SICopyLocalizedServerProductName(void); +void* SICopyMinimumServerVersion(void); +void* SICopyServerBuildVersion(void); +void* SICopyServerVersion(void); +void* SIGetServerInstallPathPrefix(void); +void* SIGetServerPerformanceModeEnabled(void); +void* SIIsOSXServerVolume(void); +void* SIIsOSXServerVolumeConfigured(void); +void* SIIsServerHardware(void); +void* SIIsXsanCapable(void); +void* SISetServerPerformanceModeEnabled(void); +void* _SIIsOSXVolumeVersionEqualToOrGreater(void); + +#endif diff --git a/src/private-frameworks/ServerInformation/include/ServerInformation/ServerInformationComputerModelInfo.h b/src/private-frameworks/ServerInformation/include/ServerInformation/ServerInformationComputerModelInfo.h new file mode 100644 index 000000000..e4de19aa5 --- /dev/null +++ b/src/private-frameworks/ServerInformation/include/ServerInformation/ServerInformationComputerModelInfo.h @@ -0,0 +1,24 @@ +/* + This file is part of Darling. + + Copyright (C) 2021 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#include + +@interface ServerInformationComputerModelInfo : NSObject + +@end diff --git a/src/private-frameworks/ServerInformation/src/ServerInformation.m b/src/private-frameworks/ServerInformation/src/ServerInformation.m new file mode 100644 index 000000000..633d1cefb --- /dev/null +++ b/src/private-frameworks/ServerInformation/src/ServerInformation.m @@ -0,0 +1,102 @@ +/* + This file is part of Darling. + + Copyright (C) 2021 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + + +#include +#include +#include + +static int verbose = 0; + +__attribute__((constructor)) +static void initme(void) { + verbose = getenv("STUB_VERBOSE") != NULL; +} + +void* SICopyLocalizedServerProductName(void) +{ + if (verbose) puts("STUB: SICopyLocalizedServerProductName called"); + return NULL; +} + +void* SICopyMinimumServerVersion(void) +{ + if (verbose) puts("STUB: SICopyMinimumServerVersion called"); + return NULL; +} + +void* SICopyServerBuildVersion(void) +{ + if (verbose) puts("STUB: SICopyServerBuildVersion called"); + return NULL; +} + +void* SICopyServerVersion(void) +{ + if (verbose) puts("STUB: SICopyServerVersion called"); + return NULL; +} + +void* SIGetServerInstallPathPrefix(void) +{ + if (verbose) puts("STUB: SIGetServerInstallPathPrefix called"); + return NULL; +} + +void* SIGetServerPerformanceModeEnabled(void) +{ + if (verbose) puts("STUB: SIGetServerPerformanceModeEnabled called"); + return NULL; +} + +void* SIIsOSXServerVolume(void) +{ + if (verbose) puts("STUB: SIIsOSXServerVolume called"); + return NULL; +} + +void* SIIsOSXServerVolumeConfigured(void) +{ + if (verbose) puts("STUB: SIIsOSXServerVolumeConfigured called"); + return NULL; +} + +void* SIIsServerHardware(void) +{ + if (verbose) puts("STUB: SIIsServerHardware called"); + return NULL; +} + +void* SIIsXsanCapable(void) +{ + if (verbose) puts("STUB: SIIsXsanCapable called"); + return NULL; +} + +void* SISetServerPerformanceModeEnabled(void) +{ + if (verbose) puts("STUB: SISetServerPerformanceModeEnabled called"); + return NULL; +} + +void* _SIIsOSXVolumeVersionEqualToOrGreater(void) +{ + if (verbose) puts("STUB: _SIIsOSXVolumeVersionEqualToOrGreater called"); + return NULL; +} diff --git a/src/private-frameworks/ServerInformation/src/ServerInformationComputerModelInfo.m b/src/private-frameworks/ServerInformation/src/ServerInformationComputerModelInfo.m new file mode 100644 index 000000000..785fc09aa --- /dev/null +++ b/src/private-frameworks/ServerInformation/src/ServerInformationComputerModelInfo.m @@ -0,0 +1,34 @@ +/* + This file is part of Darling. + + Copyright (C) 2021 Lubos Dolezel + + Darling is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Darling is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Darling. If not, see . +*/ + +#import + +@implementation ServerInformationComputerModelInfo + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector +{ + return [NSMethodSignature signatureWithObjCTypes: "v@:"]; +} + +- (void)forwardInvocation:(NSInvocation *)anInvocation +{ + NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); +} + +@end