Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Sep 5, 2011
1 parent 3c4e588 commit 42e73f3
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 63 deletions.
2 changes: 0 additions & 2 deletions Source/Action.h
Expand Up @@ -5,8 +5,6 @@
// Created by David Symonds on 3/04/07.
//


#import "BetterAuthorizationSampleLib.h"
#import "CPHelperToolCommon.h"

@interface Action : NSObject {
Expand Down
20 changes: 11 additions & 9 deletions Source/Action.m
Expand Up @@ -6,9 +6,12 @@
//

#import "Action.h"
#import "BetterAuthorizationSampleLib.h"
#import "DSLogger.h"
#import "PrefsWindowController.h"

extern const BASCommandSpec kCPHelperToolCommandSet[];

@interface Action (Private)

- (OSStatus) helperActualPerform: (NSString *) action withResponse: (CFDictionaryRef *) response;
Expand All @@ -17,7 +20,6 @@ - (OSStatus) fixHelperTool: (BASFailCode) failCode;

@end


@implementation Action

+ (NSString *)typeForClass:(Class)klass
Expand Down Expand Up @@ -195,10 +197,10 @@ - (OSStatus) helperActualPerform: (NSString *) action withResponse: (CFDictionar

// Execute it.
error = BASExecuteRequestInHelperTool(gAuth,
kCPHelperToolCommandSet,
(CFStringRef) bundleID,
(CFDictionaryRef) request,
response);
kCPHelperToolCommandSet,
(CFStringRef) bundleID,
(CFDictionaryRef) request,
response);

// If it failed, try to recover.
if (error != noErr && error != userCanceledErr) {
Expand All @@ -210,10 +212,10 @@ - (OSStatus) helperActualPerform: (NSString *) action withResponse: (CFDictionar
// If the fix went OK, retry the request.
if (error == noErr)
error = BASExecuteRequestInHelperTool(gAuth,
kCPHelperToolCommandSet,
(CFStringRef) bundleID,
(CFDictionaryRef) request,
response);
kCPHelperToolCommandSet,
(CFStringRef) bundleID,
(CFDictionaryRef) request,
response);
}

// If all of the above went OK, it means that the IPC to the helper tool worked. We
Expand Down
2 changes: 1 addition & 1 deletion Source/Apple80211.h
Expand Up @@ -37,7 +37,7 @@
#ifndef __APPLE_80211__
#define __APPLE_80211__

#include <CoreFoundation/CoreFoundation.h>
#import <CoreFoundation/CoreFoundation.h>

/*
A WirelessContext should be created using WirelessAttach
Expand Down
22 changes: 11 additions & 11 deletions Source/CPHelperTool/AuthorizationLib/BetterAuthorizationSampleLib.c
Expand Up @@ -52,27 +52,27 @@
// Helper for easier error logging:
#define AslLogError(errStr) err = asl_log(asl, aslMsg, ASL_LEVEL_ERR, errStr); assert(err == 0);

#include "BetterAuthorizationSampleLib.h"
#import "BetterAuthorizationSampleLib.h"

#include <launch.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/event.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <sys/socket.h>
#import <launch.h>
#import <unistd.h>
#import <fcntl.h>
#import <sys/event.h>
#import <sys/stat.h>
#import <sys/un.h>
#import <sys/socket.h>

// At runtime BAS only requires CoreFoundation. However, at build time we need
// CoreServices for the various OSStatus error codes in "MacErrors.h". Thus, by default,
// we include CoreServices at build time. However, you can flip this switch to check
// that you're not accidentally using any other CoreServices things.

#if 1
#include <CoreServices/CoreServices.h>
#import <CoreServices/CoreServices.h>
#else
#warning Do not ship this way!
#include <CoreFoundation/CoreFoundation.h>
#include "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h"
#import <CoreFoundation/CoreFoundation.h>
#import "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h"
#endif

//////////////////////////////////////////////////////////////////////////////////
Expand Down
Expand Up @@ -47,9 +47,9 @@
#ifndef _BetterAuthorizationSampleLIB_H
#define _BetterAuthorizationSampleLIB_H

#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
#include <asl.h>
#import <CoreFoundation/CoreFoundation.h>
#import <Security/Security.h>
#import <asl.h>

#ifdef __cplusplus
extern "C" {
Expand Down
22 changes: 11 additions & 11 deletions Source/CPHelperTool/BetterAuthorizationSampleLibInstallTool.c
Expand Up @@ -44,22 +44,22 @@
*/

#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdbool.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <sys/stat.h>
#import <errno.h>
#import <stdlib.h>
#import <unistd.h>
#import <fcntl.h>
#import <stdbool.h>
#import <assert.h>
#import <stdio.h>
#import <string.h>
#import <limits.h>
#import <sys/stat.h>

// Allows access to path information associated with tool and plist installation
// from BetterAuthorizationSampleLib.h
#define BAS_PRIVATE 1

#include "AuthorizationLib/BetterAuthorizationSampleLib.h"
#import "AuthorizationLib/BetterAuthorizationSampleLib.h"

extern char **environ;

Expand Down
16 changes: 9 additions & 7 deletions Source/CPHelperTool/CPHelperTool.c
Expand Up @@ -6,14 +6,16 @@
// Copyright 2011. All rights reserved.
//

#include <netinet/in.h>
#include <sys/socket.h>
#include <stdio.h>
#include <unistd.h>
#include <CoreServices/CoreServices.h>
#import <netinet/in.h>
#import <sys/socket.h>
#import <stdio.h>
#import <unistd.h>
#import <CoreServices/CoreServices.h>

#include "AuthorizationLib/BetterAuthorizationSampleLib.h"
#include "CPHelperToolCommon.h"
#import "AuthorizationLib/BetterAuthorizationSampleLib.h"
#import "CPHelperToolCommon.h"

extern const BASCommandSpec kCPHelperToolCommandSet[];


// Implements the GetVersionCommand. Returns the version number of the helper tool.
Expand Down
3 changes: 2 additions & 1 deletion Source/CPHelperTool/CPHelperToolCommon.c
Expand Up @@ -6,7 +6,8 @@
// Copyright 2011. All rights reserved.
//

#include "CPHelperToolCommon.h"
#import "CPHelperToolCommon.h"
#import "BetterAuthorizationSampleLib.h"

const BASCommandSpec kCPHelperToolCommandSet[] = {
{ kCPHelperToolGetVersionCommand, // commandName
Expand Down
4 changes: 0 additions & 4 deletions Source/CPHelperTool/CPHelperToolCommon.h
Expand Up @@ -9,8 +9,6 @@
#ifndef ControlPlane_CPHelperToolCommon_h
#define ControlPlane_CPHelperToolCommon_h

#include "BetterAuthorizationSampleLib.h"

// Helper tool version
#define kCPHelperToolVersionNumber 12

Expand All @@ -27,6 +25,4 @@
#define kCPHelperToolToggleTMRightName "com.dustinrue.ControlPlane.ToggleTM"
#define kCPHelperToolRunBackupTMRightName "com.dustinrue.ControlPlane.RunBackupTM"

extern const BASCommandSpec kCPHelperToolCommandSet[];

#endif
2 changes: 1 addition & 1 deletion Source/DisplayBrightnessAction.m
Expand Up @@ -8,7 +8,7 @@

#import "DisplayBrightnessAction.h"
#import "DSLogger.h"
#include <IOKit/graphics/IOGraphicsLib.h>
#import <IOKit/graphics/IOGraphicsLib.h>

@interface DisplayBrightnessAction (Private)

Expand Down
2 changes: 1 addition & 1 deletion Source/IPEvidenceSource.h
Expand Up @@ -7,7 +7,7 @@
//

#import "EvidenceSource.h"
#include <SystemConfiguration/SystemConfiguration.h>
#import <SystemConfiguration/SystemConfiguration.h>


@interface IPEvidenceSource : EvidenceSource {
Expand Down
4 changes: 2 additions & 2 deletions Source/IPEvidenceSource.m
Expand Up @@ -6,10 +6,10 @@
// Modified by Dustin Rue on 27/08/11.
//

#include <SystemConfiguration/SystemConfiguration.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import "IPEvidenceSource.h"
#import "DSLogger.h"
#include <stdio.h>
#import <stdio.h>


#pragma mark C callbacks
Expand Down
15 changes: 7 additions & 8 deletions Source/LmuTracker/LmuTracker.c
Expand Up @@ -21,14 +21,13 @@
*/


#include "lmu_LmuTracker.h"
#include "LmuTrackerCommon.h"

#include <jni.h>
#include <IOKit/IOKitLib.h>
#include <CoreFoundation/CoreFoundation.h>
#include <string.h>
#include <stdint.h>
#import "lmu_LmuTracker.h"
#import "LmuTrackerCommon.h"
#import <jni.h>
#import <IOKit/IOKitLib.h>
#import <CoreFoundation/CoreFoundation.h>
#import <string.h>
#import <stdint.h>

static io_connect_t dataPort = 0;
static int last_left = 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/MonitorEvidenceSource.m
Expand Up @@ -5,7 +5,7 @@
// Created by David Symonds on 2/07/07.
//

#include <IOKit/graphics/IOGraphicsLib.h>
#import <IOKit/graphics/IOGraphicsLib.h>
#import "MonitorEvidenceSource.h"


Expand Down
2 changes: 1 addition & 1 deletion Source/NetworkLinkEvidenceSource.m
Expand Up @@ -6,7 +6,7 @@
// Tweaks by David Symonds on 25/07/07.
//

#include <SystemConfiguration/SystemConfiguration.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import "NetworkLinkEvidenceSource.h"


Expand Down

0 comments on commit 42e73f3

Please sign in to comment.