mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
Make base build again after the previous avahi-patch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30953 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
43339cc05e
commit
ed6b6fa1e7
3 changed files with 508 additions and 3163 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-07-13 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
* Source/NSNetServices.m: Replace with the new version.
|
||||||
|
* Source/GSNetServices.h: Add missing header.
|
||||||
|
Add code missing from the previous patch.
|
||||||
|
|
||||||
2010-03-27 Niels Grewe <niels.grewe@halbordnung.de>
|
2010-03-27 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
|
||||||
* configure.ac: Add check for avahi-client.
|
* configure.ac: Add check for avahi-client.
|
||||||
|
|
139
Source/GSNetServices.h
Normal file
139
Source/GSNetServices.h
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
/* Interface for concrete subclasses of NSNetServices on GNUstep
|
||||||
|
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
Date: March 2010
|
||||||
|
|
||||||
|
This file is part of the GNUstep Base Library.
|
||||||
|
|
||||||
|
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 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
|
||||||
|
Library 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., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02111 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "Foundation/NSNetServices.h"
|
||||||
|
|
||||||
|
// Subclasses using mDNSResponder:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NSNetService using the mDNSResponder API.
|
||||||
|
*/
|
||||||
|
@interface GSMDNSNetService : NSNetService
|
||||||
|
{
|
||||||
|
void *_netService;
|
||||||
|
void *_reserved;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NSNetServiceBrowser using the mDNSResponder API.
|
||||||
|
*/
|
||||||
|
@interface GSMDNSNetServiceBrowser : NSNetServiceBrowser
|
||||||
|
{
|
||||||
|
void *_netServiceBrowser;
|
||||||
|
void *_reserved;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
// Subclasses using Avahi:
|
||||||
|
|
||||||
|
/** Convenience macro to create NSStrings if possible or return nil otherwise */
|
||||||
|
#define NSStringIfNotNull(x) x ? [NSString stringWithUTF8String: x] : nil
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible types of Avahi browsers.
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GSAvahiUnknownBrowser,
|
||||||
|
GSAvahiDomainBrowser,
|
||||||
|
GSAvahiServiceBrowser,
|
||||||
|
GSAvahiBrowserMax
|
||||||
|
} GSAvahiBrowserType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* States of an Avahi service.
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GSNetServiceIdle,
|
||||||
|
GSNetServiceResolving,
|
||||||
|
GSNetServiceResolved,
|
||||||
|
GSNetServiceRecordBrowsing,
|
||||||
|
GSNetServicePublishing,
|
||||||
|
GSNetServicePublished,
|
||||||
|
GSNetServiceStateMax
|
||||||
|
} GSNetServiceState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns a string into an NSString, adding a trailing "." if neccessary.
|
||||||
|
*/
|
||||||
|
NSString* GSNetServiceDotTerminatedNSStringFromString(const char* string);
|
||||||
|
|
||||||
|
@class GSAvahiRunLoopContext, NSTimer, NSLock, NSRecursiveLock, NSMutableDictionary, NSMapTable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NSNetService using the avahi-client API.
|
||||||
|
*/
|
||||||
|
@interface GSAvahiNetService : NSNetService
|
||||||
|
{
|
||||||
|
// GSAvahiClient behaviour ivars:
|
||||||
|
// From superclass: id _delegate;
|
||||||
|
GSAvahiRunLoopContext *ctx;
|
||||||
|
void *_client;
|
||||||
|
NSRecursiveLock *_lock;
|
||||||
|
// Ivars for this class:
|
||||||
|
NSMutableDictionary *_info;
|
||||||
|
NSLock *_infoLock;
|
||||||
|
NSUInteger _infoSeq;
|
||||||
|
GSNetServiceState _serviceState;
|
||||||
|
int _ifIndex;
|
||||||
|
int _protocol;
|
||||||
|
void *_entryGroup;
|
||||||
|
void *_resolver;
|
||||||
|
NSMapTable *_browsers;
|
||||||
|
NSMapTable *_browserTimeouts;
|
||||||
|
NSTimer *_timer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intializer that passes interface index and protocol information
|
||||||
|
* alongside the usual information for a mDNS service. This is used by
|
||||||
|
* GSNetServiceBrowser which already knows about these.
|
||||||
|
*/
|
||||||
|
- (id) initWithDomain: (NSString*)domain
|
||||||
|
type: (NSString*)type
|
||||||
|
name: (NSString*)name
|
||||||
|
avahiIfIndex: (int)anIfIndex
|
||||||
|
avahiProtocol: (int)aProtocol;
|
||||||
|
@end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NSNetServiceBrowser using the avahi-client API.
|
||||||
|
*/
|
||||||
|
@interface GSAvahiNetServiceBrowser: NSNetServiceBrowser
|
||||||
|
{
|
||||||
|
// GSAvahiClient behaviour ivars:
|
||||||
|
// from superclass: id _delegate;
|
||||||
|
GSAvahiRunLoopContext *ctx;
|
||||||
|
void *_client;
|
||||||
|
NSRecursiveLock *_lock;
|
||||||
|
// Ivars for this class:
|
||||||
|
void* _browser;
|
||||||
|
GSAvahiBrowserType _type;
|
||||||
|
BOOL _hasFirstEvent;
|
||||||
|
NSMutableDictionary *_services;
|
||||||
|
}
|
||||||
|
@end
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue