Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOOXPVerifier.m
Go to the documentation of this file.
1/*
2
3OOOXPVerifier.m
4
5
6Copyright (C) 2007-2013 Jens Ayton and contributors
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in all
16copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24SOFTWARE.
25
26*/
27
28/* Design notes:
29 see "verifier design.txt".
30*/
31
32#import "OOOXPVerifier.h"
33
34#if OO_OXP_VERIFIER_ENABLED
35
37#import "OOLoggingExtended.h"
38#import "ResourceManager.h"
40#import "GameController.h"
41#import "OOCacheManager.h"
42#import "OODebugStandards.h"
43
44static void SwitchLogFile(NSString *name);
45static void NoteVerificationStage(NSString *displayName, NSString *stage);
46static void OpenLogFile(NSString *name);
47
48@interface OOOXPVerifier (OOPrivate)
49
50- (id)initWithPath:(NSString *)path;
51- (void)run;
52
53- (void)setUpLogOverrides;
54
55- (void)registerBaseStages;
57- (void)runStages;
58
59- (BOOL)setUpDependencies:(NSSet *)dependencies
60 forStage:(OOOXPVerifierStage *)stage;
61
62- (void)setUpDependents:(NSSet *)dependents
63 forStage:(OOOXPVerifierStage *)stage;
64
65- (void)dumpDebugGraphviz;
66
67@end
68
69
70@implementation OOOXPVerifier
71
79+ (BOOL)runVerificationIfRequested
80{
81 NSArray *arguments = nil;
82 NSEnumerator *argEnum = nil;
83 NSString *arg = nil;
84 NSString *foundPath = nil;
85 BOOL exists, isDirectory;
86 OOOXPVerifier *verifier = nil;
87 NSAutoreleasePool *pool = nil;
88
89 pool = [[NSAutoreleasePool alloc] init];
90
91 arguments = [[NSProcessInfo processInfo] arguments];
92
93 // Scan for -verify-oxp or --verify-oxp followed by relative path
94 for (argEnum = [arguments objectEnumerator]; (arg = [argEnum nextObject]); )
95 {
96 if ([arg isEqual:@"-verify-oxp"] || [arg isEqual:@"--verify-oxp"])
97 {
98 foundPath = [argEnum nextObject];
99 if (foundPath == nil)
100 {
101 OOLog(@"verifyOXP.noPath", @"***** ERROR: %@ passed without path argument; nothing to verify.", arg);
102 [pool release];
103 return YES;
104 }
105 foundPath = [foundPath stringByExpandingTildeInPath];
106 break;
107 }
108 }
109
110 if (foundPath == nil)
111 {
112 [pool release];
113 return NO;
114 }
115
116 // We got a path; does it point to a directory?
117 exists = [[NSFileManager defaultManager] fileExistsAtPath:foundPath isDirectory:&isDirectory];
118 if (!exists)
119 {
120 OOLog(@"verifyOXP.badPath", @"***** ERROR: no OXP exists at path \"%@\"; nothing to verify.", foundPath);
121 }
122 else if (!isDirectory)
123 {
124 OOLog(@"verifyOXP.badPath", @"***** ERROR: \"%@\" is a file, not an OXP directory; nothing to verify.", foundPath);
125 }
126 else
127 {
128 verifier = [[OOOXPVerifier alloc] initWithPath:foundPath];
129 [pool release];
130 pool = [[NSAutoreleasePool alloc] init];
131 [verifier run];
132 [verifier release];
133 }
134 [pool release];
135
136 // Whether or not we got a valid path, -verify-oxp was passed.
137 return YES;
138}
139
140
141- (void)dealloc
142{
143 [_verifierPList release];
144 [_basePath release];
145 [_displayName release];
146 [_stagesByName release];
147 [_waitingStages release];
148
149 [super dealloc];
150}
151
152
153- (void)registerStage:(OOOXPVerifierStage *)stage
154{
155 NSString *name = nil;
156 OOOXPVerifierStage *existing = nil;
157
158 // Sanity checking
159 if (stage == nil) return;
160
161 if (![stage isKindOfClass:[OOOXPVerifierStage class]])
162 {
163 OOLog(@"verifyOXP.registration.failed", @"Attempt to register class %@ as a verifier stage, but it is not a subclass of OOOXPVerifierStage; ignoring.", [stage class]);
164 return;
165 }
166
167 if (!_openForRegistration)
168 {
169 OOLog(@"verifyOXP.registration.failed", @"Attempt to register verifier stage %@ after registration closed, ignoring.", stage);
170 return;
171 }
172
173 name = [stage name];
174 if (name == nil)
175 {
176 OOLog(@"verifyOXP.registration.failed", @"Attempt to register verifier stage %@ with nil name, ignoring.", stage);
177 return;
178 }
179
180 // We can only have one stage with a given name. Registering the same stage twice is OK, though.
181 existing = [_stagesByName objectForKey:name];
182 if (existing == stage) return;
183 if (existing != nil)
184 {
185 OOLog(@"verifyOXP.registration.failed", @"Attempt to register verifier stage %@ with same name as stage %@, ignoring.", stage, existing);
186 return;
187 }
188
189 // Checks passed, store state.
190 [stage setVerifier:self];
191 [_stagesByName setObject:stage forKey:name];
192 [_waitingStages addObject:stage];
193}
194
195
196- (NSString *)oxpPath
197{
198 return [[_basePath retain] autorelease];
199}
200
201
202- (NSString *)oxpDisplayName
203{
204 return [[_displayName retain] autorelease];
205}
206
207
208- (id)stageWithName:(NSString *)name
209{
210 if (name == nil) return nil;
211
212 return [_stagesByName objectForKey:name];
213}
214
215
216- (id)configurationValueForKey:(NSString *)key
217{
218 return [_verifierPList objectForKey:key];
219}
220
221
222- (NSArray *)configurationArrayForKey:(NSString *)key
223{
224 return [_verifierPList oo_arrayForKey:key];
225}
226
227
228- (NSDictionary *)configurationDictionaryForKey:(NSString *)key
229{
230 return [_verifierPList oo_dictionaryForKey:key];
231}
232
233
234- (NSString *)configurationStringForKey:(NSString *)key
235{
236 return [_verifierPList oo_stringForKey:key];
237}
238
239
240- (NSSet *)configurationSetForKey:(NSString *)key
241{
242 NSArray *array = [_verifierPList oo_arrayForKey:key];
243 return array != nil ? [NSSet setWithArray:array] : nil;
244}
245
246@end
247
248
249@implementation OOOXPVerifier (OOPrivate)
250
251- (id)initWithPath:(NSString *)path
252{
253 self = [super init];
254
256
257 NSString *verifierPListPath = [[[ResourceManager builtInPath] stringByAppendingPathComponent:@"Config"] stringByAppendingPathComponent:@"verifyOXP.plist"];
258 _verifierPList = [[NSDictionary dictionaryWithContentsOfFile:verifierPListPath] retain];
259
260 _basePath = [path copy];
261 _displayName = [[NSFileManager defaultManager] displayNameAtPath:_basePath];
262 if (_displayName == nil) _displayName = [_basePath lastPathComponent];
263 [_displayName retain];
264
265 _stagesByName = [[NSMutableDictionary alloc] init];
266 _waitingStages = [[NSMutableSet alloc] init];
267
268 if (_verifierPList == nil ||
269 _basePath == nil)
270 {
271 OOLog(@"verifyOXP.setup.failed", @"%@", @"***** ERROR: failed to set up OXP verifier.");
272 [self release];
273 return nil;
274 }
275
276 _openForRegistration = YES;
277
278 return self;
279}
280
281
282- (void)run
283{
284 NoteVerificationStage(_displayName, @"");
285
286 [self setUpLogOverrides];
287
288 /* We need to be able to look up internal files, but not other OXP files.
289 To do this without clobbering the disk cache, we disable cache writes.
290 */
293 /* FIXME: the OXP verifier should load files from OXPs which have
294 * been explicitly listed as required_oxps in the
295 * manifest. Reading the manifest from the OXP being verified and
296 * setting 'id:<its identifier>' below will do this. */
297 [ResourceManager setUseAddOns:SCENARIO_OXP_DEFINITION_NONE];
298
299 SwitchLogFile(_displayName);
300 OOLog(@"verifyOXP.start", @"Running OXP verifier for %@", _basePath);//_displayName);
301
302 [self registerBaseStages];
303 [self buildDependencyGraph];
304 [self runStages];
305
306 NoteVerificationStage(_displayName, @"");
307 OOLog(@"verifyOXP.done", @"%@", @"OXP verification complete.");
308
309 OpenLogFile(_displayName);
310}
311
312
313- (void)setUpLogOverrides
314{
315 NSDictionary *overrides = nil;
316 NSEnumerator *messageClassEnum = nil;
317 NSString *messageClass = nil;
318 id verbose = nil;
319
320 OOLogSetShowMessageClassTemporary([_verifierPList oo_boolForKey:@"logShowMessageClassOverride" defaultValue:NO]);
321
322 overrides = [_verifierPList oo_dictionaryForKey:@"logControlOverride"];
323 for (messageClassEnum = [overrides keyEnumerator]; (messageClass = [messageClassEnum nextObject]); )
324 {
325 OOLogSetDisplayMessagesInClass(messageClass, [overrides oo_boolForKey:messageClass defaultValue:NO]);
326 }
327
328 /* Since actually editing logControlOverride is a pain, we also allow
329 overriding verifyOXP.verbose through user defaults. This is at least
330 as much a pain under GNUstep, but very convenient under OS X.
331 */
332 verbose = [[NSUserDefaults standardUserDefaults] objectForKey:@"oxp-verifier-verbose-logging"];
333 if (verbose != nil) OOLogSetDisplayMessagesInClass(@"verifyOXP.verbose", OOBooleanFromObject(verbose, NO));
334}
335
336
337- (void)registerBaseStages
338{
339 NSAutoreleasePool *pool = nil;
340 NSSet *stages = nil;
341 NSSet *excludeStages = nil;
342 NSEnumerator *stageEnum = nil;
343 NSString *stageName = nil;
344 Class stageClass = Nil;
345 OOOXPVerifierStage *stage = nil;
346
347 pool = [[NSAutoreleasePool alloc] init];
348
349 // Load stages specified as array of class names in verifyOXP.plist
350 stages = [self configurationSetForKey:@"stages"];
351 excludeStages = [self configurationSetForKey:@"excludeStages"];
352 if ([excludeStages count] != 0)
353 {
354 stages = [[stages mutableCopy] autorelease];
355 [(NSMutableSet *)stages minusSet:excludeStages];
356 }
357 for (stageEnum = [stages objectEnumerator]; (stageName = [stageEnum nextObject]); )
358 {
359 if ([stageName isKindOfClass:[NSString class]])
360 {
361 stageClass = NSClassFromString(stageName);
362 if (stageClass == Nil)
363 {
364 OOLog(@"verifyOXP.registration.failed", @"Attempt to register unknown class %@ as a verifier stage, ignoring.", stageName);
365 continue;
366 }
367 stage = [[stageClass alloc] init];
368 [self registerStage:stage];
369 [stage release];
370 }
371 }
372
373 [pool release];
374}
375
376
378{
379 NSAutoreleasePool *pool = nil;
380 NSArray *stageKeys = nil;
381 NSEnumerator *stageEnum = nil;
382 NSString *stageKey = nil;
383 OOOXPVerifierStage *stage = nil;
384 NSString *name = nil;
385 NSMutableDictionary *dependenciesByStage = nil,
386 *dependentsByStage = nil;
387 NSSet *dependencies = nil,
388 *dependents = nil;
389 NSValue *key = nil;
390
391 pool = [[NSAutoreleasePool alloc] init];
392
393 /* Iterate over all stages, getting dependency and dependent sets.
394 This is done in advance so that -dependencies and -dependents may
395 register stages.
396 */
397 dependenciesByStage = [NSMutableDictionary dictionary];
398 dependentsByStage = [NSMutableDictionary dictionary];
399
400 for (;;)
401 {
402 /* Loop while there are stages whose dependency lists haven't been
403 checked. This is an indeterminate loop since new ones can be
404 added.
405 */
406 stage = [_waitingStages anyObject];
407 if (stage == nil) break;
408 [_waitingStages removeObject:stage];
409
410 key = [NSValue valueWithNonretainedObject:stage];
411
412 dependencies = [stage dependencies];
413 if (dependencies != nil)
414 {
415 [dependenciesByStage setObject:dependencies
416 forKey:key];
417 }
418
419 dependents = [stage dependents];
420 if (dependents != nil)
421 {
422 [dependentsByStage setObject:dependents
423 forKey:key];
424 }
425 }
426 [_waitingStages release];
427 _waitingStages = nil;
428 _openForRegistration = NO;
429
430 // Iterate over all stages, resolving dependencies.
431 stageKeys = [_stagesByName allKeys]; // Get the keys up front because we may need to remove entries from dictionary.
432
433 for (stageEnum = [stageKeys objectEnumerator]; (stageKey = [stageEnum nextObject]); )
434 {
435 stage = [_stagesByName objectForKey:stageKey];
436 if (stage == nil) continue;
437
438 // Sanity check
439 name = [stage name];
440 if (![stageKey isEqualToString:name])
441 {
442 OOLog(@"verifyOXP.buildDependencyGraph.badName", @"***** Stage name appears to have changed from \"%@\" to \"%@\" for verifier stage %@, removing.", stageKey, name, stage);
443 [_stagesByName removeObjectForKey:stageKey];
444 continue;
445 }
446
447 // Get dependency set
448 key = [NSValue valueWithNonretainedObject:stage];
449 dependencies = [dependenciesByStage objectForKey:key];
450
451 if (dependencies != nil && ![self setUpDependencies:dependencies forStage:stage])
452 {
453 [_stagesByName removeObjectForKey:stageKey];
454 }
455 }
456
457 /* Iterate over all stages again, resolving reverse dependencies.
458 This is done in a separate pass because reverse dependencies are "weak"
459 while forward dependencies are "strong".
460 */
461 stageKeys = [_stagesByName allKeys];
462
463 for (stageEnum = [stageKeys objectEnumerator]; (stageKey = [stageEnum nextObject]); )
464 {
465 stage = [_stagesByName objectForKey:stageKey];
466 if (stage == nil) continue;
467
468 // Get dependent set
469 key = [NSValue valueWithNonretainedObject:stage];
470 dependents = [dependentsByStage objectForKey:key];
471
472 if (dependents != nil)
473 {
474 [self setUpDependents:dependents forStage:stage];
475 }
476 }
477
478 _waitingStages = [[NSMutableSet alloc] initWithArray:[_stagesByName allValues]];
479 [_waitingStages makeObjectsPerformSelector:@selector(dependencyRegistrationComplete)];
480
481 if ([[NSUserDefaults standardUserDefaults] boolForKey:@"oxp-verifier-dump-debug-graphviz"])
482 {
483 [self dumpDebugGraphviz];
484 }
485
486 [pool release];
487}
488
489
490- (void)runStages
491{
492 NSAutoreleasePool *pool = nil;
493 NSEnumerator *stageEnum = nil;
494 OOOXPVerifierStage *candidateStage = nil,
495 *stageToRun = nil;
496 NSString *stageName = nil;
497
498 // Loop while there are still stages to run.
499 for (;;)
500 {
501 pool = [[NSAutoreleasePool alloc] init];
502
503 // Look through queue for a stage that's ready
504 stageToRun = nil;
505 for (stageEnum = [_waitingStages objectEnumerator]; (candidateStage = [stageEnum nextObject]); )
506 {
507 if ([candidateStage canRun])
508 {
509 stageToRun = candidateStage;
510 break;
511 }
512 }
513 if (stageToRun == nil)
514 {
515 // No more runnable stages
516 [pool release];
517 break;
518 }
519
520 stageName = nil;
522 @try
523 {
524 stageName = [stageToRun name];
525 if ([stageToRun shouldRun])
526 {
527 NoteVerificationStage(_displayName, stageName);
528 OOLog(@"verifyOXP.runStage", @"%@", stageName);
529 OOLogIndent();
530 [stageToRun performRun];
531 }
532 else
533 {
534 OOLog(@"verifyOXP.verbose.skipStage", @"- Skipping stage: %@ (nothing to do).", stageName);
535 [stageToRun noteSkipped];
536 }
537 }
538 @catch (NSException *exception)
539 {
540 if (stageName == nil) stageName = [[stageToRun class] description];
541 OOLog(@"verifyOXP.exception", @"***** Exception occurred when running OXP verifier stage \"%@\": %@: %@", stageName, [exception name], [exception reason]);
542 }
544
545 [_waitingStages removeObject:stageToRun];
546 [pool release];
547 }
548
549 pool = [[NSAutoreleasePool alloc] init];
550
551 if ([_waitingStages count] != 0)
552 {
553 OOLog(@"verifyOXP.incomplete", @"%@", @"Some verifier stages could not be run:");
554 OOLogIndent();
555 for (stageEnum = [_waitingStages objectEnumerator]; (candidateStage = [stageEnum nextObject]); )
556 {
557 OOLog(@"verifyOXP.incomplete.item", @"%@", candidateStage);
558 }
559 OOLogOutdent();
560 }
561 [_waitingStages release];
562 _waitingStages = nil;
563
564 [pool release];
565}
566
567
568- (BOOL)setUpDependencies:(NSSet *)dependencies
569 forStage:(OOOXPVerifierStage *)stage
570{
571 NSString *depName = nil;
572 NSEnumerator *depEnum = nil;
573 OOOXPVerifierStage *depStage = nil;
574
575 // Iterate over dependencies, connecting them up.
576 for (depEnum = [dependencies objectEnumerator]; (depName = [depEnum nextObject]); )
577 {
578 depStage = [_stagesByName objectForKey:depName];
579 if (depStage == nil)
580 {
581 OOLog(@"verifyOXP.buildDependencyGraph.unresolved", @"Verifier stage %@ has unresolved dependency \"%@\", skipping.", stage, depName);
582 return NO;
583 }
584
585 if ([depStage isDependentOf:stage])
586 {
587 OOLog(@"verifyOXP.buildDependencyGraph.circularReference", @"Verifier stages %@ and %@ have a dependency loop, skipping.", stage, depStage);
588 [_stagesByName removeObjectForKey:depName];
589 return NO;
590 }
591
592 [stage registerDependency:depStage];
593 }
594
595 return YES;
596}
597
598
599- (void)setUpDependents:(NSSet *)dependents
600 forStage:(OOOXPVerifierStage *)stage
601{
602 NSString *depName = nil;
603 NSEnumerator *depEnum = nil;
604 OOOXPVerifierStage *depStage = nil;
605
606 // Iterate over dependents, connecting them up.
607 for (depEnum = [dependents objectEnumerator]; (depName = [depEnum nextObject]); )
608 {
609 depStage = [_stagesByName objectForKey:depName];
610 if (depStage == nil)
611 {
612 OOLog(@"verifyOXP.buildDependencyGraph.unresolved", @"Verifier stage %@ has unresolved dependent \"%@\".", stage, depName);
613 continue; // Unresolved/conflicting dependents are non-fatal
614 }
615
616 if ([stage isDependentOf:depStage])
617 {
618 OOLog(@"verifyOXP.buildDependencyGraph.circularReference", @"Verifier stage %@ lists %@ as both dependent and dependency (possibly indirectly); will execute %@ after %@.", stage, depStage, stage, depStage);
619 continue;
620 }
621
622 [depStage registerDependency:stage];
623 }
624}
625
626
627- (void)dumpDebugGraphviz
628{
629 NSMutableString *graphViz = nil;
630 NSDictionary *graphVizTemplate = nil;
631 NSString *template = nil,
632 *startTemplate = nil,
633 *endTemplate = nil;
634 NSEnumerator *stageEnum = nil;
635 OOOXPVerifierStage *stage = nil;
636 NSSet *deps = nil;
637 NSEnumerator *depEnum = nil;
638 OOOXPVerifierStage *dep = nil;
639
640 graphVizTemplate = [self configurationDictionaryForKey:@"debugGraphvizTempate"];
641 graphViz = [NSMutableString stringWithFormat:[graphVizTemplate oo_stringForKey:@"preamble"], [NSDate date]];
642
643 /* Pass 1: enumerate over graph setting node attributes for each stage.
644 We use pointers as node names for simplicity of generation.
645 */
646 template = [graphVizTemplate oo_stringForKey:@"node"];
647 for (stageEnum = [_stagesByName objectEnumerator]; (stage = [stageEnum nextObject]); )
648 {
649 [graphViz appendFormat:template, stage, [stage class], [stage name]];
650 }
651
652 [graphViz appendString:[graphVizTemplate oo_stringForKey:@"forwardPreamble"]];
653
654 /* Pass 2: enumerate over graph setting forward arcs for each dependency.
655 */
656 template = [graphVizTemplate oo_stringForKey:@"forwardArc"];
657 startTemplate = [graphVizTemplate oo_stringForKey:@"startArc"];
658 for (stageEnum = [_stagesByName objectEnumerator]; (stage = [stageEnum nextObject]); )
659 {
660 deps = [stage resolvedDependencies];
661 if ([deps count] != 0)
662 {
663 for (depEnum = [deps objectEnumerator]; (dep = [depEnum nextObject]); )
664 {
665 [graphViz appendFormat:template, dep, stage];
666 }
667 }
668 else
669 {
670 [graphViz appendFormat:startTemplate, stage];
671 }
672 }
673
674 [graphViz appendString:[graphVizTemplate oo_stringForKey:@"backwardPreamble"]];
675
676 /* Pass 3: enumerate over graph setting backward arcs for each dependent.
677 */
678 template = [graphVizTemplate oo_stringForKey:@"backwardArc"];
679 endTemplate = [graphVizTemplate oo_stringForKey:@"endArc"];
680 for (stageEnum = [_stagesByName objectEnumerator]; (stage = [stageEnum nextObject]); )
681 {
682 deps = [stage resolvedDependents];
683 if ([deps count] != 0)
684 {
685 for (depEnum = [deps objectEnumerator]; (dep = [depEnum nextObject]); )
686 {
687 [graphViz appendFormat:template, dep, stage];
688 }
689 }
690 else
691 {
692 [graphViz appendFormat:endTemplate, stage];
693 }
694 }
695
696 [graphViz appendString:[graphVizTemplate oo_stringForKey:@"postamble"]];
697
698 // Write file
699 [ResourceManager writeDiagnosticString:graphViz toFileNamed:@"OXPVerifierStageDependencies.dot"];
700}
701
702@end
703
704
705#import "OOLogOutputHandler.h"
706
707
708static void SwitchLogFile(NSString *name)
709{
710//#ifndef OOLITE_LINUX
711 name = [name stringByAppendingPathExtension:@"log"];
712 OOLog(@"verifyOXP.switchingLog", @"Switching log files -- logging to \"%@\".", name);
714//#else
715// OOLog(@"verifyOXP.switchingLog", @"Switching logging to <stdout>.");
716// OOLogOutputHandlerStartLoggingToStdout();
717//#endif
718}
719
720
721static void NoteVerificationStage(NSString *displayName, NSString *stage)
722{
723 [[GameController sharedController] logProgress:[NSString stringWithFormat:@"Verifying %@\n%@", displayName, stage]];
724}
725
726
727static void OpenLogFile(NSString *name)
728{
729 // Open log file in appropriate application / provide feedback.
730
731 if ([[NSUserDefaults standardUserDefaults] oo_boolForKey:@"oxp-verifier-open-log" defaultValue:YES])
732 {
733#if OOLITE_MAC_OS_X
734 [[NSWorkspace sharedWorkspace] openFile:OOLogHandlerGetLogPath()];
735#elif OOLITE_WINDOWS
736 // start wordpad (for historical reasons wordpad is called write from the command prompt)
737 system([[NSString stringWithFormat:@"write \"Logs\\%@.log\"", name] UTF8String]);
738#elif OOLITE_LINUX
739 // MKW - needed to suppress 'ignoring return value' warning for system() call
740 // int ret;
741 // CIM - and now the compiler complains about that too... casting return
742 // value to void seems to keep it quiet for now
743 // Nothing to do here, since we dump to stdout instead of to a file.
744 //OOLogOutputHandlerStopLoggingToStdout();
745 (void) system([[NSString stringWithFormat:@"cat \"%@\"", OOLogHandlerGetLogPath()] UTF8String]);
746#else
747 do {} while (0);
748#endif
749 }
750}
751
752
753#endif // OO_OXP_VERIFIER_ENABLED
BOOL OOBooleanFromObject(id object, BOOL defaultValue)
void OOSetStandardsForOXPVerifierMode(void)
NSString * OOLogHandlerGetLogPath(void)
void OOLogOutputHandlerChangeLogFile(NSString *newLogName)
void OOLogPushIndent(void)
Definition OOLogging.m:316
void OOLogPopIndent(void)
Definition OOLogging.m:340
void OOLogOutdent(void)
Definition OOLogging.m:376
#define OOLog(class, format,...)
Definition OOLogging.h:88
void OOLogIndent(void)
Definition OOLogging.m:366
void OOLogSetDisplayMessagesInClass(NSString *inClass, BOOL inFlag)
Definition OOLogging.m:182
void OOLogSetShowMessageClassTemporary(BOOL flag)
Definition OOLogging.m:579
static void SwitchLogFile(NSString *name)
static void NoteVerificationStage(NSString *displayName, NSString *stage)
static void OpenLogFile(NSString *name)
unsigned count
return nil
GameController * sharedController()
void logProgress:(NSString *message)
void setAllowCacheWrites:(BOOL flag)
OOCacheManager * sharedCache()
void setVerifier:(OOOXPVerifier *verifier)
NSString * builtInPath()
BOOL writeDiagnosticString:toFileNamed:(NSString *string,[toFileNamed] NSString *name)
void setUseAddOns:(NSString *useAddOns)