/ src / private-frameworks / LoggingSupport / src / LoggingSupport.m
LoggingSupport.m
  1  /*
  2   This file is part of Darling.
  3  
  4   Copyright (C) 2017 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 <LoggingSupport/LoggingSupport.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* OSLogClearOptions(void) {
 33      if (verbose) puts("STUB: OSLogClearOptions called");
 34      return NULL;
 35  }
 36  
 37  void* OSLogConstructArchive(void) {
 38      if (verbose) puts("STUB: OSLogConstructArchive called");
 39      return NULL;
 40  }
 41  
 42  void* OSLogCreateArchive(void) {
 43      if (verbose) puts("STUB: OSLogCreateArchive called");
 44      return NULL;
 45  }
 46  
 47  void* OSLogCreateArchiveWithDictionary(void) {
 48      if (verbose) puts("STUB: OSLogCreateArchiveWithDictionary called");
 49      return NULL;
 50  }
 51  
 52  void* OSLogInstallProfilePayload(void) {
 53      if (verbose) puts("STUB: OSLogInstallProfilePayload called");
 54      return NULL;
 55  }
 56  
 57  void* OSLogLogdAdminConnection(void) {
 58      if (verbose) puts("STUB: OSLogLogdAdminConnection called");
 59      return NULL;
 60  }
 61  
 62  void* OSLogLookupPathWithUUID(void) {
 63      if (verbose) puts("STUB: OSLogLookupPathWithUUID called");
 64      return NULL;
 65  }
 66  
 67  void* OSLogRemoveProfilePayload(void) {
 68      if (verbose) puts("STUB: OSLogRemoveProfilePayload called");
 69      return NULL;
 70  }
 71  
 72  void* OSLogSetOptions(void) {
 73      if (verbose) puts("STUB: OSLogSetOptions called");
 74      return NULL;
 75  }
 76  
 77  void* OSLogStateCaptureForAllPIDs(void) {
 78      if (verbose) puts("STUB: OSLogStateCaptureForAllPIDs called");
 79      return NULL;
 80  }
 81  
 82  void* OSLogValidateProfilePayload(void) {
 83      if (verbose) puts("STUB: OSLogValidateProfilePayload called");
 84      return NULL;
 85  }
 86  
 87  void* _OSLogGetSimplePredicate(void) {
 88      if (verbose) puts("STUB: _OSLogGetSimplePredicate called");
 89      return NULL;
 90  }
 91  
 92  void* _catalog_create(void) {
 93      if (verbose) puts("STUB: _catalog_create called");
 94      return NULL;
 95  }
 96  
 97  void* _catalog_create_with_chunk(void) {
 98      if (verbose) puts("STUB: _catalog_create_with_chunk called");
 99      return NULL;
100  }
101  
102  void* _catalog_destroy(void) {
103      if (verbose) puts("STUB: _catalog_destroy called");
104      return NULL;
105  }
106  
107  void* _catalog_for_each_uuid(void) {
108      if (verbose) puts("STUB: _catalog_for_each_uuid called");
109      return NULL;
110  }
111  
112  void* _catalog_lookup_procinfo_by_procid(void) {
113      if (verbose) puts("STUB: _catalog_lookup_procinfo_by_procid called");
114      return NULL;
115  }
116  
117  void* _catalog_lookup_procinfo_by_procinfo_key(void) {
118      if (verbose) puts("STUB: _catalog_lookup_procinfo_by_procinfo_key called");
119      return NULL;
120  }
121  
122  void* _catalog_procinfo_create(void) {
123      if (verbose) puts("STUB: _catalog_procinfo_create called");
124      return NULL;
125  }
126  
127  void* _catalog_procinfo_for_each_uuidinfo(void) {
128      if (verbose) puts("STUB: _catalog_procinfo_for_each_uuidinfo called");
129      return NULL;
130  }
131  
132  void* _catalog_procinfo_lookup_pc(void) {
133      if (verbose) puts("STUB: _catalog_procinfo_lookup_pc called");
134      return NULL;
135  }
136  
137  void* _catalog_procinfo_lookup_subsystem(void) {
138      if (verbose) puts("STUB: _catalog_procinfo_lookup_subsystem called");
139      return NULL;
140  }
141  
142  void* _catalog_procinfo_uuidinfo_add(void) {
143      if (verbose) puts("STUB: _catalog_procinfo_uuidinfo_add called");
144      return NULL;
145  }
146  
147  void* _catalog_procinfo_uuidinfo_remove(void) {
148      if (verbose) puts("STUB: _catalog_procinfo_uuidinfo_remove called");
149      return NULL;
150  }
151  
152  void* _catalog_subchunk_procinfo_add(void) {
153      if (verbose) puts("STUB: _catalog_subchunk_procinfo_add called");
154      return NULL;
155  }
156  
157  void* _catalog_update_earliest_fhbuf_ts(void) {
158      if (verbose) puts("STUB: _catalog_update_earliest_fhbuf_ts called");
159      return NULL;
160  }
161  
162  void* _catalog_uuid_add(void) {
163      if (verbose) puts("STUB: _catalog_uuid_add called");
164      return NULL;
165  }
166  
167  void* _chunk_support_convert_tracepoint(void) {
168      if (verbose) puts("STUB: _chunk_support_convert_tracepoint called");
169      return NULL;
170  }
171  
172  void* _os_activity_stream_entry_decode(void) {
173      if (verbose) puts("STUB: _os_activity_stream_entry_decode called");
174      return NULL;
175  }
176  
177  void* _os_log_resolve_format(void) {
178      if (verbose) puts("STUB: _os_log_resolve_format called");
179      return NULL;
180  }
181  
182  void* _os_log_set_nscf_formatter(void) {
183      if (verbose) puts("STUB: _os_log_set_nscf_formatter called");
184      return NULL;
185  }
186  
187  void* _os_trace_persistdir_path(void) {
188      if (verbose) puts("STUB: _os_trace_persistdir_path called");
189      return NULL;
190  }
191  
192  void* _os_trace_timesyncdir_path(void) {
193      if (verbose) puts("STUB: _os_trace_timesyncdir_path called");
194      return NULL;
195  }
196  
197  void* _os_trace_uuiddb_dsc_map_resolve(void) {
198      if (verbose) puts("STUB: _os_trace_uuiddb_dsc_map_resolve called");
199      return NULL;
200  }
201  
202  void* _os_trace_uuiddb_dsc_validate_hdr(void) {
203      if (verbose) puts("STUB: _os_trace_uuiddb_dsc_validate_hdr called");
204      return NULL;
205  }
206  
207  void* _os_trace_uuiddb_get_dsc_map_fd(void) {
208      if (verbose) puts("STUB: _os_trace_uuiddb_get_dsc_map_fd called");
209      return NULL;
210  }
211  
212  void* _os_trace_uuiddb_path(void) {
213      if (verbose) puts("STUB: _os_trace_uuiddb_path called");
214      return NULL;
215  }
216  
217  void* _os_trace_uuiddb_path_exists(void) {
218      if (verbose) puts("STUB: _os_trace_uuiddb_path_exists called");
219      return NULL;
220  }
221  
222  void* _state_support_decode_data(void) {
223      if (verbose) puts("STUB: _state_support_decode_data called");
224      return NULL;
225  }
226  
227  void* _state_support_validate_chunk(void) {
228      if (verbose) puts("STUB: _state_support_validate_chunk called");
229      return NULL;
230  }
231  
232  void* _state_support_validate_payload(void) {
233      if (verbose) puts("STUB: _state_support_validate_payload called");
234      return NULL;
235  }
236  
237  void* _timesync_continuous_to_wall_time(void) {
238      if (verbose) puts("STUB: _timesync_continuous_to_wall_time called");
239      return NULL;
240  }
241  
242  void* _timesync_db_dup(void) {
243      if (verbose) puts("STUB: _timesync_db_dup called");
244      return NULL;
245  }
246  
247  void* _timesync_db_open(void) {
248      if (verbose) puts("STUB: _timesync_db_open called");
249      return NULL;
250  }
251  
252  void* _timesync_db_openat(void) {
253      if (verbose) puts("STUB: _timesync_db_openat called");
254      return NULL;
255  }
256  
257  void* _timesync_mach_timebase(void) {
258      if (verbose) puts("STUB: _timesync_mach_timebase called");
259      return NULL;
260  }
261  
262  void* _timesync_range_count(void) {
263      if (verbose) puts("STUB: _timesync_range_count called");
264      return NULL;
265  }
266  
267  void* _timesync_range_create(void) {
268      if (verbose) puts("STUB: _timesync_range_create called");
269      return NULL;
270  }
271  
272  void* _timesync_range_destroy(void) {
273      if (verbose) puts("STUB: _timesync_range_destroy called");
274      return NULL;
275  }
276  
277  void* _timesync_repair(void) {
278      if (verbose) puts("STUB: _timesync_repair called");
279      return NULL;
280  }
281  
282  void* _timesync_validate(void) {
283      if (verbose) puts("STUB: _timesync_validate called");
284      return NULL;
285  }
286  
287  void* _timesync_wall_time_to_continuous(void) {
288      if (verbose) puts("STUB: _timesync_wall_time_to_continuous called");
289      return NULL;
290  }
291  
292  void* os_activity_stream_add_pid(void) {
293      if (verbose) puts("STUB: os_activity_stream_add_pid called");
294      return NULL;
295  }
296  
297  void* os_activity_stream_cancel(void) {
298      if (verbose) puts("STUB: os_activity_stream_cancel called");
299      return NULL;
300  }
301  
302  void* os_activity_stream_for_pid(void) {
303      if (verbose) puts("STUB: os_activity_stream_for_pid called");
304      return NULL;
305  }
306  
307  void* os_activity_stream_for_simulator(void) {
308      if (verbose) puts("STUB: os_activity_stream_for_simulator called");
309      return NULL;
310  }
311  
312  void* os_activity_stream_persistence(void) {
313      if (verbose) puts("STUB: os_activity_stream_persistence called");
314      return NULL;
315  }
316  
317  void* os_activity_stream_resume(void) {
318      if (verbose) puts("STUB: os_activity_stream_resume called");
319      return NULL;
320  }
321  
322  void* os_activity_stream_set_event_handler(void) {
323      if (verbose) puts("STUB: os_activity_stream_set_event_handler called");
324      return NULL;
325  }
326  
327  void* os_activity_stream_set_filter(void) {
328      if (verbose) puts("STUB: os_activity_stream_set_filter called");
329      return NULL;
330  }
331  
332  void* os_log_copy_formatted_message(void) {
333      if (verbose) puts("STUB: os_log_copy_formatted_message called");
334      return NULL;
335  }
336  
337  void* os_log_fmt_compose(void) {
338      if (verbose) puts("STUB: os_log_fmt_compose called");
339      return NULL;
340  }
341  
342  void* os_log_fmt_convert_trace(void) {
343      if (verbose) puts("STUB: os_log_fmt_convert_trace called");
344      return NULL;
345  }
346  
347  void* os_log_fmt_extract_pubdata(void) {
348      if (verbose) puts("STUB: os_log_fmt_extract_pubdata called");
349      return NULL;
350  }
351  
352  void* os_log_fmt_get_plugin(void) {
353      if (verbose) puts("STUB: os_log_fmt_get_plugin called");
354      return NULL;
355  }
356  
357  void* os_trace_copy_formatted_message(void) {
358      if (verbose) puts("STUB: os_trace_copy_formatted_message called");
359      return NULL;
360  }
361  
362  void* uuidpath_lookup_fd(void) {
363      if (verbose) puts("STUB: uuidpath_lookup_fd called");
364      return NULL;
365  }
366  
367  void* uuidpath_map_header(void) {
368      if (verbose) puts("STUB: uuidpath_map_header called");
369      return NULL;
370  }
371  
372  void* uuidpath_map_header_fd(void) {
373      if (verbose) puts("STUB: uuidpath_map_header_fd called");
374      return NULL;
375  }
376  
377  void* uuidpath_resolve(void) {
378      if (verbose) puts("STUB: uuidpath_resolve called");
379      return NULL;
380  }
381  
382  void* uuidpath_resolve_fd(void) {
383      if (verbose) puts("STUB: uuidpath_resolve_fd called");
384      return NULL;
385  }
386  
387  void* uuidpath_sharedcache_resolve_fd(void) {
388      if (verbose) puts("STUB: uuidpath_sharedcache_resolve_fd called");
389      return NULL;
390  }