<commit_before>/*
 LJKit: an Objective-C implementation of the LiveJournal client protocol
 Copyright (C) 2002-2003  <NAME>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library 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
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 You may contact the author via email at <EMAIL>.
 */

/*
 2004-01-09 [BPR]	Removed proxyURL and setProxyURL:.
 					Added reachability methods.
 					Added account reference.
 */

#import <Foundation/Foundation.h>
#import <CoreServices/CoreServices.h>
#import <SystemConfiguration/SystemConfiguration.h>

#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
#define ENABLE_REACHABILITY_MONITORING
#endif

@class LJAccount;

#ifdef ENABLE_REACHABILITY_MONITORING
/*!
 @const LJServerReachabilityDidChangeNotification
 Posted if the system determines that the reachability of a server has changed.
 Reachability is not monitored by default.  If you want these notifications to
 be posted, you must enable reachability monitoring.
 
 <code>[[myAccount server] enableReachabilityMonitoring];</code>
 
 The notification object is the LJServer instance.  To find the corresponding
 LJAccount instance you will have to query the LJAccounts individually.
 
 The userInfo dictionary contains one key, @"ConnectionFlags" which is paired
 with an NSNumber instance.  This value is a bit field as returned by the
 SystemConfiguration framework.  You can learn more about the flags meanings in
 the SCNetwork header file.
 
 file:///System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetwork.h
 */
FOUNDATION_EXPORT NSString * const LJServerReachabilityDidChangeNotification;
#endif

/*!
 @class LJServer
 @abstract Represents a LiveJournal server.
 @discussion
 This class represents the LiveJournal server on the network.  LJServer does
 all the work of translating messages into HTTP traffic and back.
 */
@interface LJServer : NSObject <NSCoding>

- (instancetype)initWithCoder:(NSCoder *)decoder;
- (void)encodeWithCoder:(NSCoder *)encoder;

/*!
 @property account
 @abstract The account associated with the receiver.
 */
@property (NS_NONATOMIC_IOSONLY, readonly, weak) LJAccount *account;

/*!
 @property URL
 @abstract The URL of host the receiver communicates with.
 @discussion
 The URL must be the base URL of the site, e.g. "http://www.livejournal.com/".
 */
@property (nonatomic, copy) NSURL *URL;

/*!
 @property usingFastServers
 @abstract Determine if fast server access is enabled.
 */
@property (NS_NONATOMIC_IOSONLY, getter=isUsingFastServers, readonly) BOOL usingFastServers;

#ifdef ENABLE_REACHABILITY_MONITORING
/*!
 @method enableReachabilityMonitoring
 @abstract Enables reachability monitoring.
 @discussion
 When monitoring is enabled, LJKit posts 
 LJServerReachabilityDidChangeNotification every time the reachability of the
 server changes for some reason.  You can call getReachability: to determine 
 the reachability of the server.
 Monitoring is only available on Mac OS X 10.3 or later.
 */
- (void)enableReachabilityMonitoring;

/*!
 @method disableReachabilityMonitoring
 @abstract Disables reachability monitoring.
 @discussion
 When monitoring is enabled, LJKit posts 
 LJServerReachabilityDidChangeNotification every time the reachability of the
 server changes for some reason.  You can call getReachability: to determine 
 the reachability of the server.
 Monitoring is only available on Mac OS X 10.3 or later.<commit_msg>Fix an oversight.<commit_after>/*
 LJKit: an Objective-C implementation of the LiveJournal client protocol
 Copyright (C) 2002-2003  <NAME>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library 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
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 You may contact the author via email at <EMAIL>.
 */

/*
 2004-01-09 [BPR]	Removed proxyURL and setProxyURL:.
 					Added reachability methods.
 					Added account reference.
 */

#import <Foundation/Foundation.h>
#import <CoreServices/CoreServices.h>
#import <SystemConfiguration/SystemConfiguration.h>

#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
#define ENABLE_REACHABILITY_MONITORING
#endif

@class LJAccount;

#ifdef ENABLE_REACHABILITY_MONITORING
/*!
 @const LJServerReachabilityDidChangeNotification
 Posted if the system determines that the reachability of a server has changed.
 Reachability is not monitored by default.  If you want these notifications to
 be posted, you must enable reachability monitoring.
 
 <code>[[myAccount server] enableReachabilityMonitoring];</code>
 
 The notification object is the LJServer instance.  To find the corresponding
 LJAccount instance you will have to query the LJAccounts individually.
 
 The userInfo dictionary contains one key, @"ConnectionFlags" which is paired
 with an NSNumber instance.  This value is a bit field as returned by the
 SystemConfiguration framework.  You can learn more about the flags meanings in
 the SCNetwork header file.
 
 file:///System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetwork.h
 */
FOUNDATION_EXPORT NSString * const LJServerReachabilityDidChangeNotification;
#endif

/*!
 @class LJServer
 @abstract Represents a LiveJournal server.
 @discussion
 This class represents the LiveJournal server on the network.  LJServer does
 all the work of translating messages into HTTP traffic and back.
 */
@interface LJServer : NSObject <NSCoding>

- (instancetype)initWithCoder:(NSCoder *)decoder;
- (void)encodeWithCoder:(NSCoder *)encoder;

/*!
 @property account
 @abstract The account associated with the receiver.
 */
@property (NS_NONATOMIC_IOSONLY, readonly, weak) LJAccount *account;

/*!
 @property URL
 @abstract The URL of host the receiver communicates with.
 @discussion
 The URL must be the base URL of the site, e.g. "http://www.livejournal.com/".
 */
@property (nonatomic, copy) NSURL *URL;

/*!
 @property usingFastServers
 @abstract Determine if fast server access is enabled.
 */
@property (NS_NONATOMIC_IOSONLY, getter=isUsingFastServers, readonly) BOOL useFastServers;

#ifdef ENABLE_REACHABILITY_MONITORING
/*!
 @method enableReachabilityMonitoring
 @abstract Enables reachability monitoring.
 @discussion
 When monitoring is enabled, LJKit posts 
 LJServerReachabilityDidChangeNotification every time the reachability of the
 server changes for some reason.  You can call getReachability: to determine 
 the reachability of the server.
 Monitoring is only available on Mac OS X 10.3 or later.
 */
- (void)enableReachabilityMonitoring;

/*!
 @method disableReachabilityMonitoring
 @abstract Disables reachability monitoring.
 @discussion
 When monitoring is enabled, LJKit posts 
 LJServerReachabilityDidChangeNotification every time the reachability of the
 server changes for some reason.  You can call getReachability: to determine 
 the reachability of the server.
 Monitoring is only available on Mac OS X 10.3 or later.
{'fraction_non_alphanumeric': 0.059212166542009476, 'fraction_numerical': 0.010221889803041636, 'mean_word_length': 4.839155749636099, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2908512', 'n_tokens_mistral': 2239, 'n_tokens_neox': 2091, 'n_words': 931}