/ src / private-frameworks / AssetCacheServices / src / AssetCacheServices.m
AssetCacheServices.m
 1  /*
 2   This file is part of Darling.
 3  
 4   Copyright (C) 2020 Lubos Dolezel
 5  
 6   Darling is free software: you can redistribute it and/or modify
 7   it under the terms of the GNU General Public License as published by
 8   the Free Software Foundation, either version 3 of the License, or
 9   (at your option) any later version.
10  
11   Darling is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15  
16   You should have received a copy of the GNU General Public License
17   along with Darling.  If not, see <http://www.gnu.org/licenses/>.
18  */
19  
20  
21  #include <AssetCacheServices/AssetCacheServices.h>
22  #include <stdlib.h>
23  #include <stdio.h>
24  
25  static int verbose = 0;
26  
27  __attribute__((constructor))
28  static void initme(void) {
29  	verbose = getenv("STUB_VERBOSE") != NULL;
30  }
31  
32  void ACSImportFileIntoCachingServer(CFURLRef asset_url, CFStringRef source_path, CFDictionaryRef headers, CFDictionaryRef options, dispatch_queue_t callback_queue, void(^callback)(bool)) {
33  	if (verbose)
34  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
35  };
36  
37  void ACSLocateCachingServer(CFURLRef asset_url, double timeout, CFDictionaryRef options, dispatch_queue_t callback_queue, void(^callback)(CFURLRef, CFMutableDictionaryRef)) {
38  	if (verbose)
39  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
40  };
41  
42  void ACSMightCurrentNetworkHaveCachingServer(CFDictionaryRef options, dispatch_queue_t callback_queue, void(^callback)(bool)) {
43  	if (verbose)
44  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
45  };
46  
47  void ACSUpdateCachingServerHealth(CFURLRef url, CFDictionaryRef options, BOOL healthy) {
48  	if (verbose)
49  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
50  };
51  
52  void _ACSIntrospect(CFDictionaryRef options, dispatch_queue_t callback_queue, void(^callback)(CFTypeRef)) {
53  	if (verbose)
54  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
55  };
56  
57  void _ACSLocateAllCachingServers(double timeout, CFDictionaryRef options, dispatch_queue_t callback_queue, void(^callback)(CFMutableArrayRef)) {
58  	if (verbose)
59  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
60  };
61  
62  void _ACSSetTestFlags(uint64_t flags, CFDictionaryRef dictionary) {
63  	if (verbose)
64  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
65  };
66  
67  void _A_CALLBACK_BLOCK_RELEASED_AN_ASSETCACHESERVICES_OBJECT_IT_DID_NOT_OWN(int integer, const char* function_name, const char* string, void* object) {
68  	if (verbose)
69  		printf("STUB: %s called\n", __PRETTY_FUNCTION__);
70  };