netclasses-1.1.0/0000755000175000001440000000000012510037505013114 5ustar multixusersnetclasses-1.1.0/GNUmakefile.postamble0000644000175000001440000000061112345537311017157 0ustar multixusersafter-clean:: $(MAKE) -C testsuite -f GNUmakefile clean $(MAKE) -C Examples -f GNUmakefile clean $(MAKE) -C Documentation -f GNUmakefile clean after-distclean:: $(MAKE) -C testsuite -f GNUmakefile distclean $(MAKE) -C Examples -f GNUmakefile distclean $(MAKE) -C Documentation -f GNUmakefile distclean rm -fr Source/config.h config.* GNUmakefile Source/GNUmakefile \ autom4te.cache netclasses-1.1.0/Source/0000755000175000001440000000000012510037505014354 5ustar multixusersnetclasses-1.1.0/Source/GNUmakefile.preamble0000644000175000001440000000022712345537310020222 0ustar multixusersADDITIONAL_OBJCFLAGS = -Wall ifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_OBJCFLAGS += -include GNUstep.h ADDITIONAL_INCLUDE_DIRS = -I../Misc endif netclasses-1.1.0/Source/NetTCP.m0000644000175000001440000004651312503215220015632 0ustar multixusers/*************************************************************************** NetTCP.m ------------------- begin : Fri Nov 2 01:19:16 UTC 2001 copyright : (C) 2005 by Andrew Ruder : (C) 2015 The GAP Team email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ /** * NetTCP reference * * * * * Revision 1 * November 8, 2003 * Andrew Ruder */ #include "config.h" #import "NetTCP.h" #import #import #import #import #import #import #import #include #include #include #include #include #include #include #include #include #include #ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif NSString *NetclassesErrorTimeout = @"Connection timed out"; NSString *NetclassesErrorBadAddress = @"Bad address"; NSString *NetclassesErrorAborted = @"Connection aborted"; static TCPSystem *default_system = nil; @interface TCPSystem (InternalTCPSystem) - (int)openPort: (uint16_t)portNumber; - (int)openPort: (uint16_t)portNumber onHost: (NSHost *)aHost; - (int)connectToHost: (NSHost *)aHost onPort: (uint16_t)portNumber withTimeout: (int)timeout inBackground: (BOOL)background; - setErrorString: (NSString *)anError withErrno: (int)aErrno; @end @interface TCPConnecting (InternalTCPConnecting) - initWithNetObject: (id )netObject withTimeout: (int)aTimeout; - connectingFailed: (NSString *)error; - connectingSucceeded; - timeoutReceived: (NSTimer *)aTimer; @end @interface TCPConnectingTransport : NSObject < NetTransport > { BOOL connected; int desc; NSHost *remoteHost; NSHost *localHost; NSMutableData *writeBuffer; TCPConnecting *owner; } - (NSMutableData *)writeBuffer; - (id)initWithDesc: (int)aDesc withRemoteHost: (NSHost *)theAddress withOwner: (TCPConnecting *)anObject; - (void)close; - (NSData *)readData: (int)maxDataSize; - (BOOL)isDoneWriting; - (id )writeData: (NSData *)data; - (NSHost *)remoteHost; - (NSHost *)localHost; - (int)desc; @end @implementation TCPConnectingTransport - (NSMutableData *)writeBuffer { return writeBuffer; } - (id)initWithDesc: (int)aDesc withRemoteHost: (NSHost *)theAddress withOwner: (TCPConnecting *)anObject { struct sockaddr_in x; socklen_t address_length = sizeof(x); if (!(self = [super init])) return nil; desc = aDesc; writeBuffer = [NSMutableData new]; remoteHost = RETAIN(theAddress); owner = anObject; if (getsockname(desc, (struct sockaddr *)&x, &address_length) != 0) { [[TCPSystem sharedInstance] setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; [self release]; return nil; } connected = YES; localHost = RETAIN([[TCPSystem sharedInstance] hostFromNetworkOrderInteger: x.sin_addr.s_addr]); return self; } - (void)dealloc { [self close]; RELEASE(writeBuffer); RELEASE(remoteHost); RELEASE(localHost); [super dealloc]; } - (NSData *)readData: (int)maxDataSize { return nil; } - (BOOL)isDoneWriting { return YES; } - (id )writeData: (NSData *)data { char buffer[1]; if (data) { [writeBuffer appendData: data]; return self; } if (recv(desc, buffer, sizeof(buffer), MSG_PEEK) == -1) { if (errno != EAGAIN) { [owner connectingFailed: [NSString stringWithFormat: @"%s", strerror(errno)]]; return self; } } [owner connectingSucceeded]; return self; } - (NSHost *)remoteHost { return remoteHost; } - (NSHost *)localHost { return localHost; } - (int)desc { return desc; } - (void)close { if (!connected) return; close(desc); connected = NO; } @end @implementation TCPConnecting (InternalTCPConnecting) - initWithNetObject: (id )aNetObject withTimeout: (int)aTimeout { if (!(self = [super init])) return nil; netObject = RETAIN(aNetObject); if (aTimeout > 0) { timeout = RETAIN([NSTimer scheduledTimerWithTimeInterval: (NSTimeInterval)aTimeout target: self selector: @selector(timeoutReceived:) userInfo: nil repeats: NO]); } return self; } - connectingFailed: (NSString *)error { if ([netObject conformsToProtocol: @protocol(TCPConnecting)]) { [netObject connectingFailed: error]; } [timeout invalidate]; [transport close]; [[NetApplication sharedInstance] disconnectObject: self]; return self; } - connectingSucceeded { TCPTransport *newTrans; NSMutableData *buffer; newTrans = [[TCPTransport alloc] initWithDesc: dup([transport desc]) withRemoteHost: [transport remoteHost]]; [newTrans autorelease]; buffer = [(TCPConnectingTransport *)transport writeBuffer]; [buffer retain]; [timeout invalidate]; [[NetApplication sharedInstance] disconnectObject: self]; [netObject connectionEstablished: newTrans]; [newTrans writeData: buffer]; RELEASE(buffer); return self; } - timeoutReceived: (NSTimer *)aTimer { if (aTimer != timeout) { [aTimer invalidate]; } [self connectingFailed: NetclassesErrorTimeout]; return self; } @end @implementation TCPConnecting - (void)dealloc { RELEASE(netObject); RELEASE(timeout); [super dealloc]; } - (id )netObject { return netObject; } - (void)abortConnection { [self connectingFailed: NetclassesErrorAborted]; } - (void)connectionLost { DESTROY(transport); } - connectionEstablished: (id )aTransport { transport = RETAIN(aTransport); [[NetApplication sharedInstance] connectObject: self]; [[NetApplication sharedInstance] transportNeedsToWrite: transport]; if ([netObject conformsToProtocol: @protocol(TCPConnecting)]) { [netObject connectingStarted: self]; } return self; } - (id )dataReceived: (NSData *)data { return self; } - (id )transport { return transport; } @end @implementation TCPSystem (InternalTCPSystem) - (int)openPort: (uint16_t)portNumber { return [self openPort: portNumber onHost: nil]; } - (int)openPort: (uint16_t)portNumber onHost: (NSHost *)aHost { struct sockaddr_in sin; int temp; int myDesc; memset(&sin, 0, sizeof(struct sockaddr_in)); if (!aHost) { sin.sin_addr.s_addr = htonl(INADDR_ANY); } else { if (inet_aton([[aHost address] cString], (struct in_addr *)(&(sin.sin_addr))) == 0) { [self setErrorString: NetclassesErrorBadAddress withErrno: 0]; return -1; } } sin.sin_port = htons(portNumber); sin.sin_family = AF_INET; if ((myDesc = socket(AF_INET, SOCK_STREAM, 0)) == -1) { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; return -1; } temp = 1; if (setsockopt(myDesc, SOL_SOCKET, SO_REUSEADDR, &temp, sizeof(temp)) == -1) { close(myDesc); [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; return -1; } if (bind(myDesc, (struct sockaddr *) &sin, sizeof(struct sockaddr)) < 0) { close(myDesc); [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; return -1; } temp = 1; if (setsockopt(myDesc, SOL_SOCKET, SO_KEEPALIVE, &temp, sizeof(temp)) == -1) { close(myDesc); [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; return -1; } if (listen(myDesc, 5) == -1) { close(myDesc); [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; return -1; } return myDesc; } - (int)connectToHost: (NSHost *)host onPort: (uint16_t)portNumber withTimeout: (int)timeout inBackground: (BOOL)bck { int myDesc; struct sockaddr_in destAddr; if (!host) { [self setErrorString: NetclassesErrorBadAddress withErrno: 0]; return -1; } if ((myDesc = socket(AF_INET, SOCK_STREAM, 0)) == -1) { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; return -1; } destAddr.sin_family = AF_INET; destAddr.sin_port = htons(portNumber); if (!(inet_aton([[host address] cString], (struct in_addr *)(&destAddr.sin_addr)))) { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; close(myDesc); return -1; } memset(&(destAddr.sin_zero), 0, sizeof(destAddr.sin_zero)); if (timeout > 0 || bck) { if (fcntl(myDesc, F_SETFL, O_NONBLOCK) == -1) { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; close(myDesc); return -1; } } if (connect(myDesc, (struct sockaddr *)&destAddr, sizeof(destAddr)) == -1) { if (errno == EINPROGRESS) // Need to work with timeout now. { fd_set fdset; struct timeval selectTime; int selectReturn; if (bck) { return myDesc; } FD_ZERO(&fdset); FD_SET(myDesc, &fdset); selectTime.tv_sec = timeout; selectTime.tv_usec = 0; selectReturn = select(myDesc + 1, 0, &fdset, 0, &selectTime); if (selectReturn == -1) { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; close(myDesc); return -1; } if (selectReturn > 0) { char buffer[1]; if (recv(myDesc, buffer, sizeof(buffer), MSG_PEEK) == -1) { if (errno != EAGAIN) { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; close(myDesc); return -1; } } } else { [self setErrorString: NetclassesErrorTimeout withErrno: 0]; close(myDesc); return -1; } } else // connect failed with something other than EINPROGRESS { [self setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; close(myDesc); return -1; } } return myDesc; } - setErrorString: (NSString *)anError withErrno: (int)aErrno { errorNumber = aErrno; if (anError == errorString) return self; RELEASE(errorString); errorString = RETAIN(anError); return self; } @end @implementation TCPSystem + sharedInstance { return (default_system) ? default_system : [[self alloc] init]; } - init { if (!(self = [super init])) return nil; if (default_system) { [self release]; return nil; } default_system = RETAIN(self); return self; } - (NSString *)errorString { return errorString; } - (int)errorNumber { return errorNumber; } - (id )connectNetObject: (id )netObject toHost: (NSHost *)aHost onPort: (uint16_t)aPort withTimeout: (int)aTimeout { int desc; id transport; desc = [self connectToHost: aHost onPort: aPort withTimeout: aTimeout inBackground: NO]; if (desc < 0) { return nil; } transport = AUTORELEASE([[TCPTransport alloc] initWithDesc: desc withRemoteHost: aHost]); if (!(transport)) { close(desc); return nil; } [netObject connectionEstablished: transport]; return netObject; } - (TCPConnecting *)connectNetObjectInBackground: (id )netObject toHost: (NSHost *)aHost onPort: (uint16_t)aPort withTimeout: (int)aTimeout { int desc; id transport; id object; desc = [self connectToHost: aHost onPort: aPort withTimeout: 0 inBackground: YES]; if (desc < 0) { return nil; } object = AUTORELEASE([[TCPConnecting alloc] initWithNetObject: netObject withTimeout: aTimeout]); transport = AUTORELEASE([[TCPConnectingTransport alloc] initWithDesc: desc withRemoteHost: aHost withOwner: object]); if (!transport) { close(desc); return nil; } [object connectionEstablished: transport]; return object; } - (BOOL)hostOrderInteger: (uint32_t *)aNumber fromHost: (NSHost *)aHost { struct in_addr addr; if (!aHost) return NO; if (![aHost address]) return NO; if (inet_aton([[aHost address] cString], &addr) != 0) { if (aNumber) { *aNumber = ntohl(addr.s_addr); return YES; } } return NO; } - (BOOL)networkOrderInteger: (uint32_t *)aNumber fromHost: (NSHost *)aHost { struct in_addr addr; if (!aHost) return NO; if (![aHost address]) return NO; if (inet_aton([[aHost address] cString], &addr) != 0) { if (aNumber) { *aNumber = addr.s_addr; return YES; } } return NO; } - (NSHost *)hostFromNetworkOrderInteger: (uint32_t)ip { struct in_addr addr; char *temp; addr.s_addr = ip; temp = inet_ntoa(addr); if (temp) { return [NSHost hostWithAddress: [NSString stringWithCString: temp]]; } return nil; } - (NSHost *)hostFromHostOrderInteger: (uint32_t)ip { struct in_addr addr; char *temp; addr.s_addr = htonl(ip); temp = inet_ntoa(addr); if (temp) { return [NSHost hostWithAddress: [NSString stringWithCString: temp]]; } return nil; } @end @implementation TCPPort - initOnHost: (NSHost *)aHost onPort: (uint16_t)aPort { struct sockaddr_in x; socklen_t address_length = sizeof(x); if (!(self = [super init])) return nil; desc = [[TCPSystem sharedInstance] openPort: aPort onHost: aHost]; if (desc < 0) { [self release]; return nil; } if (getsockname(desc, (struct sockaddr *)&x, &address_length) != 0) { [[TCPSystem sharedInstance] setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; close(desc); [self release]; return nil; } connected = YES; port = ntohs(x.sin_port); [[NetApplication sharedInstance] connectObject: self]; return self; } - initOnPort: (uint16_t)aPort { return [self initOnHost: nil onPort: aPort]; } - setNetObject: (Class)aClass { if (![aClass conformsToProtocol: @protocol(NetObject)]) { [NSException raise: FatalNetException format: @"%@ does not conform to < NetObject >", NSStringFromClass(aClass)]; } netObjectClass = aClass; return self; } - (int)desc { return desc; } - (void)close { if (!connected) return; close(desc); connected = NO; } - (void)connectionLost { } - (id )newConnection { int newDesc; struct sockaddr_in sin; unsigned temp; TCPTransport *transport; NSHost *newAddress; temp = sizeof(struct sockaddr_in); if ((newDesc = accept(desc, (struct sockaddr *)&sin, &temp)) == -1) { [NSException raise: FatalNetException format: @"%s", strerror(errno)]; } newAddress = [[TCPSystem sharedInstance] hostFromNetworkOrderInteger: sin.sin_addr.s_addr]; transport = AUTORELEASE([[TCPTransport alloc] initWithDesc: newDesc withRemoteHost: newAddress]); if (!transport) { close(newDesc); return self; } [AUTORELEASE([netObjectClass new]) connectionEstablished: transport]; return self; } - (uint16_t)port { return port; } - (void)dealloc { [self close]; [super dealloc]; } @end static NetApplication *net_app = nil; @implementation TCPTransport + (void)initialize { net_app = RETAIN([NetApplication sharedInstance]); } - (id)initWithDesc: (int)aDesc withRemoteHost: (NSHost *)theAddress { struct sockaddr_in x; socklen_t address_length = sizeof(x); if (!(self = [super init])) return nil; desc = aDesc; writeBuffer = RETAIN([NSMutableData dataWithCapacity: 2000]); remoteHost = RETAIN(theAddress); if (getsockname(desc, (struct sockaddr *)&x, &address_length) != 0) { [[TCPSystem sharedInstance] setErrorString: [NSString stringWithFormat: @"%s", strerror(errno)] withErrno: errno]; [self release]; return nil; } localHost = RETAIN([[TCPSystem sharedInstance] hostFromNetworkOrderInteger: x.sin_addr.s_addr]); connected = YES; return self; } - (void)dealloc { [self close]; RELEASE(writeBuffer); RELEASE(localHost); RELEASE(remoteHost); [super dealloc]; } #define READ_BLOCK_SIZE 65530 - (NSData *)readData: (int)maxDataSize { char *buffer; int readReturn; NSMutableData *data; int remaining; int bufsize; fd_set readSet; int toRead; int loops = 8; struct timeval zeroTime = { 0, 0 }; if (!connected) { [NSException raise: FatalNetException format: @"Not connected"]; } if (maxDataSize <= 0) { remaining = -1; bufsize = READ_BLOCK_SIZE; } else { remaining = maxDataSize; bufsize = (READ_BLOCK_SIZE < remaining ? READ_BLOCK_SIZE : remaining); } buffer = malloc(bufsize); if (!buffer) { [NSException raise: NSMallocException format: @"%s", strerror(errno)]; } data = [NSMutableData dataWithCapacity: bufsize]; do { if (remaining == -1) { toRead = bufsize; } else { toRead = bufsize < remaining ? bufsize : remaining; } readReturn = read(desc, buffer, toRead); if (readReturn == 0) { id except; free(buffer); except = [NSException exceptionWithName: NetException reason: @"Socket closed" userInfo: [NSDictionary dictionaryWithObjectsAndKeys: data, @"Data", nil]]; [except raise]; } if (readReturn == -1) { id except; free(buffer); except = [NSException exceptionWithName: NetException reason: [NSString stringWithCString: strerror(errno)] userInfo: [NSDictionary dictionaryWithObjectsAndKeys: data, @"Data", nil]]; [except raise]; } [data appendBytes: buffer length: readReturn]; if (readReturn < bufsize) { break; } if (remaining != -1) { remaining -= readReturn; if (remaining == 0) { break; } } FD_ZERO(&readSet); FD_SET(desc, &readSet); select(desc + 1, &readSet, NULL, NULL, &zeroTime); --loops; } while (loops && FD_ISSET(desc, &readSet)); free(buffer); return data; } #undef READ_BLOCK_SIZE - (BOOL)isDoneWriting { if (!connected) { [NSException raise: FatalNetException format: @"Not connected"]; } return ([writeBuffer length]) ? NO : YES; } - (id )writeData: (NSData *)aData { int writeReturn; char *bytes; int length; if (aData) { if ([aData length] == 0) { return self; } if ([writeBuffer length] == 0) { [net_app transportNeedsToWrite: self]; } [writeBuffer appendData: aData]; return self; } if (!connected) { [NSException raise: FatalNetException format: @"Not connected"]; } if ([writeBuffer length] == 0) { return self; } writeReturn = write(desc, [writeBuffer mutableBytes], [writeBuffer length]); if (writeReturn == -1) { [NSException raise: FatalNetException format: @"%s", strerror(errno)]; } if (writeReturn == 0) { return self; } bytes = (char *)[writeBuffer mutableBytes]; length = [writeBuffer length] - writeReturn; memmove(bytes, bytes + writeReturn, length); [writeBuffer setLength: length]; return self; } - (id)localHost { return localHost; } - (id)remoteHost { return remoteHost; } - (int)desc { return desc; } - (void)close { if (!connected) return; connected = NO; close(desc); } @end netclasses-1.1.0/Source/config.h.in0000644000175000001440000000266312345537310016413 0ustar multixusers/* Source/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if the system has the type `socklen_t'. */ #undef HAVE_SOCKLEN_T /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS netclasses-1.1.0/Source/LineObject.h0000644000175000001440000000455312345537310016557 0ustar multixusers/*************************************************************************** LineObject.h ------------------- begin : Thu May 30 02:19:30 UTC 2002 copyright : (C) 2005 by Andrew Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ @class LineObject; #ifndef LINE_OBJECT_H #define LINE_OBJECT_H #import "NetBase.h" #import @class NSMutableData, NSData; /** * LineObject is used for line-buffered connections (end in \r\n or just \n). * To use, simply override lineReceived: in a subclass of LineObject. By * default, LineObject does absolutely nothing with lineReceived except throw * the line away. Use line object if you simply want line-buffered input. * This can be used on IRC, telnet, etc. */ @interface LineObject : NSObject < NetObject > { id transport; NSMutableData *_readData; } /** * Cleans up the instance variables and releases the transport. * If/when the transport is dealloc'd, the connection will be closed. */ - (void)connectionLost; /** * Initializes data and retains aTransport * aTransport should conform to the [(NetTransport)] * protocol. */ - connectionEstablished: (id )aTransport; /** * Adds the data to a buffer. Then calls -lineReceived: for all * full lines currently in the buffer. Don't override this, override * -lineReceived:. */ - dataReceived: (NSData *)newData; /** * Returns the transport */ - (id )transport; /** * * aLine contains a full line of text (without the ending newline) */ - lineReceived: (NSData *)aLine; @end #endif netclasses-1.1.0/Source/IRCObject.h0000644000175000001440000013600312345537310016301 0ustar multixusers/*************************************************************************** IRCObject.h ------------------- begin : Thu May 30 22:06:25 UTC 2002 copyright : (C) 2005 by Andrew Ruder : (C) 2013 The GNUstep Application Project email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ @class IRCObject, DCCObject, DCCReceiveObject, DCCSendObject; #ifndef IRC_OBJECT_H #define IRC_OBJECT_H #import "LineObject.h" #import "NetTCP.h" #import extern NSString *IRCException; /** * Additions of NSString that are used to upper/lower case strings taking * into account that on many servers {}|^ are lowercase forms of []\~. * Try not to depend on this fact, some servers nowadays are drifting away * from this idea and will treat them as different characters entirely. */ @interface NSString (IRCAddition) /** * Returns an uppercased string (and converts any of {}|^ characters found * to []\~ respectively). */ - (NSString *)uppercaseIRCString; /** * Returns a lowercased string (and converts any of []\~ characters found * to {}|^ respectively). */ - (NSString *)lowercaseIRCString; /** * Returns a uppercased string (and converts any of {}| characters found * to []\ respectively). The original RFC 1459 forgot to include these * and thus this method is included. */ - (NSString *)uppercaseStrictRFC1459IRCString; /** * Returns a lowercased string (and converts any of []\ characters found * to {}| respectively). The original RFC 1459 forgot to include these * and thus this method is included. */ - (NSString *)lowercaseStrictRFC1459IRCString; @end /* When one of the callbacks ends with from: (NSString *), that last * argument is where the callback originated from. It is usually in a slightly * different format: nick!host. So if you want the nick you use * ExtractIRCNick, if you want the host you use ExtractIRCHost, and if you * want both, you can use SeparateIRCNickAndHost(which stores nick then host * in that order) * * If, for example, the message originates from a server, it will not be in * this format, in this case, ExtractIRCNick will return the original string * and ExtractIRCHost will return nil, and SeparateIRCNickAndHost will return * an array with just one object. * * So, if you are using a callback, and the last argument has a from: before * it, odds are you may want to look into using these functions. */ /** * Returns the nickname portion of a prefix. On any argument after * from: in the class reference, the name could be in the format of * nickname!host. Will always return a valid string. */ NSString *ExtractIRCNick(NSString *prefix); /** * Returns the host portion of a prefix. On any argument after * from: in the class reference, the name could be in the format * nickname!host. Returns nil if the prefix is not in the correct * format. */ NSString *ExtractIRCHost(NSString *prefix); /** * Returns an array of the nickname/host of a prefix. In the case that * the array has only one object, it will be the nickname. In the case that * it has two, it will be [nickname, host]. The object will always be at * least one object long and never more than two. */ NSArray *SeparateIRCNickAndHost(NSString *prefix); /** *

* IRCObject handles all aspects of an IRC connection. In almost all * cases, you will want to override this class and implement just the * callback methods specified in [IRCObject(Callbacks)] to handle * everything. *

*

* A lot of arguments may not contain spaces. The general procedure on * processing these arguments is that the method will cut the string * off at the first space and use the part of the string before the space * and fail only if that string is still invalid. Try to avoid * passing strings with spaces as the arguments to the methods * that warn not to. *

*/ @interface IRCObject : LineObject { NSString *nick; BOOL connected; NSString *userName; NSString *realName; NSString *password; NSString *errorString; NSStringEncoding defaultEncoding; NSMapTable *targetToEncoding; NSMutableDictionary *targetToOriginalTarget; SEL lowercasingSelector; } /** * * Initializes the IRCObject and retains the arguments for the next connection. * Uses -setNick:, -setUserName:, -setRealName:, and -setPassword: to save the * arguments. */ - initWithNickname: (NSString *)aNickname withUserName: (NSString *)aUser withRealName: (NSString *)aRealName withPassword: (NSString *)aPassword; /** * Set the lowercasing selector. This is the selector that is called * on a NSString to get the lowercase form. Used to determine if two * nicknames are equivalent. Generally aSelector would be * either @selector(lowercaseString) or @selector(lowercaseIRCString). * By default, this is lowercaseIRCString but will be autodetected * from the server if possible. It will be reset to lowercaseIRCString * upon reconnection. */ - setLowercasingSelector: (SEL)aSelector; /** * Return the lowercasing selector. See -setLowercasingSelector: for * more information on the use of this lowercasing selector. */ - (SEL)lowercasingSelector; /** * Use the lowercasingSelector to compare two strings. Returns a * NSComparisonResult ( NSOrderedAscending, NSOrderedSame or * NSOrderedDescending ) */ - (NSComparisonResult)caseInsensitiveCompare: (NSString *)aString1 to: (NSString *)aString2; /** * Sets the nickname that this object will attempt to use upon a connection. * Do not use this to change the nickname once the object is connected, this * is only used when it is actually connecting. This method returns nil if * aNickname is invalid and will set the error string accordingly. * aNickname is invalid if it contains a space or is zero-length. */ - setNick: (NSString *)aNickname; /** * Returns the nickname that this object will use on connecting next time. */ - (NSString *)nick; /** * Sets the user name that this object will give to the server upon the * next connection. If aUser is invalid, it will use the user name * of "netclasses". aUser should not contain spaces. * This method will always succeed. */ - setUserName: (NSString *)aUser; /** * Returns the user name that will be used upon the next connection. */ - (NSString *)userName; /** * Sets the real name that will be passed to the IRC server on the next * connection. If aRealName is nil or zero-length, the name * "John Doe" shall be used. This method will always succeed. */ - setRealName: (NSString *)aRealName; /** * Returns the real name that will be used upon the next connection. */ - (NSString *)realName; /** * Sets the password that will be used upon connecting to the IRC server. * aPass can be nil or zero-length, in which case no password * shall be used. aPass may not contain a space. Will return * nil and set the error string if this fails. */ - setPassword: (NSString *)aPass; /** * Returns the password that will be used upon the next connection to a * IRC server. */ - (NSString *)password; /** * Returns a string that describes the last error that happened. */ - (NSString *)errorString; /** * Returns YES when the IRC object is fully connected and registered with * the IRC server. Returns NO if the connection has not made or this * connection has not fully registered with the server. */ - (BOOL)connected; /** * Sets the encoding that will be used for incoming as well as outgoing * messages. aEncoding should be an 8-bit encoding for a typical * IRC server. Uses the system default by default. */ - setEncoding: (NSStringEncoding)aEncoding; /** * Sets the encoding that will be used for incoming as well as outgoing * messages to a specific target. aEncoding should be an 8-bit * encoding for a typical IRC server. Uses the encoding set with * setEncoding: by default. */ - setEncoding: (NSStringEncoding)aEncoding forTarget: (NSString *)aTarget; /** * Returns the encoding currently being used by the connection. */ - (NSStringEncoding)encoding; /** * Return the encoding for aTarget. */ - (NSStringEncoding)encodingForTarget: (NSString *)aTarget; /** * Remove the encoding for aTarget. */ - (void)removeEncodingForTarget: (NSString *)aTarget; /** * Return all targets with a specific encoding. */ - (NSArray *)targetsWithEncodings; // IRC Operations /** * Sets the nickname to the aNick. This method is quite similar * to -setNick: but this will also actually send the nick change request to * the server if connected, and will only affect the nickname stored by the * object (which is returned with -nick) if the the name change was successful * or the object is not yet registered/connected. Please see RFC 1459 for * more information on the NICK command. */ - (id)changeNick: (NSString *)aNick; /** * Quits IRC with an optional message. aMessage can have * spaces. If aMessage is nil or zero-length, the server * will often provide its own message. Please see RFC 1459 for more * information on the QUIT command. */ - (id)quitWithMessage: (NSString *)aMessage; /** * Leaves the channel aChannel with the optional message * aMessage. aMessage may contain spaces, and * aChannel may not. aChannel may also be a * comma separated list of channels. Please see RFC 1459 for more * information on the PART command. */ - (id)partChannel: (NSString *)aChannel withMessage: (NSString *)aMessage; /** * Joins the channel aChannel with an optional password of * aPassword. Neither may contain spaces, and both may be * comma separated for multiple channels/passwords. If there is one * or more passwords, it should match the number of channels specified * by aChannel. Please see RFC 1459 for more information on * the JOIN command. */ - (id)joinChannel: (NSString *)aChannel withPassword: (NSString *)aPassword; /** * Sends a CTCP aCTCP reply to aPerson with the * argument args. args may contain spaces and is * optional while the rest may not. This method should be used to * respond to a CTCP message sent by another client. See * -sendCTCPRequest:withArgument:to: */ - (id)sendCTCPReply: (NSString *)aCTCP withArgument: (NSString *)args to: (NSString *)aPerson; /** * Sends a CTCP aCTCP request to aPerson with an * optional argument args. args may contain a space * while the rest may not. This should be used to request CTCP information * from another client and never for responding. See * -sendCTCPReply:withArgument:to: */ - (id)sendCTCPRequest: (NSString *)aCTCP withArgument: (NSString *)args to: (NSString *)aPerson; /** * Sends a message aMessage to aReceiver. * aReceiver may be a nickname or a channel name. * aMessage may contain spaces. This is used to carry * out the basic communication over IRC. Please see RFC 1459 for more * information on the PRIVMSG message. */ - (id)sendMessage: (NSString *)aMessage to: (NSString *)aReceiver; /** * Sends a notice aNotice to aReceiver. * aReceiver may not contain a space. This is generally * not used except for system messages and should rarely be used by * a regular client. Please see RFC 1459 for more information on the * NOTICE command. */ - (id)sendNotice: (NSString *)aNotice to: (NSString *)aReceiver; /** * Sends an action anAction to the receiver aReceiver. * This is similar to a message but will often be displayed such as:

* <nick> <anAction>

and can be used effectively to display things * that you are doing rather than saying. anAction * may contain spaces. */ - (id)sendAction: (NSString *)anAction to: (NSString *)aReceiver; /** * This method attempts to become an IRC operator with name aName * and password aPassword. Neither may contain spaces. This is * a totally different concept than channel operators since it refers to * operators of the server as a whole. Please see RFC 1459 for more information * on the OPER command. */ - (id)becomeOperatorWithName: (NSString *)aName withPassword: (NSString *)aPassword; /** * Requests the names on a channel aChannel. If aChannel * is not specified, all users in all channels will be returned. The information * will be returned via a RPL_NAMREPLY numeric message. See the * RFC 1459 for more information on the NAMES command. */ - (id)requestNamesOnChannel: (NSString *)aChannel; /** * Requests the Message-Of-The-Day from server aServer. aServer * is optional and may not contain spaces if present. The message of the day * is returned through the RPL_MOTD numeric command. */ - (id)requestMOTDOnServer: (NSString *)aServer; /** * Requests size information from an optional aServer and * optionally forwards it to anotherServer. See RFC 1459 for * more information on the LUSERS command */ - (id)requestSizeInformationFromServer: (NSString *)aServer andForwardTo: (NSString *)anotherServer; /** * Queries the version of optional aServer. Please see * RFC 1459 for more information on the VERSION command. */ - (id)requestVersionOfServer: (NSString *)aServer; /** * Returns a series of statistics from aServer. Specific * queries can be made with the optional query argument. * Neither may contain spaces and both are optional. See RFC 1459 for * more information on the STATS message */ - (id)requestServerStats: (NSString *)aServer for: (NSString *)query; /** * Used to list servers connected to optional aServer with * an optional mask aLink. Neither may contain spaces. * See the RFC 1459 for more information on the LINKS command. */ - (id)requestServerLink: (NSString *)aLink from: (NSString *)aServer; /** * Requests the local time from the optional server aServer. * aServer may not contain spaces. See RFC 1459 for more * information on the TIME command. */ - (id)requestTimeOnServer: (NSString *)aServer; /** * Requests that aServer connects to connectServer on * port aPort. aServer and aPort are optional * and none may contain spaces. See RFC 1459 for more information on the * CONNECT command. */ - (id)requestServerToConnect: (NSString *)aServer to: (NSString *)connectServer onPort: (NSString *)aPort; /** * This message will request the route to a specific server from a client. * aServer is optional and may not contain spaces; please see * RFC 1459 for more information on the TRACE command. */ - (id)requestTraceOnServer: (NSString *)aServer; /** * Request the name of the administrator on the optional server * aServer. aServer may not contain spaces. Please * see RFC 1459 for more information on the ADMIN command. */ - (id)requestAdministratorOnServer: (NSString *)aServer; /** * Requests information on a server aServer. aServer * is optional and may not contain spaces. Please see RFC 1459 for more * information on the INFO command. */ - (id)requestInfoOnServer: (NSString *)aServer; /** * Used to request that the current server reread its configuration files. * Please see RFC 1459 for more information on the REHASH command. */ - (id)requestServerRehash; /** * Used to request a shutdown of a server. Please see RFC 1459 for additional * information on the DIE command. */ - (id)requestServerShutdown; /** * Requests a restart of a server. Please see RFC 1459 for additional * information on the RESTART command. */ - (id)requestServerRestart; /** * Requests a list of users logged into aServer. * aServer is optional and may contain spaces. Please see * RFC 1459 for additional information on the USERS message. */ - (id)requestUserInfoOnServer: (NSString *)aServer; /** * Requests information on the precense of certain nicknames listed in * userList on the network. userList is a space * separated list of users. For each user that is present, its name will * be added to the reply through the numeric message RPL_ISON. * See RFC 1459 for more information on the ISON message. */ - (id)areUsersOn: (NSString *)userList; /** * Sends a message to all operators currently online. The actual implementation * may vary from server to server in regards to who can send and receive it. * aMessage is the message to be sent and may contain spaces. * Please see RFC 1459 for more information regarding the WALLOPS command. */ - (id)sendWallops: (NSString *)aMessage; /** * Requests a list of users with a matching mask aMask against * their username and/or host. This can optionally be done just against * the IRC operators. The mask aMask is optional and may not * contain spaces. Please see RFC 1459 for more information regarding the * WHO message. */ - (id)listWho: (NSString *)aMask onlyOperators: (BOOL)operators; /** * Requests information on a user aPerson. aPerson * may also be a comma separated list for additional users. aServer * is optional and neither argument may contain spaces. Refer to RFC 1459 for * additional information on the WHOIS command. */ - (id)whois: (NSString *)aPerson onServer: (NSString *)aServer; /** * Requests information on a user aPerson that is no longer * connected to the server aServer. A possible maximum number * of entries aNumber may be displayed. All arguments may not * contain spaces and aServer and aNumber are optional. * Please refer to RFC 1459 for more information regarding the WHOWAS message. */ - (id)whowas: (NSString *)aPerson onServer: (NSString *)aServer withNumberEntries: (NSString *)aNumber; /** * Used to kill the connection to aPerson with a possible comment * aComment. This is often used by servers when duplicate nicknames * are found and may be available to the IRC operators. aComment * is optional and aPerson may not contain spaces. Please see * RFC 1459 for additional information on the KILL command. */ - (id)kill: (NSString *)aPerson withComment: (NSString *)aComment; /** * Sets the topic for channel aChannel to aTopic. * If the aTopic is omitted, the topic for aChannel * will be returned through the RPL_TOPIC numeric message. * aChannel may not contain spaces. Please refer to the * TOPIC command in RFC 1459 for more information. */ - (id)setTopicForChannel: (NSString *)aChannel to: (NSString *)aTopic; /** * Used to query or set the mode on anObject to the mode specified * by aMode. Flags can be added by adding a '+' to the aMode * string or removed by adding a '-' to the aMode string. These flags * may optionally have arguments specified in aList and may be applied * to the object specified by anObject. Examples: * * aMode: @"+i" anObject: @"#gnustep" withParams: nil * sets the channel "#gnustep" to invite only. * aMode: @"+o" anObject: @"#gnustep" withParams: (@"aeruder") * makes aeruder a channel operator of #gnustep * * Many servers have differing implementations of these modes and may have various * modes available to users. None of the arguments may contain spaces. Please * refer to RFC 1459 for additional information on the MODE message. */ - (id)setMode: (NSString *)aMode on: (NSString *)anObject withParams: (NSArray *)aList; /** * Lists channel information about the channel specified by aChannel * on the server aServer. aChannel may be a comma separated * list and may not contain spaces. aServer is optional. If aChannel * is omitted, then all channels on the server will be listed. Please refer * to RFC 1459 for additional information on the LIST command. */ - (id)listChannel: (NSString *)aChannel onServer: (NSString *)aServer; /** * This message will invite aPerson to the channel specified by * aChannel. Neither may contain spaces and both are required. * Please refer to RFC 1459 concerning the INVITE command for additional * information. */ - (id)invite: (NSString *)aPerson to: (NSString *)aChannel; /** * Kicks the user aPerson off of the channel aChannel * for the reason specified in aReason. aReason may * contain spaces and is optional. If omitted the server will most likely * supply a default message. aPerson and aChannel * are required and may not contain spaces. Please see the KICK command for * additional information in RFC 1459. */ - (id)kick: (NSString *)aPerson offOf: (NSString *)aChannel for: (NSString *)aReason; /** * Sets status to away with the message aMessage. While away, if * a user should send you a message, aMessage will be returned to * them to explain your absence. aMessage may contain spaces. If * omitted, the user is marked as being present. Please refer to the AWAY * command in RFC 1459 for additional information. */ - (id)setAwayWithMessage: (NSString *)aMessage; /** * Requests a PONG message from the server. The argument aString * is essential but may contain spaces. The server will respond immediately * with a PONG message with the same argument. This commnd is rarely needed * by a client, but is sent out often by servers to ensure connectivity of * clients. Please see RFC 1459 for more information on the PING command. */ - (id)sendPingWithArgument: (NSString *)aString; /** * Used to respond to a PING message. The argument sent with the PING message * should be the argument specified by aString. aString * is required and may contain spaces. See RFC 1459 for more informtion * regarding the PONG command. */ - (id)sendPongWithArgument: (NSString *)aString; @end /** * This category represents all the callback methods in IRCObject. You can * override these with a subclass. All of them do not do anything especially * important by default, so feel free to not call the default implementation. * * On any method ending with an argument like 'from: (NSString *)aString', * aString could be in the format of nickname!host. Please see * the documentation for ExtractIRCNick(), ExtractIRCHost(), and * SeparateIRCNickAndHost() for more information. */ @interface IRCObject (Callbacks) /** * This method will be called when the connection is fully registered with * the server. At this point it is safe to start joining channels and carrying * out other typical IRC functions. */ - (id)registeredWithServer; /** * This method will be called if a connection cannot register for whatever reason. * This reason will be outlined in aReason, but the best way to track * the reason is to watch the numeric commands being received in the * -numericCommandReceived:withParams:from: method. */ - (id)couldNotRegister: (NSString *)aReason; /** * Called when a CTCP request has been received. The CTCP request type is * stored in aCTCP(could be such things as DCC, PING, VERSION, etc.) * and the argument is stored in anArgument. The actual location * that the CTCP request is sent is stored in aReceiver and the * person who sent it is stored in aPerson. */ - (id)CTCPRequestReceived: (NSString *)aCTCP withArgument: (NSString *)anArgument to: (NSString *)aReceiver from: (NSString *)aPerson; /** * Called when a CTCP reply has been received. The CTCP reply type is * stored in aCTCP with its argument in anArgument. * The actual location that the CTCP reply was sent is stored in aReceiver * and the person who sent it is stored in aPerson. */ - (id)CTCPReplyReceived: (NSString *)aCTCP withArgument: (NSString *)anArgument to: (NSString *)aReceiver from: (NSString *)aPerson; /** * Called when an IRC error has occurred. This is a message sent by the server * and its argument is stored in anError. Typically you will be * disconnected after receiving one of these. */ - (id)errorReceived: (NSString *)anError; /** * Called when a Wallops has been received. The message is stored in * aMessage and the person who sent it is stored in * aSender. */ - (id)wallopsReceived: (NSString *)aMessage from: (NSString *)aSender; /** * Called when a user has been kicked out of a channel. The person's nickname * is stored in aPerson and the channel he/she was kicked out of is * in aChannel. aReason is the kicker-supplied reason for * the removal. aKicker is the person who did the kicking. This will * not be accompanied by a -channelParted:withMessage:from: message, so it is safe * to assume they are no longer part of the channel after receiving this method. */ - (id)userKicked: (NSString *)aPerson outOf: (NSString *)aChannel for: (NSString *)aReason from: (NSString *)aKicker; /** * Called when the client has been invited to another channel aChannel * by anInviter. */ - (id)invitedTo: (NSString *)aChannel from: (NSString *)anInviter; /** * Called when the mode has been changed on anObject. The actual * mode change is stored in aMode and the parameters are stored in * paramList. The person who changed the mode is stored in * aPerson. Consult RFC 1459 for further information. */ - (id)modeChanged: (NSString *)aMode on: (NSString *)anObject withParams: (NSArray *)paramList from: (NSString *)aPerson; /** * Called when a numeric command has been received. These are 3 digit numerical * messages stored in aCommand with a number of parameters stored * in paramList. The sender, almost always the server, is stored * in aSender. These are often used for replies to requests such * as user lists and channel lists and other times they are used for errors. */ - (id)numericCommandReceived: (NSString *)aCommand withParams: (NSArray *)paramList from: (NSString *)aSender; /** * Called when someone changes his/her nickname. The new nickname is stored in * newName and the old name will be stored in aPerson. */ - (id)nickChangedTo: (NSString *)newName from: (NSString *)aPerson; /** * Called when someone joins a channel. The channel is stored in aChannel * and the person who joined is stored in aJoiner. */ - (id)channelJoined: (NSString *)aChannel from: (NSString *)aJoiner; /** * Called when someone leaves a channel. The channel is stored in aChannel * and the person who left is stored in aParter. The parting message will * be stored in aMessage. */ - (id)channelParted: (NSString *)aChannel withMessage: (NSString *)aMessage from: (NSString *)aParter; /** * Called when someone quits IRC. Their parting message will be stored in * aMessage and the person who quit will be stored in * aQuitter. */ - (id)quitIRCWithMessage: (NSString *)aMessage from: (NSString *)aQuitter; /** * Called when the topic is changed in a channel aChannel to * aTopic by aPerson. */ - (id)topicChangedTo: (NSString *)aTopic in: (NSString *)aChannel from: (NSString *)aPerson; /** * Called when a message aMessage is received from aSender. * The person or channel that the message is addressed to is stored in aReceiver. */ - (id)messageReceived: (NSString *)aMessage to: (NSString *)aReceiver from: (NSString *)aSender; /** * Called when a notice aNotice is received from aSender. * The person or channel that the notice is addressed to is stored in aReceiver. */ - (id)noticeReceived: (NSString *)aNotice to: (NSString *)aReceiver from: (NSString *)aSender; /** * Called when an action has been received. The action is stored in anAction * and the sender is stored in aSender. The person or channel that * the action is addressed to is stored in aReceiver. */ - (id)actionReceived: (NSString *)anAction to: (NSString *)aReceiver from: (NSString *)aSender; /** * Called when a ping is received. These pings are generally sent by the * server. The correct method of handling these would be to respond to them * with -sendPongWithArgument: using anArgument as the argument. * The server that sent the ping is stored in aSender. */ - (id)pingReceivedWithArgument: (NSString *)anArgument from: (NSString *)aSender; /** * Called when a pong is received. These are generally in answer to a * ping sent with -sendPingWithArgument: The argument anArgument * is generally the same as the argument sent with the ping. aSender * is the server that sent out the pong. */ - (id)pongReceivedWithArgument: (NSString *)anArgument from: (NSString *)aSender; /** * Called when a new nickname was needed while registering because the other * one was either invalid or already taken. Without overriding this, this * method will simply try adding a underscore onto it until it gets in. * This method can be overridden to do other nickname-changing schemes. The * new nickname should be directly set with -changeNick: */ - (id)newNickNeededWhileRegistering; @end /** * This is the lowlevel interface to IRCObject. * One method is a callback for when the object receives * a raw message from the connection, the other is a method * used to write raw messages across the connection */ @interface IRCObject (LowLevel) /** * Handles an incoming line of text from the IRC server by * parsing it and doing the appropriate actions as well as * calling any needed callbacks. * See [LineObject-lineReceived:] for more information. */ - (id)lineReceived: (NSData *)aLine; /** * Writes a formatted string to the connection. This string * will not pass through any of the callbacks. */ - (id)writeString: (NSString *)format, ...; @end /* Below is all the numeric commands that you can receive as listed * in the RFC */ /** * 001 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WELCOME; /** * 002 - Please see RFC 1459 for additional information. */ extern NSString *RPL_YOURHOST; /** * 003 - Please see RFC 1459 for additional information. */ extern NSString *RPL_CREATED; /** * 004 - Please see RFC 1459 for additional information. */ extern NSString *RPL_MYINFO; /** * 005 - Please see RFC 1459 for additional information. */ extern NSString *RPL_BOUNCE; /** * 005 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ISUPPORT; /** * 302 - Please see RFC 1459 for additional information. */ extern NSString *RPL_USERHOST; /** * 303 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ISON; /** * 301 - Please see RFC 1459 for additional information. */ extern NSString *RPL_AWAY; /** * 305 - Please see RFC 1459 for additional information. */ extern NSString *RPL_UNAWAY; /** * 306 - Please see RFC 1459 for additional information. */ extern NSString *RPL_NOWAWAY; /** * 311 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOISUSER; /** * 312 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOISSERVER; /** * 313 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOISOPERATOR; /** * 317 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOISIDLE; /** * 318 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFWHOIS; /** * 319 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOISCHANNELS; /** * 314 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOWASUSER; /** * 369 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFWHOWAS; /** * 321 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LISTSTART; /** * 322 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LIST; /** * 323 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LISTEND; /** * 325 - Please see RFC 1459 for additional information. */ extern NSString *RPL_UNIQOPIS; /** * 324 - Please see RFC 1459 for additional information. */ extern NSString *RPL_CHANNELMODEIS; /** * 331 - Please see RFC 1459 for additional information. */ extern NSString *RPL_NOTOPIC; /** * 332 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TOPIC; /** * 341 - Please see RFC 1459 for additional information. */ extern NSString *RPL_INVITING; /** * 342 - Please see RFC 1459 for additional information. */ extern NSString *RPL_SUMMONING; /** * 346 - Please see RFC 1459 for additional information. */ extern NSString *RPL_INVITELIST; /** * 347 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFINVITELIST; /** * 348 - Please see RFC 1459 for additional information. */ extern NSString *RPL_EXCEPTLIST; /** * 349 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFEXCEPTLIST; /** * 351 - Please see RFC 1459 for additional information. */ extern NSString *RPL_VERSION; /** * 352 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOREPLY; /** * 315 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFWHO; /** * 353 - Please see RFC 1459 for additional information. */ extern NSString *RPL_NAMREPLY; /** * 366 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFNAMES; /** * 364 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LINKS; /** * 365 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFLINKS; /** * 367 - Please see RFC 1459 for additional information. */ extern NSString *RPL_BANLIST; /** * 368 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFBANLIST; /** * 371 - Please see RFC 1459 for additional information. */ extern NSString *RPL_INFO; /** * 374 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFINFO; /** * 375 - Please see RFC 1459 for additional information. */ extern NSString *RPL_MOTDSTART; /** * 372 - Please see RFC 1459 for additional information. */ extern NSString *RPL_MOTD; /** * 376 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFMOTD; /** * 381 - Please see RFC 1459 for additional information. */ extern NSString *RPL_YOUREOPER; /** * 382 - Please see RFC 1459 for additional information. */ extern NSString *RPL_REHASHING; /** * 383 - Please see RFC 1459 for additional information. */ extern NSString *RPL_YOURESERVICE; /** * 391 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TIME; /** * 392 - Please see RFC 1459 for additional information. */ extern NSString *RPL_USERSSTART; /** * 393 - Please see RFC 1459 for additional information. */ extern NSString *RPL_USERS; /** * 394 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFUSERS; /** * 395 - Please see RFC 1459 for additional information. */ extern NSString *RPL_NOUSERS; /** * 200 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACELINK; /** * 201 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACECONNECTING; /** * 202 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACEHANDSHAKE; /** * 203 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACEUNKNOWN; /** * 204 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACEOPERATOR; /** * 205 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACEUSER; /** * 206 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACESERVER; /** * 207 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACESERVICE; /** * 208 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACENEWTYPE; /** * 209 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACECLASS; /** * 210 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACERECONNECT; /** * 261 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACELOG; /** * 262 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRACEEND; /** * 211 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSLINKINFO; /** * 212 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSCOMMANDS; /** * 219 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFSTATS; /** * 242 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSUPTIME; /** * 243 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSOLINE; /** * 221 - Please see RFC 1459 for additional information. */ extern NSString *RPL_UMODEIS; /** * 234 - Please see RFC 1459 for additional information. */ extern NSString *RPL_SERVLIST; /** * 235 - Please see RFC 1459 for additional information. */ extern NSString *RPL_SERVLISTEND; /** * 251 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LUSERCLIENT; /** * 252 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LUSEROP; /** * 253 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LUSERUNKNOWN; /** * 254 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LUSERCHANNELS; /** * 255 - Please see RFC 1459 for additional information. */ extern NSString *RPL_LUSERME; /** * 256 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ADMINME; /** * 257 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ADMINLOC1; /** * 258 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ADMINLOC2; /** * 259 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ADMINEMAIL; /** * 263 - Please see RFC 1459 for additional information. */ extern NSString *RPL_TRYAGAIN; /** * 401 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOSUCHNICK; /** * 402 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOSUCHSERVER; /** * 403 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOSUCHCHANNEL; /** * 404 - Please see RFC 1459 for additional information. */ extern NSString *ERR_CANNOTSENDTOCHAN; /** * 405 - Please see RFC 1459 for additional information. */ extern NSString *ERR_TOOMANYCHANNELS; /** * 406 - Please see RFC 1459 for additional information. */ extern NSString *ERR_WASNOSUCHNICK; /** * 407 - Please see RFC 1459 for additional information. */ extern NSString *ERR_TOOMANYTARGETS; /** * 408 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOSUCHSERVICE; /** * 409 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOORIGIN; /** * 411 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NORECIPIENT; /** * 412 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOTEXTTOSEND; /** * 413 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOTOPLEVEL; /** * 414 - Please see RFC 1459 for additional information. */ extern NSString *ERR_WILDTOPLEVEL; /** * 415 - Please see RFC 1459 for additional information. */ extern NSString *ERR_BADMASK; /** * 421 - Please see RFC 1459 for additional information. */ extern NSString *ERR_UNKNOWNCOMMAND; /** * 422 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOMOTD; /** * 423 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOADMININFO; /** * 424 - Please see RFC 1459 for additional information. */ extern NSString *ERR_FILEERROR; /** * 431 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NONICKNAMEGIVEN; /** * 432 - Please see RFC 1459 for additional information. */ extern NSString *ERR_ERRONEUSNICKNAME; /** * 433 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NICKNAMEINUSE; /** * 436 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NICKCOLLISION; /** * 437 - Please see RFC 1459 for additional information. */ extern NSString *ERR_UNAVAILRESOURCE; /** * 441 - Please see RFC 1459 for additional information. */ extern NSString *ERR_USERNOTINCHANNEL; /** * 442 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOTONCHANNEL; /** * 443 - Please see RFC 1459 for additional information. */ extern NSString *ERR_USERONCHANNEL; /** * 444 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOLOGIN; /** * 445 - Please see RFC 1459 for additional information. */ extern NSString *ERR_SUMMONDISABLED; /** * 446 - Please see RFC 1459 for additional information. */ extern NSString *ERR_USERSDISABLED; /** * 451 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOTREGISTERED; /** * 461 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NEEDMOREPARAMS; /** * 462 - Please see RFC 1459 for additional information. */ extern NSString *ERR_ALREADYREGISTRED; /** * 463 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOPERMFORHOST; /** * 464 - Please see RFC 1459 for additional information. */ extern NSString *ERR_PASSWDMISMATCH; /** * 465 - Please see RFC 1459 for additional information. */ extern NSString *ERR_YOUREBANNEDCREEP; /** * 466 - Please see RFC 1459 for additional information. */ extern NSString *ERR_YOUWILLBEBANNED; /** * 467 - Please see RFC 1459 for additional information. */ extern NSString *ERR_KEYSET; /** * 471 - Please see RFC 1459 for additional information. */ extern NSString *ERR_CHANNELISFULL; /** * 472 - Please see RFC 1459 for additional information. */ extern NSString *ERR_UNKNOWNMODE; /** * 473 - Please see RFC 1459 for additional information. */ extern NSString *ERR_INVITEONLYCHAN; /** * 474 - Please see RFC 1459 for additional information. */ extern NSString *ERR_BANNEDFROMCHAN; /** * 475 - Please see RFC 1459 for additional information. */ extern NSString *ERR_BADCHANNELKEY; /** * 476 - Please see RFC 1459 for additional information. */ extern NSString *ERR_BADCHANMASK; /** * 477 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOCHANMODES; /** * 478 - Please see RFC 1459 for additional information. */ extern NSString *ERR_BANLISTFULL; /** * 481 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOPRIVILEGES; /** * 482 - Please see RFC 1459 for additional information. */ extern NSString *ERR_CHANOPRIVSNEEDED; /** * 483 - Please see RFC 1459 for additional information. */ extern NSString *ERR_CANTKILLSERVER; /** * 484 - Please see RFC 1459 for additional information. */ extern NSString *ERR_RESTRICTED; /** * 485 - Please see RFC 1459 for additional information. */ extern NSString *ERR_UNIQOPPRIVSNEEDED; /** * 491 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOOPERHOST; /** * 501 - Please see RFC 1459 for additional information. */ extern NSString *ERR_UMODEUNKNOWNFLAG; /** * 502 - Please see RFC 1459 for additional information. */ extern NSString *ERR_USERSDONTMATCH; /** * 231 - Please see RFC 1459 for additional information. */ extern NSString *RPL_SERVICEINFO; /** * 232 - Please see RFC 1459 for additional information. */ extern NSString *RPL_ENDOFSERVICES; /** * 233 - Please see RFC 1459 for additional information. */ extern NSString *RPL_SERVICE; /** * 300 - Please see RFC 1459 for additional information. */ extern NSString *RPL_NONE; /** * 316 - Please see RFC 1459 for additional information. */ extern NSString *RPL_WHOISCHANOP; /** * 361 - Please see RFC 1459 for additional information. */ extern NSString *RPL_KILLDONE; /** * 262 - Please see RFC 1459 for additional information. */ extern NSString *RPL_CLOSING; /** * 363 - Please see RFC 1459 for additional information. */ extern NSString *RPL_CLOSEEND; /** * 373 - Please see RFC 1459 for additional information. */ extern NSString *RPL_INFOSTART; /** * 384 - Please see RFC 1459 for additional information. */ extern NSString *RPL_MYPORTIS; /** * 213 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSCLINE; /** * 214 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSNLINE; /** * 215 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSILINE; /** * 216 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSKLINE; /** * 217 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSQLINE; /** * 218 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSYLINE; /** * 240 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSVLINE; /** * 241 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSLLINE; /** * 244 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSHLINE; /** * 245 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSSLINE; /** * 246 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSPING; /** * 247 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSBLINE; /** * 250 - Please see RFC 1459 for additional information. */ extern NSString *RPL_STATSDLINE; /** * 492 - Please see RFC 1459 for additional information. */ extern NSString *ERR_NOSERVICEHOST; #endif netclasses-1.1.0/Source/LineObject.m0000644000175000001440000000536312345537310016564 0ustar multixusers/*************************************************************************** LineObject.m ------------------- begin : Thu May 30 02:19:30 UTC 2002 copyright : (C) 2005 by Andrew Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ /** * LineObject class reference * * * * * Revision 1 * November 8, 2003 * Andrew Ruder */ #import "LineObject.h" #import #import #include static inline NSData *chomp_line(NSMutableData *data) { char *memory = [data mutableBytes]; char *memoryEnd = memory + [data length]; char *lineEndWithControls; char *lineEnd; int tempLength; id lineData; lineEndWithControls = lineEnd = memchr(memory, '\n', memoryEnd - memory); if (!lineEnd) { return nil; } while ((lineEnd >= memory) && ((*lineEnd == '\n') || (*lineEnd == '\r'))) { lineEnd--; } lineData = [NSData dataWithBytes: memory length: lineEnd - memory + 1]; tempLength = memoryEnd - lineEndWithControls - 1; memmove(memory, lineEndWithControls + 1, tempLength); [data setLength: tempLength]; return lineData; } @implementation LineObject - init { if (!(self = [super init])) return self; _readData = [NSMutableData new]; return self; } - (void)dealloc { RELEASE(_readData); [super dealloc]; } - (void)connectionLost { [_readData setLength: 0]; DESTROY(transport); } - connectionEstablished: (id )aTransport { transport = RETAIN(aTransport); [[NetApplication sharedInstance] connectObject: self]; return self; } - dataReceived: (NSData *)newData { id newLine; [_readData appendData: newData]; while (transport && (newLine = chomp_line(_readData))) [self lineReceived: newLine]; return self; } - (id )transport { return transport; } - lineReceived: (NSData *)aLine { return self; } @end netclasses-1.1.0/Source/NetBase.h0000644000175000001440000002317712503215220016052 0ustar multixusers/*************************************************************************** NetBase.h ------------------- begin : Fri Nov 2 01:19:16 UTC 2001 copyright : (C) 2005 by Andrew Ruder : (C) 2015 The GAP Team email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ @class NetApplication; #ifndef NET_BASE_H #define NET_BASE_H #import #import #import #include #include #include #ifndef GNUSTEP #define CREATE_AUTORELEASE_POOL(X) \ NSAutoreleasePool *(X) = [NSAutoreleasePool new] #define AUTORELEASE(object) [object autorelease] #define RELEASE(object) [object release] #define RETAIN(object) [object retain] #define DESTROY(object) ({ \ if (object) \ { \ id __o = object; \ object = nil; \ [__o release]; \ } \ }) #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) && !defined(NSUInteger) #define NSUInteger unsigned #define NSInteger int #endif #endif @class NSData, NSNumber, NSMutableDictionary, NSDictionary, NSArray; @class NSMutableArray, NSString; /** * A protocol used for the actual transport class of a connection. A * transport is a low-level object which actually handles the physical * means of transporting data to the other side of the connection through * methods such as -readData: and -writeData:. */ @protocol NetTransport /** * Returns an object representing the local side of a connection. The actual * object depends on the implementation of this protocol. */ - (id)localHost; /** * Returns an object representing the remote side of a connection. The actual * object depends on the implementation of this protocol. */ - (id)remoteHost; /** * This should serve two purposes. When data is not nil, * the transport should store the data, and then call * [NetApplication-transportNeedsToWrite:] to notify [NetApplication] * that the transport needs to write. * * When data is nil, the transport should assume that it is * actually safe to write the data and should do so at this time. * [NetApplication] will call -writeData: with a nil argument when it is * safe to write */ - (id )writeData: (NSData *)data; /** * Return YES if no more data is waiting to be written, and NO otherwise. * Used by [NetApplication] to determine when it can stop checking * the transport for writing availability. */ - (BOOL)isDoneWriting; /** * Called by [NetApplication] when it is safe to write. Should return * data read from the connection with a maximum size of * maxReadSize. If maxReadSize should be zero, all * data available on the connection should be returned. */ - (NSData *)readData: (int)maxReadSize; /** * Returns a file descriptor representing the connection. */ - (int)desc; /** * Should close the file descriptor. */ - (void)close; @end /** * Represents a class that acts as a port. Each port allows a object type * to be attached to it, and it will instantiate an object of that type * upon receiving a new connection. */ @protocol NetPort /** * Sets the class of the object that should be attached to the port. This * class should implement the [(NetObject)] protocol. */ - setNetObject: (Class)aClass; /** * Called when the object has [NetApplication-disconnectObject:] called on it. */ - (void)connectionLost; /** * Called when a new connection has been detected by [NetApplication]. * The port should should use this new connection to instantiate a object * of the class set by -setNetObject:. */ - (id )newConnection; /** * Returns the low-level file descriptor. */ - (int)desc; /** * Should close the file descriptor. */ - (void)close; @end /** * This protocol should be implemented by an object used in a connection. * When a connection is received by a [(NetPort)], the object attached to * the port is created and given the transport. */ @protocol NetObject /** * Called when [NetApplication-disconnectObject:] is called with this * object as a argument. This object will no longer receive data or other * messages after it is disconnected. */ - (void)connectionLost; /** * Called when a connection has been established, and gives the object * the transport used to actually transport the data. aTransport * will implement [(NetTransport)]. */ - connectionEstablished: (id )aTransport; /** * data is data read in from the connection. */ - dataReceived: (NSData *)data; /** * Should return the transport given to the object by -connectionEstablished: */ - (id )transport; @end /** * Thrown when a recoverable exception occurs on a connection or otherwise. */ extern NSString *NetException; /** * Should be thrown when a non-recoverable exception occurs on a connection. * The connection should be closed immediately. */ extern NSString *FatalNetException; #ifndef GNUSTEP /** * Used for OS X compatibility. This type is an extension to GNUstep. On * OS X, a compatibility layer is created to recreate the GNUstep extensions * using OS X extensions. */ typedef enum { ET_RDESC, ET_WDESC, ET_RPORT, ET_EDESC } RunLoopEventType; /** * Used for OS X compatibility. OS X does not have the RunLoopEvents * protocol. This is a GNUstep-specific extension. This must be * recreated on OS X to compile netclasses. */ @protocol RunLoopEvents /** * OS X compatibility function. This is a callback called by the run loop * when an event has timed out. */ - (NSDate *)timedOutEvent: (void *)data type: (RunLoopEventType)type forMode: (NSString *)mode; /** * OS X compatibility function. This is a callback called by the run loop * when an event has been received. */ - (void)receivedEvent: (void *)data type: (RunLoopEventType)type extra: (void *)extra forMode: (NSString *)mode; @end #endif @interface NetApplication : NSObject < RunLoopEvents > { NSMutableArray *portArray; NSMutableArray *netObjectArray; NSMutableArray *badDescs; NSMapTable *descTable; } /** * Return the minor version number of the netclasses framework. If the * version is 1.03, this will return 3. */ + (int)netclassesMinorVersion; /** * Return the major version number of the netclasses framework. If the * version is 1.03, this will return 1. */ + (int)netclassesMajorVersion; /** * Return the version string for the netclasses framework. If the version * is 1.03, this will return @"1.03". */ + (NSString *)netclassesVersion; /** * There can be only one instance of NetApplication. This method will * return that one instance. */ + sharedInstance; /** * Should not be called. Used internally by [NetApplication] to receive * timed out events notifications from the runloop. */ - (NSDate *)timedOutEvent: (void *)data type: (RunLoopEventType)type forMode: (NSString *)mode; /** * Should not be called. Used internally by [NetApplication] to receive * events from the runloop. */ - (void)receivedEvent: (void *)data type: (RunLoopEventType)type extra: (void *)extra forMode: (NSString *)mode; /** * This is called to notify NetApplication that * aTransport has data that needs to be written out. * Only after this method is called will aTransport * begin to receive [(NetTransport)-writeData:] messages with a * nil argument when it can write. */ - transportNeedsToWrite: (id )aTransport; /** * Inserts anObject into the runloop (and retains it). * anObject should implement either the [(NetPort)] or * [(NetObject)] protocols. Throws a NetException if the * class follows neither protocol. After connecting anObject, * it will begin to receive the methods designated by its respective * protocol. anObject should only be connected with this * after its transport is set. */ - connectObject: anObject; /** *

* Removes anObject from the runloop and releases it. * anObject will no longer receive messages outlined by * its protocol. Does not close the descriptor of * anObject. anObject will receive * a [(NetObject)-connectionLost] message or a [(NetPort)-connectionLost] * message. *

*

* If any object should lose its connection, this will * automatically be called with that object as its argument. *

*/ - disconnectObject: anObject; /** * Calls -disconnectObject: on every object currently in the runloop. */ - closeEverything; /** * Return an array of all net objects currently being handled by netclasses */ - (NSArray *)netObjectArray; /** * Return an array of all port objects currently being handled by netclasses */ - (NSArray *)portArray; @end #endif netclasses-1.1.0/Source/NetBase.m0000644000175000001440000002533012503215220016050 0ustar multixusers/*************************************************************************** NetBase.m ------------------- begin : Fri Nov 2 01:19:16 UTC 2001 copyright : (C) 2005 by Andrew Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ /** * NetBase reference * * * * * Revision 1 * November 8, 2003 * Andrew Ruder */ #import "NetBase.h" #import #import #import #import #import #import #import #import #include #include #include /* for intptr_t */ NSString *NetException = @"NetException"; NSString *FatalNetException = @"FatalNetException"; NetApplication *netApplication; #ifndef GNUSTEP #include static NSMapTable *desc_to_info = 0; typedef struct { CFSocketRef socket; CFRunLoopSourceRef source; int modes; NSMapTable *watchers; } net_socket_info; static void handle_cf_events(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info); static void remove_info_for_socket(int desc) { net_socket_info *x; x = NSMapGet(desc_to_info, (void *)desc); if (!x) return; CFRunLoopRemoveSource(CFRunLoopGetCurrent(), x->source, kCFRunLoopDefaultMode); CFRelease(x->source); CFRelease(x->socket); NSFreeMapTable(x->watchers); free(x); NSMapRemove(desc_to_info, (void *)desc); return; } static BOOL is_info_for_socket(int desc) { return NSMapGet(desc_to_info, (void *)desc) != 0; } static net_socket_info *info_for_socket(int desc) { CFSocketRef sock; CFRunLoopSourceRef source; net_socket_info *x; x = NSMapGet(desc_to_info, (void *)desc); if (x) return x; sock = CFSocketCreateWithNative( NULL, desc, kCFSocketReadCallBack | kCFSocketWriteCallBack, handle_cf_events, NULL ); CFSocketDisableCallBacks( sock, kCFSocketWriteCallBack | kCFSocketReadCallBack); if (!sock) return NULL; source = CFSocketCreateRunLoopSource( NULL, sock, 1); if (!source) { CFRelease(sock); return NULL; } x = malloc (sizeof(net_socket_info)); x->socket = sock; x->source = source; x->modes = 0; x->watchers = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 100); NSMapInsert(desc_to_info, (void *)desc, (void *)x); CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); return x; } static void handle_cf_events(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info) { int desc; net_socket_info *x; desc = (int)CFSocketGetNative(s); if (!is_info_for_socket(desc)) { return; } x = info_for_socket(desc); if (!x) return; if (callbackType & kCFSocketWriteCallBack) { [(id)NSMapGet(x->watchers, (void *)(1 << ET_WDESC)) receivedEvent: (void *)desc type: ET_WDESC extra: 0 forMode: nil]; } if (callbackType & kCFSocketReadCallBack) { [(id)NSMapGet(x->watchers, (void *)(1 << ET_RDESC)) receivedEvent: (void *)desc type: ET_RDESC extra: 0 forMode: nil]; } } @interface NSRunLoop (RunLoopEventsAdditions) - (void) addEvent: (void *)data type: (RunLoopEventType)type watcher: (id)watcher forMode: (NSString *)mode; - (void) removeEvent: (void *)data type: (RunLoopEventType)type forMode: (NSString *)mode all: (BOOL)removeAll; @end @implementation NSRunLoop (RunLoopEventsAdditions) + (void) initialize { desc_to_info = NSCreateMapTable(NSIntMapKeyCallBacks, NSIntMapValueCallBacks, 100); } - (void) addEvent: (void *)data type: (RunLoopEventType)type watcher: (id)watcher forMode: (NSString *)mode { int desc = (int)data; int add_mode = (int)type; net_socket_info *x; x = info_for_socket(desc); if (x->modes & (1 << add_mode)) return; switch(add_mode) { case ET_RDESC: CFSocketEnableCallBacks( x->socket, kCFSocketReadCallBack ); x->modes |= (1 << add_mode); NSMapInsert(x->watchers, (void *)(1 << add_mode), (void *)watcher); break; case ET_WDESC: CFSocketEnableCallBacks( x->socket, kCFSocketWriteCallBack ); x->modes |= (1 << add_mode); NSMapInsert(x->watchers, (void *)(1 << add_mode), (void *)watcher); break; default: break; } } - (void) removeEvent: (void *)data type: (RunLoopEventType)type forMode: (NSString *)mode all: (BOOL)removeAll { int desc = (int)data; int remove_mode = (int)type; net_socket_info *x; if (!is_info_for_socket(desc)) { return; } x = info_for_socket(desc); switch(remove_mode) { case ET_RDESC: CFSocketDisableCallBacks( x->socket, kCFSocketReadCallBack ); x->modes &= ~(1 << remove_mode); NSMapRemove(x->watchers, (void *)(1 << remove_mode)); break; case ET_WDESC: CFSocketDisableCallBacks( x->socket, kCFSocketWriteCallBack ); x->modes &= ~(1 << remove_mode); NSMapRemove(x->watchers, (void *)(1 << remove_mode)); break; default: break; } if (x->modes == 0) { remove_info_for_socket(desc); } } @end #endif @implementation NetApplication + (int)netclassesMinorVersion { int x; sscanf(PACKAGE_VERSION, "%*d.%d", &x); return x; } + (int)netclassesMajorVersion { int x; sscanf(PACKAGE_VERSION, "%d.%*d", &x); return x; } + (NSString *)netclassesVersion { return [NSString stringWithCString: PACKAGE_VERSION]; } + sharedInstance { return (netApplication) ? (netApplication) : [[NetApplication alloc] init]; } - init { if (!(self = [super init])) return nil; if (netApplication) { [super dealloc]; return nil; } netApplication = RETAIN(self); descTable = NSCreateMapTable(NSIntMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 100); portArray = [NSMutableArray new]; netObjectArray = [NSMutableArray new]; badDescs = [NSMutableArray new]; return self; } - (void)dealloc // How in the world... { RELEASE(portArray); RELEASE(netObjectArray); RELEASE(badDescs); NSFreeMapTable(descTable); netApplication = nil; [super dealloc]; } - (NSDate *)timedOutEvent: (void *)data type: (RunLoopEventType)type forMode: (NSString *)mode { return nil; } - (void)receivedEvent: (void *)data type: (RunLoopEventType)type extra: (void *)extra forMode: (NSString *)mode { id object; object = (id)NSMapGet(descTable, data); if (!object) { [[NSRunLoop currentRunLoop] removeEvent: data type: type forMode: NSDefaultRunLoopMode all: YES]; return; } AUTORELEASE(RETAIN(object)); NS_DURING switch(type) { default: break; case ET_RDESC: if ([object conformsToProtocol: @protocol(NetObject)]) { [object dataReceived: [[object transport] readData: 0]]; } else { [object newConnection]; } break; case ET_WDESC: [[object transport] writeData: nil]; if ([[object transport] isDoneWriting]) { [[NSRunLoop currentRunLoop] removeEvent: data type: ET_WDESC forMode: NSDefaultRunLoopMode all: YES]; } break; case ET_EDESC: [self disconnectObject: self]; break; } NS_HANDLER if (([[localException name] isEqualToString:NetException]) || ([[localException name] isEqualToString:FatalNetException])) { if (type == ET_RDESC) { id data; data = [[localException userInfo] objectForKey: @"Data"]; if (data && ([data length] > 0)) { [object dataReceived: data]; } } [self disconnectObject: object]; } else { [localException raise]; } NS_ENDHANDLER } - connectObject: anObject { void *desc = 0; if ([anObject conformsToProtocol: @protocol(NetPort)]) { desc = (void *)(intptr_t)[anObject desc]; [portArray addObject: anObject]; } else if ([anObject conformsToProtocol: @protocol(NetObject)]) { desc = (void *)(intptr_t)[[anObject transport] desc]; [netObjectArray addObject: anObject]; } else { [NSException raise: NetException format: @"[NetApplication addObject:] %@ does not follow " @"< NetPort > or < NetObject >", NSStringFromClass([anObject class])]; } NSMapInsert(descTable, desc, anObject); [[NSRunLoop currentRunLoop] addEvent: desc type: ET_EDESC watcher: self forMode: NSDefaultRunLoopMode]; [[NSRunLoop currentRunLoop] addEvent: desc type: ET_RDESC watcher: self forMode: NSDefaultRunLoopMode]; return self; } - disconnectObject: anObject { id whichOne = nil; void *desc = 0; if ([portArray containsObject: anObject]) { whichOne = portArray; desc = (void *)(intptr_t)[anObject desc]; } else if ([netObjectArray containsObject: anObject]) { whichOne = netObjectArray; desc = (void *)(intptr_t)[[anObject transport] desc]; [[NSRunLoop currentRunLoop] removeEvent: desc type: ET_WDESC forMode: NSDefaultRunLoopMode all: YES]; } else { return self; } [[NSRunLoop currentRunLoop] removeEvent: desc type: ET_RDESC forMode: NSDefaultRunLoopMode all: YES]; [[NSRunLoop currentRunLoop] removeEvent: desc type: ET_EDESC forMode: NSDefaultRunLoopMode all: YES]; NSMapRemove(descTable, desc); [anObject retain]; [whichOne removeObject: anObject]; [anObject autorelease]; [anObject connectionLost]; return self; } - closeEverything { CREATE_AUTORELEASE_POOL(apr); while ([netObjectArray count] != 0) { [self disconnectObject: [netObjectArray objectAtIndex: 0]]; } while ([portArray count] != 0) { [self disconnectObject: [portArray objectAtIndex: 0]]; } RELEASE(apr); return self; } - transportNeedsToWrite: (id )aTransport { int desc = [aTransport desc]; if ((id)NSMapGet(descTable, (void *)(intptr_t)desc)) { [[NSRunLoop currentRunLoop] addEvent: (void *)desc type: ET_WDESC watcher: self forMode: NSDefaultRunLoopMode]; } return self; } - (NSArray *)netObjectArray { return [NSArray arrayWithArray: netObjectArray]; } - (NSArray *)portArray { return [NSArray arrayWithArray: portArray]; } @end netclasses-1.1.0/Source/NetTCP.h0000644000175000001440000002331712503215220015622 0ustar multixusers/*************************************************************************** NetTCP.h ------------------- begin : Fri Nov 2 01:19:16 UTC 2001 copyright : (C) 2005 by Andrew Ruder : (C) 2015 The GAP Team email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ @class TCPSystem, TCPConnecting, TCPPort, TCPTransport; #ifndef NET_TCP_H #define NET_TCP_H #import "NetBase.h" #import #include #include @class NSString, NSNumber, NSString, NSData, NSMutableData, TCPConnecting; @class TCPTransport, TCPSystem, NSHost; /** * If an error occurs and error number is zero, this could be the error string. * This error occurs when some operation times out. */ extern NSString *NetclassesErrorTimeout; /** * Could be the current error string if the error number is zero and some * error has occurred. Indicates * that a NSHost returned an address that was invalid. */ extern NSString *NetclassesErrorBadAddress; /** * The error message used when a connection is aborted. */ extern NSString *NetclassesErrorAborted; /** * A class can implement this protocol, and when it is connected in the * background using -connectNetObjectInBackground:toHost:onPort:withTimeout: * it will receive the messages in this protocol which notify the object of * certain events while being connected in the background. */ @protocol TCPConnecting /** * Tells the class implementing this protocol that the error in * aError has occurred and the connection will not * be established */ - connectingFailed: (NSString *)aError; /** * Tells the class implementing this protocol that the connection * has begun and will be using the connection place holder * aConnection */ - connectingStarted: (TCPConnecting *)aConnection; @end /** * Used for certain operations in the TCP/IP system. There is only one * instance of this class at a time, used +sharedInstance to get this * instance. */ @interface TCPSystem : NSObject { NSString *errorString; int errorNumber; } /** * Returns the one instance of TCPSystem currently in existence. */ + sharedInstance; /** * Returns the error string of the last error that occurred. */ - (NSString *)errorString; /** * Returns the errno of the last error that occurred. If it is some other * non-system error, this will be zero, but the error string shall be set * accordingly. */ - (int)errorNumber; /** * Will connect the object netObject to host aHost * on port aPort. If this connection doesn't happen in * aTimeout seconds or some other error occurs, it will return * nil and the error string and error number shall be set accordingly. * Otherwise this will return netObject */ - (id )connectNetObject: (id )netObject toHost: (NSHost *)aHost onPort: (uint16_t)aPort withTimeout: (int)aTimeout; /** * Connects netObject to host aHost on the port * aPort. Returns a place holder object that finishes the * connection in the background. The placeholder will fail if the connection * does not occur in aTimeout seconds. Returns nil if an error * occurs and sets the error string and error number accordingly. */ - (TCPConnecting *)connectNetObjectInBackground: (id )netObject toHost: (NSHost *)aHost onPort: (uint16_t)aPort withTimeout: (int)aTimeout; /** * Returns a host order 32-bit integer from a host * Returns YES on success and NO on failure, the result is stored in the * 32-bit integer pointed to by aNumber */ - (BOOL)hostOrderInteger: (uint32_t *)aNumber fromHost: (NSHost *)aHost; /** * Returns a network order 32-bit integer from a host * Returns YES on success and NO on failure, the result is stored in the * 32-bit integer pointed to by aNumber */ - (BOOL)networkOrderInteger: (uint32_t *)aNumber fromHost: (NSHost *)aHost; /** * Returns a host from a network order 32-bit integer ip address. */ - (NSHost *)hostFromHostOrderInteger: (uint32_t)ip; /** * Returns a host from a host order 32-bit integer ip address. */ - (NSHost *)hostFromNetworkOrderInteger: (uint32_t)ip; @end /** * If an object was attempted to have been connected in the background, this * is a placeholder for that ongoing connection. * -connectNetObjectInBackground:toHost:onPort:withTimeout: will return an * instance of this object. This placeholder object can be used to cancel * an ongoing connection with the -abortConnection method. */ @interface TCPConnecting : NSObject < NetObject > { id transport; id netObject; NSTimer *timeout; } /** * Returns the object that will be connected by this placeholder object. */ - (id )netObject; /** * Aborts the ongoing connection. If the net object conforms to the * [(TCPConnecting)] protocol, it will receive a * [(TCPConnecting)-connectingFailed:] message with a argument of * NetclassesErrorAborted */ - (void)abortConnection; /** * Cleans up the connection placeholder. This will release the transport. */ - (void)connectionLost; /** * Sets up the connection placeolder. If the net object conforms to * [(TCPConnecting)], it will receive a * [(TCPConnecting)-connectingStarted:] with the instance of TCPConnecting * as an argument. */ - connectionEstablished: (id )aTransport; /** * This shouldn't happen while a class is connecting, but included to * conform to the [(NetObject)] protocol. */ - (id )dataReceived: (NSData *)data; /** * Returns the transport used by this object. Will not be the same transport * given to the net object when the connection is made. */ - (id )transport; @end /** * TCPPort is a class that is used to bind a descriptor to a certain * TCP/IP port and listen for connections. When a connection is received, * it will create a class set with -setNetObject: and set it up with the new * connection. When the TCPPort is dealloc'd it will close the descriptor * if it had not been closed already. */ @interface TCPPort : NSObject < NetPort > { int desc; Class netObjectClass; uint16_t port; BOOL connected; } /** * Calls -initOnHost:onPort: with a nil argument for the host. */ - initOnPort: (uint16_t)aPort; /** * Initializes a port on aHost and binds it to port aPort. * If aHost is nil, it will set it up on all addresses on the local * machine. Using zero for aPort will use a random currently * available port number. Use -port to find out where it is actually * bound to. */ - initOnHost: (NSHost *)aHost onPort: (uint16_t)aPort; /** * Returns the port that this TCPPort is currently bound to. */ - (uint16_t)port; /** * Sets the class that will be initialized if a connection occurs on this * port. If aClass does not implement the [(NetObject)] * protocol, will throw a FatalNetException. */ - setNetObject: (Class)aClass; /** * Returns the low-level file descriptor for the port. */ - (int)desc; /** * Closes the descriptor. */ - (void)close; /** * Called when the connection is closed. */ - (void)connectionLost; /** * Called when a new connection occurs. Will initialize a new object * of the class set with -setNetObject: with the new connection. */ - (id )newConnection; @end /** * Handles the actual TCP/IP transfer of data. When an instance of this * object is deallocated, the descriptor will be closed if not already * closed. */ @interface TCPTransport : NSObject < NetTransport > { int desc; BOOL connected; NSMutableData *writeBuffer; NSHost *remoteHost; NSHost *localHost; } /** * Initializes the transport with the file descriptor aDesc. * theAddress is the host that the flie descriptor is connected * to. */ - (id)initWithDesc: (int)aDesc withRemoteHost: (NSHost *)theAddress; /** * Handles the actual reading of data from the connection. * Throws an exception if an error occurs while reading data. * The @"Data" key in the userInfo for these exceptions should * be any NSData that could not be returned. * * If maxDataSize is <= 0, all possible data will be * read. */ - (NSData *)readData: (int)maxDataSize; /** * Returns YES if there is no more data to write in the buffer and NO if * there is. */ - (BOOL)isDoneWriting; /** * If aData is nil, this will physically transport the data * to the connected end. Otherwise this will put the data in the buffer of * data that needs to be written to the connection when next possible. */ - (id )writeData: (NSData *)aData; /** * Returns a NSHost of the local side of a connection. */ - (id)localHost; /** * Returns a NSHost of the remote side of a connection. */ - (id)remoteHost; /** * Returns the low level file descriptor that is used internally. */ - (int)desc; /** * Closes the transport and makes sure there is no more incoming or outgoing * data on the connection. */ - (void)close; @end #endif netclasses-1.1.0/Source/IRCObject.m0000644000175000001440000014433412503215220016301 0ustar multixusers/*************************************************************************** IRCObject.m ------------------- begin : Thu May 30 22:06:25 UTC 2002 copyright : (C) 2005 by Andrew Ruder : (C) 2013-2015 The GNUstep Application Project email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program 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. * * * ***************************************************************************/ /** * IRCObject reference * * * * * Revision 1 * November 8, 2003 * Andrew Ruder *

* Much of the information presented in this document is based off * of information presented in RFC 1459 (Oikarinen and Reed 1999). * This document is NOT aimed at reproducing the information in the RFC, * and the RFC should still always be consulted for various server-related * replies to messages and proper format of the arguments. In short, if you * are doing a serious project dealing with IRC, even with the use of * netclasses, RFC 1459 is indispensable. *

*/ #import "NetBase.h" #import "NetTCP.h" #import "IRCObject.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #include #include #include #include NSString *IRCException = @"IRCException"; static NSMapTable *command_to_function = 0; static NSMapTable *ctcp_to_function = 0; static NSData *IRC_new_line = nil; @implementation NSString (IRCAddition) - (NSString *)uppercaseIRCString { NSMutableString *aString = [NSString stringWithString: [self uppercaseString]]; NSRange aRange = {0, [aString length]}; [aString replaceOccurrencesOfString: @"{" withString: @"[" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"}" withString: @"]" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"|" withString: @"\\" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"^" withString: @"~" options: 0 range: aRange]; return [aString uppercaseString]; } - (NSString *)uppercaseStrictRFC1459IRCString { NSMutableString *aString = [NSString stringWithString: [self uppercaseString]]; NSRange aRange = {0, [aString length]}; [aString replaceOccurrencesOfString: @"{" withString: @"[" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"}" withString: @"]" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"|" withString: @"\\" options: 0 range: aRange]; return [aString uppercaseString]; } - (NSString *)lowercaseIRCString { NSMutableString *aString = [NSMutableString stringWithString: [self lowercaseString]]; NSRange aRange = {0, [aString length]}; [aString replaceOccurrencesOfString: @"[" withString: @"{" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"]" withString: @"}" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"\\" withString: @"|" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"~" withString: @"^" options: 0 range: aRange]; return [aString lowercaseString]; } - (NSString *)lowercaseStrictRFC1459IRCString { NSMutableString *aString = [NSMutableString stringWithString: [self lowercaseString]]; NSRange aRange = {0, [aString length]}; [aString replaceOccurrencesOfString: @"[" withString: @"{" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"]" withString: @"}" options: 0 range: aRange]; [aString replaceOccurrencesOfString: @"\\" withString: @"|" options: 0 range: aRange]; return [aString lowercaseString]; } @end @interface IRCObject (InternalIRCObject) - setErrorString: (NSString *)anError; @end #define NEXT_SPACE(__y, __z, __string)\ {\ __z = [(__string) rangeOfCharacterFromSet:\ [NSCharacterSet whitespaceCharacterSet] options: 0\ range: NSMakeRange((__y), [(__string) length] - (__y))].location;\ if (__z == NSNotFound) __z = [(__string) length];\ } #define NEXT_NON_SPACE(__y, __z, __string)\ {\ NSUInteger __len = [(__string) length];\ id set = [NSCharacterSet whitespaceCharacterSet];\ __z = (__y);\ while (__z < __len && \ [set characterIsMember: [(__string) characterAtIndex: __z]]) __z++;\ } static inline NSString *get_IRC_prefix(NSString *line, NSString **prefix) { NSUInteger beg; NSUInteger end; NSUInteger len = [line length]; if (len == 0) { *prefix = nil; return @""; } NEXT_NON_SPACE(0, beg, line); if (beg == len) { *prefix = nil; return @""; } NEXT_SPACE(beg, end, line); if ([line characterAtIndex: beg] != ':') { *prefix = nil; return line; } else { beg++; if (beg == end) { *prefix = @""; if (beg == len) { return @""; } else { return [line substringFromIndex: beg]; } } } *prefix = [line substringWithRange: NSMakeRange(beg, end - beg)]; if (end != len) { return [line substringFromIndex: end]; } return @""; } static inline NSString *get_next_IRC_word(NSString *line, NSString **prefix) { NSUInteger beg; NSUInteger end; NSUInteger len = [line length]; if (len == 0) { *prefix = nil; return @""; } NEXT_NON_SPACE(0, beg, line); if (beg == len) { *prefix = nil; return @""; } if ([line characterAtIndex: beg] == ':') { beg++; if (beg == len) { *prefix = @""; } else { *prefix = [line substringFromIndex: beg]; } return @""; } NEXT_SPACE(beg, end, line); *prefix = [line substringWithRange: NSMakeRange(beg, end - beg)]; if (end != len) { return [line substringFromIndex: end]; } return @""; } #undef NEXT_NON_SPACE #undef NEXT_SPACE static inline BOOL is_numeric_command(NSString *aString) { static NSCharacterSet *set = nil; unichar test[3]; if (!set) { set = RETAIN([NSCharacterSet characterSetWithCharactersInString: @"0123456789"]); } if ([aString length] != 3) { return NO; } [aString getCharacters: test]; if ([set characterIsMember: test[0]] && [set characterIsMember: test[1]] && [set characterIsMember: test[2]]) { return YES; } return NO; } static inline NSString *string_to_string(NSString *aString, NSString *delim) { NSRange a = [aString rangeOfString: delim]; if (a.location == NSNotFound) return [NSString stringWithString: aString]; return [aString substringToIndex: a.location]; } static inline NSString *string_from_string(NSString *aString, NSString *delim) { NSRange a = [aString rangeOfString: delim]; if (a.location == NSNotFound) return nil; a.location += a.length; if (a.location == [aString length]) { return @""; } return [aString substringFromIndex: a.location]; } inline NSString *ExtractIRCNick(NSString *prefix) { if (!prefix) return @""; return string_to_string(prefix, @"!"); } inline NSString *ExtractIRCHost(NSString *prefix) { if (!prefix) return @""; return string_from_string(prefix, @"!"); } inline NSArray *SeparateIRCNickAndHost(NSString *prefix) { if (!prefix) return [NSArray arrayWithObject: @""]; return [NSArray arrayWithObjects: string_to_string(prefix, @"!"), string_from_string(prefix, @"!"), nil]; } static void rec_isupport(IRCObject *client, NSArray *paramList) { NSEnumerator *iter; id object; iter = [paramList objectEnumerator]; while ((object = [iter nextObject])) { object = [object lowercaseString]; if ([object hasPrefix: @"casemapping="]) { object = [object substringFromIndex: 12]; if ([object isEqualToString: @"rfc1459"]) { [client setLowercasingSelector: @selector(lowercaseIRCString)]; } else if ([object isEqualToString: @"strict-rfc1459"]) { [client setLowercasingSelector: @selector(lowercaseStrictRFC1459IRCString)]; } else if ([object isEqualToString: @"ascii"]) { [client setLowercasingSelector: @selector(lowercaseString)]; } else { NSLog(@"Did not understand casemapping=%@", object); } break; } } } static void rec_numeric(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if ([command isEqualToString: RPL_ISUPPORT]) { rec_isupport(client, paramList); } [client numericCommandReceived: command withParams: paramList from: prefix]; } static void rec_caction(IRCObject *client, NSString *prefix, NSString *command, NSString *rest, NSString *to) { if ([rest length] == 0) { return; } [client actionReceived: rest to: to from: prefix]; } static void rec_ccustom(IRCObject *client, NSString *prefix, NSString *command, NSString *rest, NSString *to, NSString *ctcp) { if ([command isEqualToString: @"NOTICE"]) { [client CTCPReplyReceived: ctcp withArgument: rest to: to from: prefix]; } else { [client CTCPRequestReceived: ctcp withArgument: rest to: to from: prefix]; } } static void rec_nick(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if (!prefix) { return; } if ([paramList count] < 1) { return; } if ([client caseInsensitiveCompare: [client nick] to: ExtractIRCNick(prefix)] == NSOrderedSame) { [client setNick: [paramList objectAtIndex: 0]]; } [client nickChangedTo: [paramList objectAtIndex: 0] from: prefix]; } static void rec_join(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if (!prefix) { return; } if ([paramList count] == 0) { return; } [client channelJoined: [paramList objectAtIndex: 0] from: prefix]; } static void rec_part(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { NSUInteger x; if (!prefix) { return; } x = [paramList count]; if (x == 0) { return; } [client channelParted: [paramList objectAtIndex: 0] withMessage: (x == 2) ? [paramList objectAtIndex: 1] : 0 from: prefix]; } static void rec_quit(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if (!prefix) { return; } if ([paramList count] == 0) { return; } [client quitIRCWithMessage: [paramList objectAtIndex: 0] from: prefix]; } static void rec_topic(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if (!prefix) { return; } if ([paramList count] < 2) { return; } [client topicChangedTo: [paramList objectAtIndex: 1] in: [paramList objectAtIndex: 0] from: prefix]; } static void rec_privmsg(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { NSString *message; if ([paramList count] < 2) { return; } message = [paramList objectAtIndex: 1]; if ([message hasPrefix: @"\001"]) { void (*func)(IRCObject *, NSString *, NSString *, NSString *, NSString *); id ctcp = string_to_string(message, @" "); id rest; if ([ctcp isEqualToString: message]) { if ([ctcp hasSuffix: @"\001"]) { ctcp = [ctcp substringToIndex: [ctcp length] - 1]; } rest = nil; } else { NSRange aRange; aRange.location = [ctcp length] + 1; aRange.length = [message length] - aRange.location; if ([message hasSuffix: @"\001"]) { aRange.length--; } if (aRange.length > 0) { rest = [message substringWithRange: aRange]; } else { rest = nil; } } func = NSMapGet(ctcp_to_function, ctcp); if (func) { func(client, prefix, command, rest, [paramList objectAtIndex: 0]); } else { ctcp = [ctcp substringFromIndex: 1]; rec_ccustom(client, prefix, command, rest, [paramList objectAtIndex: 0], ctcp); } return; } if ([command isEqualToString: @"PRIVMSG"]) { [client messageReceived: message to: [paramList objectAtIndex: 0] from: prefix]; } else { [client noticeReceived: message to: [paramList objectAtIndex: 0] from: prefix]; } } static void rec_mode(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { NSArray *newParams; NSUInteger x; if (!prefix) { return; } x = [paramList count]; if (x < 2) { return; } if (x == 2) { newParams = AUTORELEASE([NSArray new]); } else { NSRange aRange; aRange.location = 2; aRange.length = x - 2; newParams = [paramList subarrayWithRange: aRange]; } [client modeChanged: [paramList objectAtIndex: 1] on: [paramList objectAtIndex: 0] withParams: newParams from: prefix]; } static void rec_invite(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if (!prefix) { return; } if ([paramList count] < 2) { return; } [client invitedTo: [paramList objectAtIndex: 1] from: prefix]; } static void rec_kick(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { id object; if (!prefix) { return; } if ([paramList count] < 2) { return; } object = ([paramList count] > 2) ? [paramList objectAtIndex: 2] : nil; [client userKicked: [paramList objectAtIndex: 1] outOf: [paramList objectAtIndex: 0] for: object from: prefix]; } static void rec_ping(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { NSString *arg; arg = [paramList componentsJoinedByString: @" "]; [client pingReceivedWithArgument: arg from: prefix]; } static void rec_pong(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { NSString *arg; arg = [paramList componentsJoinedByString: @" "]; [client pongReceivedWithArgument: arg from: prefix]; } static void rec_wallops(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if (!prefix) { return; } if ([paramList count] < 1) { return; } [client wallopsReceived: [paramList objectAtIndex: 0] from: prefix]; } static void rec_error(IRCObject *client, NSString *command, NSString *prefix, NSArray *paramList) { if ([paramList count] < 1) { return; } [client errorReceived: [paramList objectAtIndex: 0]]; } @implementation IRCObject (InternalIRCObject) - setErrorString: (NSString *)anError { RELEASE(errorString); errorString = RETAIN(anError); return self; } @end @implementation IRCObject + (void)initialize { IRC_new_line = [[NSData alloc] initWithBytes: "\r\n" length: 2]; command_to_function = NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 13); NSMapInsert(command_to_function, @"NICK", rec_nick); NSMapInsert(command_to_function, @"JOIN", rec_join); NSMapInsert(command_to_function, @"PART", rec_part); NSMapInsert(command_to_function, @"QUIT", rec_quit); NSMapInsert(command_to_function, @"TOPIC", rec_topic); NSMapInsert(command_to_function, @"PRIVMSG", rec_privmsg); NSMapInsert(command_to_function, @"NOTICE", rec_privmsg); NSMapInsert(command_to_function, @"MODE", rec_mode); NSMapInsert(command_to_function, @"KICK", rec_kick); NSMapInsert(command_to_function, @"INVITE", rec_invite); NSMapInsert(command_to_function, @"PING", rec_ping); NSMapInsert(command_to_function, @"PONG", rec_pong); NSMapInsert(command_to_function, @"WALLOPS", rec_wallops); NSMapInsert(command_to_function, @"ERROR", rec_error); ctcp_to_function = NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 1); NSMapInsert(ctcp_to_function, @"\001ACTION", rec_caction); } - initWithNickname: (NSString *)aNickname withUserName: (NSString *)aUser withRealName: (NSString *)aRealName withPassword: (NSString *)aPassword { if (!(self = [super init])) return nil; lowercasingSelector = @selector(lowercaseIRCString); defaultEncoding = [NSString defaultCStringEncoding]; if (![self setNick: aNickname]) { [self release]; return nil; } if (![self setUserName: aUser]) { [self release]; return nil; } if (![self setRealName: aRealName]) { [self release]; return nil; } if (![self setPassword: aPassword]) { [self release]; return nil; } targetToEncoding = NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 10); if (!targetToEncoding) { [self release]; return nil; } targetToOriginalTarget = [NSMutableDictionary new]; if (!targetToOriginalTarget) { [self release]; return nil; } return self; } - (void)dealloc { NSFreeMapTable(targetToEncoding); DESTROY(targetToOriginalTarget); DESTROY(nick); DESTROY(userName); DESTROY(realName); DESTROY(password); DESTROY(errorString); [super dealloc]; } - (void)connectionLost { connected = NO; [super connectionLost]; } - (id)setLowercasingSelector: (SEL)aSelector { NSEnumerator *iter; NSString *object; NSString *normal; NSStringEncoding aEncoding; NSMutableDictionary *new; if (aSelector == NULL) { aSelector = @selector(lowercaseIRCString); } new = [NSMutableDictionary new]; iter = [targetToOriginalTarget keyEnumerator]; while ((object = [iter nextObject])) { aEncoding = (NSStringEncoding)NSMapGet(targetToEncoding, object); NSMapRemove(targetToEncoding, object); normal = [targetToOriginalTarget objectForKey: object]; object = [normal performSelector: aSelector]; [new setObject: normal forKey: object]; NSMapInsert(targetToEncoding, object, (void *)aEncoding); } RELEASE(targetToOriginalTarget); targetToOriginalTarget = new; lowercasingSelector = aSelector; return self; } - (SEL)lowercasingSelector { return lowercasingSelector; } - (NSComparisonResult)caseInsensitiveCompare: (NSString *)aString1 to: (NSString *)aString2 { return ([(NSString *)[aString1 performSelector: lowercasingSelector] compare: [aString2 performSelector: lowercasingSelector]]); } - (id)setNick: (NSString *)aNickname { if (aNickname == nick) return self; aNickname = string_to_string(aNickname, @" "); if ([aNickname length] == 0) { [self setErrorString: @"No usable nickname provided"]; return nil; } RELEASE(nick); nick = RETAIN(aNickname); return self; } - (NSString *)nick { return nick; } - (id)setUserName: (NSString *)aUser { if ([aUser length] == 0) { aUser = NSUserName(); if ([aUser length] == 0) { aUser = @"netclasses"; } } if ([(aUser = string_to_string(aUser, @" ")) length] == 0) { aUser = @"netclasses"; } RELEASE(userName); userName = RETAIN(aUser); return self; } - (NSString *)userName { return userName; } - (id)setRealName: (NSString *)aRealName { if ([aRealName length] == 0) { aRealName = @"John Doe"; } RELEASE(realName); realName = RETAIN(aRealName); return self; } - (NSString *)realName { return realName; } - (id)setPassword: (NSString *)aPass { if ([aPass length]) { if ([(aPass = string_to_string(aPass, @" ")) length] == 0) { [self setErrorString: @"Unusable password"]; return nil; } } else { aPass = nil; } DESTROY(password); password = RETAIN(aPass); return self; } - (NSString *)password { return password; } - (NSString *)errorString { return errorString; } - (id)connectionEstablished: (id )aTransport { [super connectionEstablished: aTransport]; [self setLowercasingSelector: @selector(lowercaseIRCString)]; if (password) { [self writeString: [NSString stringWithFormat: @"PASS %@", password]]; } [self changeNick: nick]; [self writeString: @"USER %@ %@ %@ :%@", userName, @"localhost", @"netclasses", realName]; return self; } - (BOOL)connected { return connected; } - (id)setEncoding: (NSStringEncoding)aEncoding { defaultEncoding = aEncoding; return self; } - (id)setEncoding: (NSStringEncoding)aEncoding forTarget: (NSString *)aTarget { NSString *lower = [aTarget performSelector: lowercasingSelector]; if (!lower) return self; NSMapInsert(targetToEncoding, lower, (void *)aEncoding); [targetToOriginalTarget setObject: aTarget forKey: lower]; return self; } - (NSStringEncoding)encoding { return defaultEncoding; } - (NSStringEncoding)encodingForTarget: (NSString *)aTarget { NSString *lower = [aTarget performSelector: lowercasingSelector]; if (!lower) return defaultEncoding; return (NSStringEncoding)NSMapGet(targetToEncoding, lower); } - (void)removeEncodingForTarget: (NSString *)aTarget { NSString *lower = [aTarget performSelector: lowercasingSelector]; if (!lower) return; NSMapRemove(targetToEncoding, lower); [targetToOriginalTarget removeObjectForKey: lower]; } - (NSArray *)targetsWithEncodings { return NSAllMapTableKeys(targetToEncoding); } - (id)changeNick: (NSString *)aNick { if ([aNick length] > 0) { if ([(aNick = string_to_string(aNick, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject changeNick: '%@'] Unusable nickname given", aNick]; } if (!connected) { [self setNick: aNick]; } [self writeString: @"NICK %@", aNick]; } return self; } - (id)quitWithMessage: (NSString *)aMessage { if ([aMessage length] > 0) { [self writeString: @"QUIT :%@", aMessage]; } else { [self writeString: @"QUIT"]; } return self; } - (id)partChannel: (NSString *)aChannel withMessage: (NSString *)aMessage { if ([aChannel length] == 0) { return self; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject partChannel: '%@' ...] Unusable channel given", aChannel]; } if ([aMessage length] > 0) { [self writeString: @"PART %@ :%@", aChannel, aMessage]; } else { [self writeString: @"PART %@", aChannel]; } return self; } - (id)joinChannel: (NSString *)aChannel withPassword: (NSString *)aPassword { if ([aChannel length] == 0) { return self; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject joinChannel: '%@' ...] Unusable channel", aChannel]; } if ([aPassword length] == 0) { [self writeString: @"JOIN %@", aChannel]; return self; } if ([(aPassword = string_to_string(aPassword, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject joinChannel: withPassword: '%@'] Unusable password", aPassword]; } [self writeString: @"JOIN %@ %@", aChannel, aPassword]; return self; } - (id)sendCTCPReply: (NSString *)aCTCP withArgument: (NSString *)args to: (NSString *)aPerson { if ([aPerson length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject sendCTCPReply: '%@'withArgument: '%@' to: '%@'] Unusable receiver", aCTCP, args, aPerson]; } if (!aCTCP) { aCTCP = @""; } if ([args length]) { [self writeString: @"NOTICE %@ :\001%@ %@\001", aPerson, aCTCP, args]; } else { [self writeString: @"NOTICE %@ :\001%@\001", aPerson, aCTCP]; } return self; } - (id)sendCTCPRequest: (NSString *)aCTCP withArgument: (NSString *)args to: (NSString *)aPerson { if ([aPerson length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject sendCTCPRequest: '%@'withArgument: '%@' to: '%@'] Unusable receiver", aCTCP, args, aPerson]; } if (!aCTCP) { aCTCP = @""; } if ([args length]) { [self writeString: @"PRIVMSG %@ :\001%@ %@\001", aPerson, aCTCP, args]; } else { [self writeString: @"PRIVMSG %@ :\001%@\001", aPerson, aCTCP]; } return self; } - (id)sendMessage: (NSString *)aMessage to: (NSString *)aReceiver { if ([aMessage length] == 0) { return self; } if ([aReceiver length] == 0) { return self; } if ([(aReceiver = string_to_string(aReceiver, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject sendMessage: '%@' to: '%@'] Unusable receiver", aMessage, aReceiver]; } [self writeString: @"PRIVMSG %@ :%@", aReceiver, aMessage]; return self; } - (id)sendNotice: (NSString *)aNotice to: (NSString *)aReceiver { if ([aNotice length] == 0) { return self; } if ([aReceiver length] == 0) { return self; } if ([(aReceiver = string_to_string(aReceiver, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject sendNotice: '%@' to: '%@'] Unusable receiver", aNotice, aReceiver]; } [self writeString: @"NOTICE %@ :%@", aReceiver, aNotice]; return self; } - (id)sendAction: (NSString *)anAction to: (NSString *)aReceiver { if ([anAction length] == 0) { return self; } if ([aReceiver length] == 0) { return self; } if ([(aReceiver = string_to_string(aReceiver, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject sendAction: '%@' to: '%@'] Unusable receiver", anAction, aReceiver]; } [self writeString: @"PRIVMSG %@ :\001ACTION %@\001", aReceiver, anAction]; return self; } - (id)becomeOperatorWithName: (NSString *)aName withPassword: (NSString *)aPassword { if (([aName length] == 0) || ([aPassword length] == 0)) { return self; } if ([(aPassword = string_to_string(aPassword, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject becomeOperatorWithName: %@ withPassword: %@] Unusable password", aName, aPassword]; } if ([(aName = string_to_string(aName, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject becomeOperatorWithName: %@ withPassword: %@] Unusable name", aName, aPassword]; } [self writeString: @"OPER %@ %@", aName, aPassword]; return self; } - (id)requestNamesOnChannel: (NSString *)aChannel { if ([aChannel length] == 0) { [self writeString: @"NAMES"]; return self; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestNamesOnChannel: %@] Unusable channel", aChannel]; } [self writeString: @"NAMES %@", aChannel]; return self; } - (id)requestMOTDOnServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"MOTD"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestMOTDOnServer:'%@'] Unusable server", aServer]; } [self writeString: @"MOTD %@", aServer]; return self; } - (id)requestSizeInformationFromServer: (NSString *)aServer andForwardTo: (NSString *)anotherServer { if ([aServer length] == 0) { [self writeString: @"LUSERS"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestSizeInformationFromServer: '%@' andForwardTo: '%@'] Unusable first server", aServer, anotherServer]; } if ([anotherServer length] == 0) { [self writeString: @"LUSERS %@", aServer]; return self; } if ([(anotherServer = string_to_string(anotherServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestSizeInformationFromServer: '%@' andForwardTo: '%@'] Unusable second server", aServer, anotherServer]; } [self writeString: @"LUSERS %@ %@", aServer, anotherServer]; return self; } - (id)requestVersionOfServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"VERSION"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestVersionOfServer: '%@'] Unusable server", aServer]; } [self writeString: @"VERSION %@", aServer]; return self; } - (id)requestServerStats: (NSString *)aServer for: (NSString *)query { if ([query length] == 0) { [self writeString: @"STATS"]; return self; } if ([(query = string_to_string(query, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerStats: '%@' for: '%@'] Unusable query", aServer, query]; } if ([aServer length] == 0) { [self writeString: @"STATS %@", query]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerStats: '%@' for: '%@'] Unusable server", aServer, query]; } [self writeString: @"STATS %@ %@", query, aServer]; return self; } - (id)requestServerLink: (NSString *)aLink from: (NSString *)aServer { if ([aLink length] == 0) { [self writeString: @"LINKS"]; return self; } if ([(aLink = string_to_string(aLink, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerLink: '%@' from: '%@'] Unusable link", aLink, aServer]; } if ([aServer length] == 0) { [self writeString: @"LINKS %@", aLink]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerLink: '%@' from: '%@'] Unusable server", aLink, aServer]; } [self writeString: @"LINKS %@ %@", aServer, aLink]; return self; } - (id)requestTimeOnServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"TIME"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestTimeOnServer: '%@'] Unusable server", aServer]; } [self writeString: @"TIME %@", aServer]; return self; } - (id)requestServerToConnect: (NSString *)aServer to: (NSString *)connectServer onPort: (NSString *)aPort { if ([connectServer length] == 0) { return self; } if ([(connectServer = string_to_string(connectServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerToConnect: '%@' to: '%@' onPort: '%@'] Unusable second server", aServer, connectServer, aPort]; } if ([aPort length] == 0) { return self; } if ([(aPort = string_to_string(aPort, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerToConnect: '%@' to: '%@' onPort: '%@'] Unusable port", aServer, connectServer, aPort]; } if ([aServer length] == 0) { [self writeString: @"CONNECT %@ %@", connectServer, aPort]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestServerToConnect: '%@' to: '%@' onPort: '%@'] Unusable first server", aServer, connectServer, aPort]; } [self writeString: @"CONNECT %@ %@ %@", connectServer, aPort, aServer]; return self; } - (id)requestTraceOnServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"TRACE"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestTraceOnServer: '%@'] Unusable server", aServer]; } [self writeString: @"TRACE %@", aServer]; return self; } - (id)requestAdministratorOnServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"ADMIN"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestAdministratorOnServer: '%@'] Unusable server", aServer]; } [self writeString: @"ADMIN %@", aServer]; return self; } - (id)requestInfoOnServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"INFO"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestInfoOnServer: '%@'] Unusable server", aServer]; } [self writeString: @"INFO %@", aServer]; return self; } - (id)requestServerRehash { [self writeString: @"REHASH"]; return self; } - (id)requestServerShutdown { [self writeString: @"DIE"]; return self; } - (id)requestServerRestart { [self writeString: @"RESTART"]; return self; } - (id)requestUserInfoOnServer: (NSString *)aServer { if ([aServer length] == 0) { [self writeString: @"USERS"]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject requestUserInfoOnServer: '%@'] Unusable server", aServer]; } [self writeString: @"USERS %@", aServer]; return self; } - (id)areUsersOn: (NSString *)userList { if ([userList length] == 0) { return self; } [self writeString: @"ISON %@", userList]; return self; } - (id)sendWallops: (NSString *)aMessage { if ([aMessage length] == 0) { return self; } [self writeString: @"WALLOPS :%@", aMessage]; return self; } - (id)listWho: (NSString *)aMask onlyOperators: (BOOL)operators { if ([aMask length] == 0) { [self writeString: @"WHO"]; return self; } if ([(aMask = string_to_string(aMask, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject listWho: '%@' onlyOperators: %d] Unusable mask", aMask, operators]; } if (operators) { [self writeString: @"WHO %@ o", aMask]; } else { [self writeString: @"WHO %@", aMask]; } return self; } - (id)whois: (NSString *)aPerson onServer: (NSString *)aServer { if ([aPerson length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject whois: '%@' onServer: '%@'] Unusable person", aPerson, aServer]; } if ([aServer length] == 0) { [self writeString: @"WHOIS %@", aPerson]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject whois: '%@' onServer: '%@'] Unusable server", aPerson, aServer]; } [self writeString: @"WHOIS %@ %@", aServer, aPerson]; return self; } - (id)whowas: (NSString *)aPerson onServer: (NSString *)aServer withNumberEntries: (NSString *)aNumber { if ([aPerson length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject whowas: '%@' onServer: '%@' withNumberEntries: '%@'] Unusable person", aPerson, aServer, aNumber]; } if ([aNumber length] == 0) { [self writeString: @"WHOWAS %@", aPerson]; return self; } if ([(aNumber = string_to_string(aNumber, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject whowas: '%@' onServer: '%@' withNumberEntries: '%@'] Unusable number of entries", aPerson, aServer, aNumber]; } if ([aServer length] == 0) { [self writeString: @"WHOWAS %@ %@", aPerson, aNumber]; return self; } if ([(aServer = string_to_string(aServer, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject whowas: '%@' onServer: '%@' withNumberEntries: '%@'] Unusable server", aPerson, aServer, aNumber]; } [self writeString: @"WHOWAS %@ %@ %@", aPerson, aNumber, aServer]; return self; } - (id)kill: (NSString *)aPerson withComment: (NSString *)aComment { if ([aPerson length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject kill: '%@' withComment: '%@'] Unusable person", aPerson, aComment]; } if ([aComment length] == 0) { return self; } [self writeString: @"KILL %@ :%@", aPerson, aComment]; return self; } - (id)setTopicForChannel: (NSString *)aChannel to: (NSString *)aTopic { if ([aChannel length] == 0) { return self; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject setTopicForChannel: %@ to: %@] Unusable channel", aChannel, aTopic]; } if ([aTopic length] == 0) { [self writeString: @"TOPIC %@", aChannel]; } else { [self writeString: @"TOPIC %@ :%@", aChannel, aTopic]; } return self; } - (id)setMode: (NSString *)aMode on: (NSString *)anObject withParams: (NSArray *)aList { NSMutableString *aString; NSEnumerator *iter; id object; if ([anObject length] == 0) { return self; } if ([(anObject = string_to_string(anObject, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject setMode:'%@' on:'%@' withParams:'%@'] Unusable object", aMode, anObject, aList]; } if ([aMode length] == 0) { [self writeString: @"MODE %@", anObject]; return self; } if ([(aMode = string_to_string(aMode, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject setMode:'%@' on:'%@' withParams:'%@'] Unusable mode", aMode, anObject, aList]; } if (!aList) { [self writeString: @"MODE %@ %@", anObject, aMode]; return self; } aString = [NSMutableString stringWithFormat: @"MODE %@ %@", anObject, aMode]; iter = [aList objectEnumerator]; while ((object = [iter nextObject])) { [aString appendString: @" "]; [aString appendString: object]; } [self writeString: @"%@", aString]; return self; } - (id)listChannel: (NSString *)aChannel onServer: (NSString *)aServer { if ([aChannel length] == 0) { [self writeString: @"LIST"]; return self; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject listChannel:'%@' onServer:'%@'] Unusable channel", aChannel, aServer]; } if ([aServer length] == 0) { [self writeString: @"LIST %@", aChannel]; return self; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject listChannel:'%@' onServer:'%@'] Unusable server", aChannel, aServer]; } [self writeString: @"LIST %@ %@", aChannel, aServer]; return self; } - (id)invite: (NSString *)aPerson to: (NSString *)aChannel { if ([aPerson length] == 0) { return self; } if ([aChannel length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject invite:'%@' to:'%@'] Unusable person", aPerson, aChannel]; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject invite:'%@' to:'%@'] Unusable channel", aPerson, aChannel]; } [self writeString: @"INVITE %@ %@", aPerson, aChannel]; return self; } - (id)kick: (NSString *)aPerson offOf: (NSString *)aChannel for: (NSString *)aReason { if ([aPerson length] == 0) { return self; } if ([aChannel length] == 0) { return self; } if ([(aPerson = string_to_string(aPerson, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject kick:'%@' offOf:'%@' for:'%@'] Unusable person", aPerson, aChannel, aReason]; } if ([(aChannel = string_to_string(aChannel, @" ")) length] == 0) { [NSException raise: IRCException format: @"[IRCObject kick:'%@' offOf:'%@' for:'%@'] Unusable channel", aPerson, aChannel, aReason]; } if ([aReason length] == 0) { [self writeString: @"KICK %@ %@", aChannel, aPerson]; return self; } [self writeString: @"KICK %@ %@ :%@", aChannel, aPerson, aReason]; return self; } - (id)setAwayWithMessage: (NSString *)aMessage { if ([aMessage length] == 0) { [self writeString: @"AWAY"]; return self; } [self writeString: @"AWAY :%@", aMessage]; return self; } - (id)sendPingWithArgument: (NSString *)aString { if (!aString) { aString = @""; } [self writeString: @"PING :%@", aString]; return self; } - (id)sendPongWithArgument: (NSString *)aString { if (!aString) { aString = @""; } [self writeString: @"PONG :%@", aString]; return self; } @end @implementation IRCObject (Callbacks) - (id)registeredWithServer { return self; } - (id)couldNotRegister: (NSString *)aReason { return self; } - (id)CTCPRequestReceived: (NSString *)aCTCP withArgument: (NSString *)anArgument to: (NSString *)aReceiver from: (NSString *)aPerson { return self; } - (id)CTCPReplyReceived: (NSString *)aCTCP withArgument: (NSString *)anArgument to: (NSString *)aReceiver from: (NSString *)aPerson { return self; } - (id)errorReceived: (NSString *)anError { return self; } - (id)wallopsReceived: (NSString *)aMessage from: (NSString *)aSender { return self; } - (id)userKicked: (NSString *)aPerson outOf: (NSString *)aChannel for: (NSString *)aReason from: (NSString *)aKicker { return self; } - (id)invitedTo: (NSString *)aChannel from: (NSString *)anInviter { return self; } - (id)modeChanged: (NSString *)aMode on: (NSString *)anObject withParams: (NSArray *)paramList from: (NSString *)aPerson { return self; } - (id)numericCommandReceived: (NSString *)aCommand withParams: (NSArray *)paramList from: (NSString *)aSender { return self; } - (id)nickChangedTo: (NSString *)newName from: (NSString *)aPerson { return self; } - (id)channelJoined: (NSString *)aChannel from: (NSString *)aJoiner { return self; } - (id)channelParted: (NSString *)aChannel withMessage: (NSString *)aMessage from: (NSString *)aParter { return self; } - (id)quitIRCWithMessage: (NSString *)aMessage from: (NSString *)aQuitter { return self; } - (id)topicChangedTo: (NSString *)aTopic in: (NSString *)aChannel from: (NSString *)aPerson { return self; } - (id)messageReceived: (NSString *)aMessage to: (NSString *)aReceiver from: (NSString *)aSender { return self; } - (id)noticeReceived: (NSString *)aNotice to: (NSString *)aReceiver from: (NSString *)aSender { return self; } - (id)actionReceived: (NSString *)anAction to: (NSString *)aReceiver from: (NSString *)aSender { return self; } - (id)pingReceivedWithArgument: (NSString *)anArgument from: (NSString *)aSender { return self; } - (id)pongReceivedWithArgument: (NSString *)anArgument from: (NSString *)aSender { return self; } - (id)newNickNeededWhileRegistering { [self changeNick: [NSString stringWithFormat: @"%@_", nick]]; return self; } @end @implementation IRCObject (LowLevel) - (id)lineReceived: (NSData *)aLine { NSString *prefix = nil; NSString *command = nil; NSMutableArray *paramList = nil; id object; void (*function)(IRCObject *, NSString *, NSString *, NSArray *); NSString *line, *orig; orig = line = AUTORELEASE([[NSString alloc] initWithData: aLine encoding: defaultEncoding]); if ([line length] == 0) { return self; } paramList = AUTORELEASE([NSMutableArray new]); line = get_IRC_prefix(line, &prefix); if ([line length] == 0) { [NSException raise: IRCException format: @"[IRCObject lineReceived: '%@'] Line ended prematurely.", orig]; } line = get_next_IRC_word(line, &command); if (command == nil) { [NSException raise: IRCException format: @"[IRCObject lineReceived: '%@'] Line ended prematurely.", orig]; } while (1) { line = get_next_IRC_word(line, &object); if (!object) { break; } [paramList addObject: object]; } if (is_numeric_command(command)) { if ([paramList count] >= 2) { NSRange aRange; [self setNick: [paramList objectAtIndex: 0]]; aRange.location = 1; aRange.length = [paramList count] - 1; rec_numeric(self, command, prefix, [paramList subarrayWithRange: aRange]); } } else { function = NSMapGet(command_to_function, command); if (function != 0) { function(self, command, prefix, paramList); } else { NSLog(@"Could not handle :%@ %@ %@", prefix, command, paramList); } } if (!connected) { if ([command isEqualToString: ERR_NEEDMOREPARAMS] || [command isEqualToString: ERR_ALREADYREGISTRED] || [command isEqualToString: ERR_NONICKNAMEGIVEN]) { [[NetApplication sharedInstance] disconnectObject: self]; [self couldNotRegister: [NSString stringWithFormat: @"%@ %@ %@", prefix, command, paramList]]; return nil; } else if ([command isEqualToString: ERR_NICKNAMEINUSE] || [command isEqualToString: ERR_NICKCOLLISION] || [command isEqualToString: ERR_ERRONEUSNICKNAME]) { [self newNickNeededWhileRegistering]; } else if ([command isEqualToString: RPL_WELCOME]) { connected = YES; [self registeredWithServer]; } } return self; } - (id)writeString: (NSString *)format, ... { NSString *temp; va_list ap; va_start(ap, format); temp = AUTORELEASE([[NSString alloc] initWithFormat: format arguments: ap]); [(id )transport writeData: [temp dataUsingEncoding: defaultEncoding]]; if (![temp hasSuffix: @"\r\n"]) { [(id )transport writeData: IRC_new_line]; } return self; } @end NSString *RPL_WELCOME = @"001"; NSString *RPL_YOURHOST = @"002"; NSString *RPL_CREATED = @"003"; NSString *RPL_MYINFO = @"004"; NSString *RPL_BOUNCE = @"005"; NSString *RPL_ISUPPORT = @"005"; NSString *RPL_USERHOST = @"302"; NSString *RPL_ISON = @"303"; NSString *RPL_AWAY = @"301"; NSString *RPL_UNAWAY = @"305"; NSString *RPL_NOWAWAY = @"306"; NSString *RPL_WHOISUSER = @"311"; NSString *RPL_WHOISSERVER = @"312"; NSString *RPL_WHOISOPERATOR = @"313"; NSString *RPL_WHOISIDLE = @"317"; NSString *RPL_ENDOFWHOIS = @"318"; NSString *RPL_WHOISCHANNELS = @"319"; NSString *RPL_WHOWASUSER = @"314"; NSString *RPL_ENDOFWHOWAS = @"369"; NSString *RPL_LISTSTART = @"321"; NSString *RPL_LIST = @"322"; NSString *RPL_LISTEND = @"323"; NSString *RPL_UNIQOPIS = @"325"; NSString *RPL_CHANNELMODEIS = @"324"; NSString *RPL_NOTOPIC = @"331"; NSString *RPL_TOPIC = @"332"; NSString *RPL_INVITING = @"341"; NSString *RPL_SUMMONING = @"342"; NSString *RPL_INVITELIST = @"346"; NSString *RPL_ENDOFINVITELIST = @"347"; NSString *RPL_EXCEPTLIST = @"348"; NSString *RPL_ENDOFEXCEPTLIST = @"349"; NSString *RPL_VERSION = @"351"; NSString *RPL_WHOREPLY = @"352"; NSString *RPL_ENDOFWHO = @"315"; NSString *RPL_NAMREPLY = @"353"; NSString *RPL_ENDOFNAMES = @"366"; NSString *RPL_LINKS = @"364"; NSString *RPL_ENDOFLINKS = @"365"; NSString *RPL_BANLIST = @"367"; NSString *RPL_ENDOFBANLIST = @"368"; NSString *RPL_INFO = @"371"; NSString *RPL_ENDOFINFO = @"374"; NSString *RPL_MOTDSTART = @"375"; NSString *RPL_MOTD = @"372"; NSString *RPL_ENDOFMOTD = @"376"; NSString *RPL_YOUREOPER = @"381"; NSString *RPL_REHASHING = @"382"; NSString *RPL_YOURESERVICE = @"383"; NSString *RPL_TIME = @"391"; NSString *RPL_USERSSTART = @"392"; NSString *RPL_USERS = @"393"; NSString *RPL_ENDOFUSERS = @"394"; NSString *RPL_NOUSERS = @"395"; NSString *RPL_TRACELINK = @"200"; NSString *RPL_TRACECONNECTING = @"201"; NSString *RPL_TRACEHANDSHAKE = @"202"; NSString *RPL_TRACEUNKNOWN = @"203"; NSString *RPL_TRACEOPERATOR = @"204"; NSString *RPL_TRACEUSER = @"205"; NSString *RPL_TRACESERVER = @"206"; NSString *RPL_TRACESERVICE = @"207"; NSString *RPL_TRACENEWTYPE = @"208"; NSString *RPL_TRACECLASS = @"209"; NSString *RPL_TRACERECONNECT = @"210"; NSString *RPL_TRACELOG = @"261"; NSString *RPL_TRACEEND = @"262"; NSString *RPL_STATSLINKINFO = @"211"; NSString *RPL_STATSCOMMANDS = @"212"; NSString *RPL_ENDOFSTATS = @"219"; NSString *RPL_STATSUPTIME = @"242"; NSString *RPL_STATSOLINE = @"243"; NSString *RPL_UMODEIS = @"221"; NSString *RPL_SERVLIST = @"234"; NSString *RPL_SERVLISTEND = @"235"; NSString *RPL_LUSERCLIENT = @"251"; NSString *RPL_LUSEROP = @"252"; NSString *RPL_LUSERUNKNOWN = @"253"; NSString *RPL_LUSERCHANNELS = @"254"; NSString *RPL_LUSERME = @"255"; NSString *RPL_ADMINME = @"256"; NSString *RPL_ADMINLOC1 = @"257"; NSString *RPL_ADMINLOC2 = @"258"; NSString *RPL_ADMINEMAIL = @"259"; NSString *RPL_TRYAGAIN = @"263"; NSString *ERR_NOSUCHNICK = @"401"; NSString *ERR_NOSUCHSERVER = @"402"; NSString *ERR_NOSUCHCHANNEL = @"403"; NSString *ERR_CANNOTSENDTOCHAN = @"404"; NSString *ERR_TOOMANYCHANNELS = @"405"; NSString *ERR_WASNOSUCHNICK = @"406"; NSString *ERR_TOOMANYTARGETS = @"407"; NSString *ERR_NOSUCHSERVICE = @"408"; NSString *ERR_NOORIGIN = @"409"; NSString *ERR_NORECIPIENT = @"411"; NSString *ERR_NOTEXTTOSEND = @"412"; NSString *ERR_NOTOPLEVEL = @"413"; NSString *ERR_WILDTOPLEVEL = @"414"; NSString *ERR_BADMASK = @"415"; NSString *ERR_UNKNOWNCOMMAND = @"421"; NSString *ERR_NOMOTD = @"422"; NSString *ERR_NOADMININFO = @"423"; NSString *ERR_FILEERROR = @"424"; NSString *ERR_NONICKNAMEGIVEN = @"431"; NSString *ERR_ERRONEUSNICKNAME = @"432"; NSString *ERR_NICKNAMEINUSE = @"433"; NSString *ERR_NICKCOLLISION = @"436"; NSString *ERR_UNAVAILRESOURCE = @"437"; NSString *ERR_USERNOTINCHANNEL = @"441"; NSString *ERR_NOTONCHANNEL = @"442"; NSString *ERR_USERONCHANNEL = @"443"; NSString *ERR_NOLOGIN = @"444"; NSString *ERR_SUMMONDISABLED = @"445"; NSString *ERR_USERSDISABLED = @"446"; NSString *ERR_NOTREGISTERED = @"451"; NSString *ERR_NEEDMOREPARAMS = @"461"; NSString *ERR_ALREADYREGISTRED = @"462"; NSString *ERR_NOPERMFORHOST = @"463"; NSString *ERR_PASSWDMISMATCH = @"464"; NSString *ERR_YOUREBANNEDCREEP = @"465"; NSString *ERR_YOUWILLBEBANNED = @"466"; NSString *ERR_KEYSET = @"467"; NSString *ERR_CHANNELISFULL = @"471"; NSString *ERR_UNKNOWNMODE = @"472"; NSString *ERR_INVITEONLYCHAN = @"473"; NSString *ERR_BANNEDFROMCHAN = @"474"; NSString *ERR_BADCHANNELKEY = @"475"; NSString *ERR_BADCHANMASK = @"476"; NSString *ERR_NOCHANMODES = @"477"; NSString *ERR_BANLISTFULL = @"478"; NSString *ERR_NOPRIVILEGES = @"481"; NSString *ERR_CHANOPRIVSNEEDED = @"482"; NSString *ERR_CANTKILLSERVER = @"483"; NSString *ERR_RESTRICTED = @"484"; NSString *ERR_UNIQOPPRIVSNEEDED = @"485"; NSString *ERR_NOOPERHOST = @"491"; NSString *ERR_UMODEUNKNOWNFLAG = @"501"; NSString *ERR_USERSDONTMATCH = @"502"; NSString *RPL_SERVICEINFO = @"231"; NSString *RPL_ENDOFSERVICES = @"232"; NSString *RPL_SERVICE = @"233"; NSString *RPL_NONE = @"300"; NSString *RPL_WHOISCHANOP = @"316"; NSString *RPL_KILLDONE = @"361"; NSString *RPL_CLOSING = @"262"; NSString *RPL_CLOSEEND = @"363"; NSString *RPL_INFOSTART = @"373"; NSString *RPL_MYPORTIS = @"384"; NSString *RPL_STATSCLINE = @"213"; NSString *RPL_STATSNLINE = @"214"; NSString *RPL_STATSILINE = @"215"; NSString *RPL_STATSKLINE = @"216"; NSString *RPL_STATSQLINE = @"217"; NSString *RPL_STATSYLINE = @"218"; NSString *RPL_STATSVLINE = @"240"; NSString *RPL_STATSLLINE = @"241"; NSString *RPL_STATSHLINE = @"244"; NSString *RPL_STATSSLINE = @"245"; NSString *RPL_STATSPING = @"246"; NSString *RPL_STATSBLINE = @"247"; NSString *RPL_STATSDLINE = @"250"; NSString *ERR_NOSERVICEHOST = @"492"; netclasses-1.1.0/Source/GNUmakefile.in0000644000175000001440000000054512503215220017031 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make FRAMEWORK_NAME = netclasses VERSION = @PACKAGE_VERSION@ netclasses_OBJC_FILES = NetBase.m NetTCP.m LineObject.m IRCObject.m netclasses_HEADER_FILES = NetBase.h NetTCP.h IRCObject.h LineObject.h GUI_LIB = -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/framework.make -include GNUmakefile.postamble netclasses-1.1.0/ChangeLog0000644000175000001440000000203012503215220014653 0ustar multixusers2015-02-28 Riccardo Mottola * Source/NetBase.m Cast to intptr_t to avoid compiler warnings (Yavor Doganov) 2015-02-22 Riccardo Mottola * Source/IRCObject.m (contains_a_space) Remove unusd function contains_a_space. 2015-01-05 Riccardo Mottola * Source/NetBase.h * Source/NetTCP.h * Source/NetTCP.m Explicit newConnection return type and protocol. 2015-01-05 Riccardo Mottola * configure.ac * GNUmakefile.in * Source/GNUmakefile.in Define VERSION and INTERFACE_VERSION, bump release to 1.1.0 2015-01-05 Riccardo Mottola * Source/NetTCP.h * Source/NetTCP.m Explicit types. 2013-10-19 Riccardo Mottola * Source/NetBase.h Defines for old Macs. 2013-09-17 Riccardo Mottola * Source/IRCObject.m Fix broken log format. 2013-09-09 Riccardo Mottola * Source/IRCObject.m NSUInteger fixes. 2013-09-09 Riccardo Mottola * Source/IRCObject.h * Source/IRCObject.m Explicit return type (id) in signatures. netclasses-1.1.0/configure0000755000175000001440000035254612503215220015034 0ustar multixusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for netclasses 1.1.0. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='netclasses' PACKAGE_TARNAME='netclasses' PACKAGE_VERSION='1.1.0' PACKAGE_STRING='netclasses 1.1.0' PACKAGE_BUGREPORT='aeruder@ksu.edu' ac_unique_file="Source/NetBase.m" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures netclasses 1.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of netclasses 1.1.0:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF netclasses configure 1.1.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by netclasses $as_me 1.1.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers Source/config.h" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/types.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to aeruder@ksu.edu ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi ac_config_files="$ac_config_files GNUmakefile Source/GNUmakefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by netclasses $as_me 1.1.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ netclasses config.status 1.1.0. configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;; "Source/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES Source/GNUmakefile" ;; "Source/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS Source/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi netclasses-1.1.0/README.osx0000644000175000001440000000701012345537310014607 0ustar multixusersnetclasses is a small framework of asynchronous Objective-C networking classes =============================================================================== Copyright (C) 2005 Andrew Ruder netclasses 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 program 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 General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA Comments are welcome. =============================================================================== **** First off, let me say that since I do not own and never have owned a Mac I have absolutely no way to actually maintain proper building methods on OSX. Therefore, building on OSX will be limited to gnustep-make style compilations. Secondly, if you cannot understand the instructions herein, please download the binaries rather than wasting my time with issues related to lack of skill with unix-like systems and the command line environment. The binaries are the recommended way of dealing with netclasses on OS X. You have been warned. **** Step 1: Download gnustep-make from http://www.gnustep.org. You do not need gnustep-base or gnustep-gui; all you need is gnustep-make. Read the included documentation and proceed with its installation. Most of the time, this is what is required: Untar the gnustep-make package, cd to the directory it untarred into. ./configure make sudo make install . /usr/GNUstep/System/Library/Makefiles/GNUstep.sh The last line MUST be done on every new shell before compiling anything with gnustep-make, I would recommend putting this in your .bashrc file in your home directory. Step 2: Set GNUSTEP_INSTALLATION_DIR to the root directory that you wish to install to. All directories will be based off this root directory. If you wish to install into the standard location for frameworks, you probably want GNUSTEP_INSTALLATION_DIR=/. If you do not have administrator rights, you will need to use GNUSTEP_INSTALLATION_DIR=$HOME Step 3: Generate the autoconfigure stuff: ./configure One note about ./configure, I am not using it for makefiles, so the --prefix and other flags will have -no- effect on the output. It is only used to check for various types and headers. Type make followed by make install. netclasses should be installed. You will not be able to build the documentation without gnustep-base installed. It is recommended to download the documentation off the website (http://netclasses.aeruder.net). Example: The following commands will work in most cases: make install GNUSTEP_INSTALLATION_DIR=/ or make install GNUSTEP_INSTALLATION_DIR=$HOME Conclusion: Have fun! If you got through this successfully you are ready to start developing with netclasses. If you didn't, just give in already and get the binaries! I already went through the pain of getting them to compile so you don't have to. =============================================================================== Copyright (C) 2005 by Andy Ruder aeruder@ksu.edu http://netclasses.aeruder.net netclasses-1.1.0/Examples/0000755000175000001440000000000012345537311014700 5ustar multixusersnetclasses-1.1.0/Examples/GNUmakefile.postamble0000644000175000001440000000016712345537311020743 0ustar multixusersafter-clean:: $(MAKE) -C Skeleton -f GNUmakefile clean after-distclean:: $(MAKE) -C Skeleton -f GNUmakefile clean netclasses-1.1.0/Examples/Skeleton/0000755000175000001440000000000012345537311016464 5ustar multixusersnetclasses-1.1.0/Examples/Skeleton/GNUmakefile.preamble0000644000175000001440000000026712345537311022331 0ustar multixusersADDITIONAL_OBJCFLAGS = -Wall ifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_OBJCFLAGS += -include GNUstep.h $(ADDITIONAL_FRAMEWORK_DIRS) ADDITIONAL_INCLUDE_DIRS = -I../../Misc endif netclasses-1.1.0/Examples/Skeleton/GNUmakefile0000644000175000001440000000050712345537311020540 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = Skeleton Skeleton_OBJC_FILES = main.m GUI_LIB = ifeq ($(OBJC_RUNTIME_LIB), apple) Skeleton_TOOL_LIBS = -framework netclasses $(ADDITIONAL_FRAMEWORK_DIRS) else Skeleton_TOOL_LIBS = -lnetclasses endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make netclasses-1.1.0/Examples/Skeleton/main.m0000644000175000001440000000211312345537311017563 0ustar multixusers/*************************************************************************** main.m ------------------- begin : Sun Apr 28 21:18:23 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import int main(int argc, char **argv, char **env) { return 0; } netclasses-1.1.0/Examples/GNUmakefile0000644000175000001440000000024112345537311016747 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS = EchoServ IRCBot SimpleClient include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble netclasses-1.1.0/Examples/IRCBot/0000755000175000001440000000000012345537311015762 5ustar multixusersnetclasses-1.1.0/Examples/IRCBot/GNUmakefile.preamble0000644000175000001440000000026712345537311021627 0ustar multixusersADDITIONAL_OBJCFLAGS = -Wall ifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_OBJCFLAGS += -include GNUstep.h $(ADDITIONAL_FRAMEWORK_DIRS) ADDITIONAL_INCLUDE_DIRS = -I../../Misc endif netclasses-1.1.0/Examples/IRCBot/IRCBot.m0000644000175000001440000000775612345537311017241 0ustar multixusers/*************************************************************************** IRCBot.m ------------------- begin : Wed Jun 5 03:28:59 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "IRCBot.h" #import #import #import #import #include #include #include static inline NSData *chomp_line(NSMutableData *data) { char *memory = [data mutableBytes]; char *memoryEnd = memory + [data length]; char *lineEndWithControls; char *lineEnd; int tempLength; id lineData; lineEndWithControls = lineEnd = memchr(memory, '\n', memoryEnd - memory); if (!lineEnd) { return nil; } while (((*lineEnd == '\n') || (*lineEnd == '\r')) && (lineEnd >= memory)) { lineEnd--; } lineData = [NSData dataWithBytes: memory length: lineEnd - memory + 1]; tempLength = memoryEnd - lineEndWithControls - 1; memmove(memory, lineEndWithControls + 1, tempLength); [data setLength: tempLength]; return lineData; } @implementation IRCBot - connectionEstablished: (id )aTransport { return [super connectionEstablished: aTransport]; } - (void)connectionLost { [super connectionLost]; } - registeredWithServer { [self joinChannel: @"#gnustep,#netclasses" withPassword: nil]; return self; } - CTCPRequestReceived: (NSString *)aCTCP withArgument: (NSString *)argument to: (NSString *)aReceiver from: (NSString *)aPerson { if ([aCTCP compare: @"PING"] == NSOrderedSame) { [self sendCTCPReply: @"PING" withArgument: argument to: ExtractIRCNick(aPerson)]; } if ([aCTCP compare: @"VERSION"] == NSOrderedSame) { NSString *version, *reply; version = [NetApplication netclassesVersion]; reply = [NSString stringWithFormat: @"netclasses:%@:GNUstep", version]; [self sendCTCPReply: @"VERSION" withArgument: reply to: ExtractIRCNick(aPerson)]; } return self; } - pingReceivedWithArgument: (NSString *)anArgument from: (NSString *)aSender { [self sendPongWithArgument: anArgument]; return self; } - messageReceived: (NSString *)aMessage to: (NSString *)to from: (NSString *)whom { NSString *sendTo = ExtractIRCNick(whom); if ([nick caseInsensitiveCompare: to] != NSOrderedSame) { return self; // Only accepts private messages } if ([aMessage caseInsensitiveCompare: @"quit"] == NSOrderedSame) { [self sendMessage: @"Quitting..." to: sendTo]; [self quitWithMessage: [NSString stringWithFormat: @"Quit requested by %@", sendTo]]; return self; } else if ([aMessage caseInsensitiveCompare: @"fortune"] == NSOrderedSame) { if (sendTo == to) { return self; } int read; FILE *fortune; NSMutableData *input = [NSMutableData dataWithLength: 4000]; id line; fortune = popen("fortune", "r"); do { read = fread([input mutableBytes], sizeof(char), 4000, fortune); while ((line = chomp_line(input))) { [self sendMessage: [NSString stringWithCString: [line bytes] length: [line length]] to: sendTo]; } } while(read == 4000); [self sendMessage: [NSString stringWithCString: [line bytes] length: [line length]] to: sendTo]; pclose(fortune); return self; } return self; } @end netclasses-1.1.0/Examples/IRCBot/GNUmakefile0000644000175000001440000000051012345537311020030 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = IRCBot IRCBot_OBJC_FILES = main.m IRCBot.m ifeq ($(OBJC_RUNTIME_LIB), apple) IRCBot_TOOL_LIBS = -framework netclasses $(ADDITIONAL_FRAMEWORK_DIRS) else IRCBot_TOOL_LIBS = -lnetclasses endif GUI_LIB = -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make netclasses-1.1.0/Examples/IRCBot/main.m0000644000175000001440000000351612345537311017071 0ustar multixusers/*************************************************************************** main.m ------------------- begin : Sun Apr 28 21:18:23 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "IRCBot.h" #import #import #import #import #import #import #include #include int main(int argc, char **argv, char **env) { id connection; CREATE_AUTORELEASE_POOL(arp); srand(time(0) ^ gethostid() % getpid()); NSLog(@"Connecting to irc.freenode.net 6667..."); connection = [[IRCBot alloc] initWithNickname: @"NetNiles" withUserName: nil withRealName: @"Andy Ruder" withPassword: nil]; [[TCPSystem sharedInstance] connectNetObjectInBackground: connection toHost: [NSHost hostWithName: @"irc.freenode.net"] onPort: 6667 withTimeout: 30]; NSLog(@"Connection being established..."); [[NSRunLoop currentRunLoop] run]; RELEASE(arp); return 0; } netclasses-1.1.0/Examples/IRCBot/IRCBot.h0000644000175000001440000000221212345537311017212 0ustar multixusers/*************************************************************************** IRCBot.h ------------------- begin : Wed Jun 5 03:28:59 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ @class IRCBot; #ifndef IRCBOT_H #define IRCBOT_H #import @class NSString; @interface IRCBot : IRCObject { } @end #endif netclasses-1.1.0/Examples/EchoServ/0000755000175000001440000000000012345537311016416 5ustar multixusersnetclasses-1.1.0/Examples/EchoServ/GNUmakefile.preamble0000644000175000001440000000026712345537311022263 0ustar multixusersADDITIONAL_OBJCFLAGS = -Wall ifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_OBJCFLAGS += -include GNUstep.h $(ADDITIONAL_FRAMEWORK_DIRS) ADDITIONAL_INCLUDE_DIRS = -I../../Misc endif netclasses-1.1.0/Examples/EchoServ/EchoServ.h0000644000175000001440000000247512345537311020315 0ustar multixusers/*************************************************************************** EchoServ.h ------------------- begin : Sun Apr 28 21:18:22 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ @class EchoServ; #ifndef ECHO_SERV_H #define ECHO_SERV_H #import #import @class NSData; @interface EchoServ : NSObject < NetObject > { id transport; } - (void)connectionLost; - connectionEstablished: aTransport; - dataReceived: (NSData *)data; - (id)transport; @end #endif netclasses-1.1.0/Examples/EchoServ/GNUmakefile0000644000175000001440000000052212345537311020467 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = EchoServ EchoServ_OBJC_FILES = main.m EchoServ.m GUI_LIB = ifeq ($(OBJC_RUNTIME_LIB), apple) EchoServ_TOOL_LIBS = -framework netclasses $(ADDITIONAL_FRAMEWORK_DIRS) else EchoServ_TOOL_LIBS = -lnetclasses endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make netclasses-1.1.0/Examples/EchoServ/main.m0000644000175000001440000000303312345537311017517 0ustar multixusers/*************************************************************************** main.m ------------------- begin : Sun Apr 28 21:18:23 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "EchoServ.h" #import #import #import #import int main(int argc, char **argv, char **env) { TCPPort *x; CREATE_AUTORELEASE_POOL(arp); x = AUTORELEASE([[[TCPPort alloc] initOnPort: 0] setNetObject: [EchoServ class]]); NSLog(@"Ready to go on TCP port %d", [x port]); if (!x) { NSLog(@"%@", [[TCPSystem sharedInstance] errorString]); return 0; } [[NSRunLoop currentRunLoop] run]; RELEASE(arp); return 0; } netclasses-1.1.0/Examples/EchoServ/EchoServ.m0000644000175000001440000000351512345537311020316 0ustar multixusers/*************************************************************************** EchoServ.m ------------------- begin : Sun Apr 28 21:18:20 UTC 2002 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "EchoServ.h" #import #import #import @implementation EchoServ - (void)connectionLost { [transport close]; DESTROY(transport); } - connectionEstablished: aTransport { NSString *greetingString = [NSString stringWithFormat: @"Welcome to EchoServ v0.0.001 on %@, %@\r\n", [(NSHost *)[aTransport localHost] name], [(NSHost *)[aTransport remoteHost] name]]; NSData *greetingData = [greetingString dataUsingEncoding: [NSString defaultCStringEncoding] allowLossyConversion: YES]; transport = RETAIN(aTransport); [[NetApplication sharedInstance] connectObject: self]; [transport writeData: greetingData]; return self; } - dataReceived: (NSData *)data { [transport writeData: data]; return self; } - transport { return transport; } @end netclasses-1.1.0/Examples/SimpleClient/0000755000175000001440000000000012345537311017270 5ustar multixusersnetclasses-1.1.0/Examples/SimpleClient/GNUmakefile.preamble0000644000175000001440000000026712345537311023135 0ustar multixusersADDITIONAL_OBJCFLAGS = -Wall ifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_OBJCFLAGS += -include GNUstep.h $(ADDITIONAL_FRAMEWORK_DIRS) ADDITIONAL_INCLUDE_DIRS = -I../../Misc endif netclasses-1.1.0/Examples/SimpleClient/SimpleClient.m0000644000175000001440000000352612345537311022044 0ustar multixusers/*************************************************************************** SimpleClient.m ------------------- begin : Tue Feb 17 00:06:15 CST 2004 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "SimpleClient.h" #import #import #import #import @implementation SimpleClient - (BOOL)isConnected { return isConnected; } - (void)connectionLost { [transport close]; DESTROY(transport); isConnected = NO; } - connectionEstablished: (id )aTransport { transport = RETAIN(aTransport); [[NetApplication sharedInstance] connectObject: self]; isConnected = YES; return self; } - dataReceived: (NSData *)data { NSString *aString = [NSString stringWithCString: [data bytes] length: [data length]]; aString = [aString stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSLog(@"Received data: %@", aString); return self; } - (id )transport { return transport; } @end netclasses-1.1.0/Examples/SimpleClient/GNUmakefile0000644000175000001440000000054612345537311021347 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = SimpleClient SimpleClient_OBJC_FILES = main.m SimpleClient.m GUI_LIB = ifeq ($(OBJC_RUNTIME_LIB), apple) SimpleClient_TOOL_LIBS = -framework netclasses $(ADDITIONAL_FRAMEWORK_DIRS) else SimpleClient_TOOL_LIBS = -lnetclasses endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make netclasses-1.1.0/Examples/SimpleClient/main.m0000644000175000001440000000505312345537311020375 0ustar multixusers/*************************************************************************** main.m ------------------- begin : Tue Feb 17 00:18:42 CST 2004 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "SimpleClient.h" #import #import #import #import #import #import #include #include #include int main(int argc, char **argv, char **env) { id client; int port; char buffer[200]; ssize_t length; NSHost *aHost; CREATE_AUTORELEASE_POOL(arp); /* We don't want a SIGPIPE (when the server disconnects) to interfere * with us. */ signal(SIGPIPE, SIG_IGN); if (argc < 3) { printf("Usage: SimpleClient \n"); return 0; } aHost = [NSHost hostWithName: [NSString stringWithCString: argv[1]]]; if (!aHost) { printf("Couldn't lookup host!\n"); return 1; } port = strtol(argv[2], (char **)0, 0); if (port <= 0) { printf("Invalid port!\n"); return 1; } client = [SimpleClient new]; NSLog(@"Connecting to %@ on port %d", [aHost name], port); if (![[TCPSystem sharedInstance] connectNetObject: client toHost: aHost onPort: port withTimeout: 30]) { NSLog(@"Couldn't connect: %@", [[TCPSystem sharedInstance] errorString]); return 1; } NSLog(@"Connected..."); fcntl(0, F_SETFL, O_NONBLOCK); while (1) { length = read(0, buffer, sizeof(buffer)); if (length > 0) { [[client transport] writeData: [NSData dataWithBytes: buffer length: length]]; } if (![client isConnected]) { break; } [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 1.0]]; } RELEASE(arp); return 0; } netclasses-1.1.0/Examples/SimpleClient/SimpleClient.h0000644000175000001440000000264712345537311022042 0ustar multixusers/*************************************************************************** SimpleClient.h ------------------- begin : Tue Feb 17 00:04:54 CST 2004 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ @class SimpleClient; #ifndef SIMPLE_CLIENT_H #define SIMPLE_CLIENT_H #import #import @class NSData; @interface SimpleClient : NSObject < NetObject > { id transport; BOOL isConnected; } - (BOOL)isConnected; - (void)connectionLost; - connectionEstablished: (id )aTransport; - dataReceived: (NSData *)data; - (id )transport; @end #endif netclasses-1.1.0/COPYING.lgpl0000644000175000001440000006347612345537310015131 0ustar multixusers GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! netclasses-1.1.0/Documentation/0000755000175000001440000000000012503215220015717 5ustar multixusersnetclasses-1.1.0/Documentation/synchronous.gsdoc0000644000175000001440000000601412345537310021346 0ustar multixusers Using netclasses synchronously Revision 1 July 7, 2005 How to use netclasses synchronously. Andrew Ruder Introduction

While netclasses is primarily for asynchronous connections, it can somewhat easily be used for synchronous connections as well.

This is primarily done by directly calling the -[id<NetTransport> writeData:] and -[id<NetTransport> readData:] methods on the appropriate transport. This must be done while the object is not being handled by NetApplication.

Ensure that Asynchronous Mode is Off

The first thing to worry about is that the object is not being handled asynchronously by NetApplication. To ensure that this is the case, -[NetApplication disconnectObject:] should be called with the object we are interested in as the argument. This will remove it from the netclasses runloop. At this point, the object is ready to be written to and read from synchronously.

Writing synchronously

After disabling asynchronous mode, you can easily write any data you want to the transport using the -[id<NetTransport> writeData:] method with a NSData as the argument. However, none of the data is actually written out. To force the write out of the data, pass a 'nil' argument to -[id<NetTransport> writeData:]. To see if there is more data, use the -[id<NetTransport> isDoneWriting] method on the transport.

Reading synchronously

After disabling asynchronous mode, you can easily read data from the transport using the -[id<NetTransport> readData:] method. This method takes a single argument of the maximum number of bytes to read. Passing 0 will cause as much data as is available to be read.

netclasses-1.1.0/Documentation/GNUmakefile.postamble0000644000175000001440000000011512345537310021766 0ustar multixusersbefore-all:: mkdir -p $(DOCUMENT_NAME) cp -f rfc1459.txt $(DOCUMENT_NAME) netclasses-1.1.0/Documentation/GNUmakefile0000644000175000001440000000136712345537310020013 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make DOCUMENT_NAME = netclasses netclasses_DOC_INSTALL_DIR = Developer/ netclasses_AGSDOC_FILES = index.gsdoc overview.gsdoc synchronous.gsdoc \ ../Source/NetBase.h ../Source/NetBase.m ../Source/LineObject.h\ ../Source/LineObject.m ../Source/NetTCP.h ../Source/NetTCP.m\ ../Source/IRCObject.h ../Source/IRCObject.m # netclasses_INSTALL_FILES = rfc1459.txt # We do this step manually in the postamble. I really don't like how # the documentation puts the autogsdoc files in a different place than # the regularly installed files. So I made sure that didn't happen netclasses_AGSDOC_FLAGS = -Up index -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/documentation.make -include GNUmakefile.postamble netclasses-1.1.0/Documentation/overview.gsdoc0000644000175000001440000001527312345537310020631 0ustar multixusers Overview of netclasses use Revision 1 November 7, 2003 This file is an overview of the use of netclasses. Andrew Ruder Introduction

This will hopefully explain the basic idea of creating a simple program with netclasses. In this file, I will take you through the creation of a simple server that echos all the data it receives back to the source.

Step 1: Create a server object

The first thing we need to do is create a class that will handle the connections. This class will need to implement the NetObject protocol.

Here is the interface for this class:

// File EchoServ.h #import <netclasses/NetBase.h> #import <Foundation/NSObject.h> @class NSData; @interface EchoServ : NSObject <NetObject> { id transport; } - connectionEstablished: (id <NetTransport>)aTransport; - dataReceived: (NSData *)data; - (id <NetTransport>)transport; - (void)connectionLost; @end

These methods are all callback methods. NetApplication will call these when appropriate. So now we just need to fill these in.

//File EchoServ.m #import "EchoServ.h" #import <Foundation/NSData.h> @implementation EchoServ

The first method is connectionEstablished:. This method needs to retain the transport given to it. The transport is an object that actually handles the transportation of the data. In most cases, this method will also need to connect the object to the netclasses NetApplication system.

- connectionEstablished: (id <NetTransport>)aTransport { transport = [aTransport retain]; [[NetApplication sharedInstance] connectObject: self]; }

The next method is dataReceived:. This will be called when new data is received, and the argument will hold the actual data received. In our program, we will want to write this data back to the transport immediately.

- dataReceived: (NSData *)newData { [transport writeData: newData]; }

The next method we need to implement is transport. This one is pretty simple; just return the transport given to us in connectionEstablished:

- (id <NetTransport>)transport { return transport; }

Last but not least is connectionLost. This method will be called when the connection is lost. This can happen in three ways. First, an error could have occurred on the socket and it had to be closed. The second, the other side can simply have closed its side. The third, is quite simply that someone called [[NetApplication sharedInstance] disconnectObject:] on it.

- (void)connectionLost { [transport close]; [transport release]; transport = nil; } @end

And that is it for our object! Now let's set up the port to handle the creating of these objects.

Step 2: Create a port

Ok, we got our class all set up, so now we are going to setup a port that will receive connections and initialize EchoServ objects (created in Step 1) when new connections are received.

This is a pretty simple task (like everything in netclasses). Ok, let's write up the function and explain it.

// File main.m #import "EchoServ.h" #import <netclasses/NetTCP.h> #import <Foundation/Foundation.h> void setup_port() { TCPPort *port; port = [[TCPPort alloc] initOnPort: 0];

Ok, TCPPort is the class used to create a port handling connections on the TCP/IP protocol. initOnPort: takes the port number that you'd like to handle. If the port is 0, it will automatically find an empty port and bind itself to that.

Now we want to set the TCPPort we created to automatically create our class EchoServ when new connections are received. So:

[port setNetObject: [EchoServ class]];

Ok, since we have no idea what port this has been created on, we better print that out. And after that we are done with the port, so we can go ahead and release it and return. When you create a TCPPort, it automatically connects itself with NetApplication, so don't worry about the object actually being deallocated.

NSLog(@"Ready to go on port %d", [port port]); [x release]; return; }

Ok, and that is all there is to creating the port! Now onto step 3.

Step 3: Make it go!

Ok, we've got our server object created and we've got the port ready to receive connections. What do we need to do now? Let's make it go!

// File main.m (continued) int main(void) { NSAutoreleasePool *arp; arp = [[NSAutoreleasePool alloc] init]; setup_port(); [[NSRunLoop currentRunLoop] run]; [arp release]; return 0; }

Sorry to disappoint you! But that's it! netclasses will automatically handle any and all connections while the runloop is running. The runloop is a pretty integral part of just about any cocoa application (if you make a GUI program, the runloop is basically always going). Feel free to type up this program and compile it and test that it works! It does! In fact, this very program is almost exactly the same thing as the EchoServ example distributed with the standard netclasses distribution.

Conclusion

In conclusion, netclasses is very simple to use and quite usable for small applications and works well on large ones as well. The asynchronous design means that you don't have to worry about threads or any of the little details that you usually have to worry about on networking applications. Its easy to learn, easy to use, and can be used in a variety of applications. Enjoy!

netclasses-1.1.0/Documentation/index.gsdoc0000644000175000001440000000211112503215220020042 0ustar multixusers netclasses documentation Revision 2 July 7, 2005 This is the documentation for netclasses. It includes the class references as well as an introduction to netclasses. Andrew Ruder Introduction

netclasses is an easy to use, unbloated API for handling asynchronous connections in Objective-C under GNUstep as well as OS X. It can also be used for synchronous connections but this is -not- its primary use.

Please also refer to RFC 1459 as a supplement to the IRC portion of this documentation.

netclasses-1.1.0/configure.ac0000644000175000001440000000054512503215220015400 0ustar multixusersAC_INIT([netclasses], [1.1.0], [aeruder@ksu.edu], [netclasses]) AC_PREREQ([2.57]) AC_SUBST(PACKAGE_VERSION) AC_CONFIG_SRCDIR([Source/NetBase.m]) AC_CONFIG_HEADER([Source/config.h]) AC_CHECK_HEADERS([sys/types.h sys/socket.h]) AC_CHECK_TYPES([socklen_t],,,[ #include #include ]) AC_OUTPUT([ GNUmakefile Source/GNUmakefile ]) netclasses-1.1.0/README0000644000175000001440000000557312345537311014014 0ustar multixusersnetclasses is a small framework of asynchronous Objective-C networking classes =============================================================================== Copyright (C) 2005 Andrew Ruder netclasses 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 program 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 General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA Comments are welcome. =============================================================================== **** Please see README.osx for instructions dealing with OSX compilation **** ========== Compiling: ========== ./configure make make install One note about ./configure, I am not using it for makefiles, so the --prefix and other flags will have -no- effect on the output. It is only used to check for various types and headers. ====================== Environment Variables: ====================== GNUSTEP_INSTALLATION_DIR Determines the root of where netclasses and its documentation will be installed. This is generally /usr/GNUstep/Local but can be reassigned to other targets such as GNUSTEP_INSTALLATION_DIR=$GNUSTEP_USER_ROOT to install into a user's home directory. ============== Documentation: ============== Documentation/ holds the netclasses documentation. This documentation will not be compiled and installed with netclasses. This must be done separately. Simply type make followed by make install in the Documentation/ directory to build and install the documentation. The resulting documentation will end up in: $(GNUSTEP_INSTALLATION_DIR)/Library/Documentation/Developer/netclasses This documentation has a brief overview of netclasses as well as the class references. ==== Use: ==== Simply link to the framework after it is installed in your application. See the Examples/ directory for examples of the use of netclasses. testsuite/ contains various tests to examine the extent to which things work on other operating systems or other architectures. ======== Authors: ======== Main author: Andrew Ruder UDP support: Jeremy Tregunna Special thanks to the countless other people who provided insight, tips, and suggestions to help make netclasses what it is. =============================================================================== Copyright (C) 2005 Andy Ruder aeruder@ksu.edu http://netclasses.aeruder.net netclasses-1.1.0/COPYING.gpl0000644000175000001440000004313112345537310014737 0ustar multixusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. netclasses-1.1.0/testsuite/0000755000175000001440000000000012345537310015152 5ustar multixusersnetclasses-1.1.0/testsuite/conversions.m0000644000175000001440000000521312345537310017701 0ustar multixusers/*************************************************************************** conversions.m ------------------- begin : Sun Dec 21 01:37:22 CST 2003 copyright : (C) 2003 by Andy Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import #import #import "testsuite.h" #import NSString *num_to_hex_le(uint32_t num) { unsigned char y[4]; uint32_t *t; NSMutableString *string; int z; t = (uint32_t *)y; *t = num; string = [NSMutableString stringWithString: @"0x"]; for (z = 3; z >= 0 ; z--) { [string appendString: [NSString stringWithFormat: @"%02x", (unsigned)y[z]]]; } return string; } int main(void) { CREATE_AUTORELEASE_POOL(apr); TCPSystem *system; NSEnumerator *iter; id object; uint32_t num; NSDictionary *dict; system = [TCPSystem sharedInstance]; NSLog(@"This is a cruddy test, it will only work correctly on machines" @" where host order != network order :)"); dict = [NSDictionary dictionaryWithObjectsAndKeys: @"0x4466dc75", @"68.102.220.117", @"0x7f000001", @"127.0.0.1", @"0xffffffff", @"255.255.255.255", nil]; iter = [dict keyEnumerator]; while ((object = [iter nextObject])) { id val; val = [dict objectForKey: object]; num = 0; [system hostOrderInteger: &num fromHost: [NSHost hostWithAddress: object]]; testEqual(@"Host order", num_to_hex_le(num), val); } dict = [NSDictionary dictionaryWithObjectsAndKeys: @"0x75dc6644", @"68.102.220.117", @"0x0100007f", @"127.0.0.1", @"0xffffffff", @"255.255.255.255", nil]; iter = [dict keyEnumerator]; while ((object = [iter nextObject])) { id val; val = [dict objectForKey: object]; num = 0; [system networkOrderInteger: &num fromHost: [NSHost hostWithAddress: object]]; testEqual(@"Network order", num_to_hex_le(num), val); } FINISH(); RELEASE(apr); return 0; } netclasses-1.1.0/testsuite/GNUmakefile.postamble0000644000175000001440000000011312345537310021204 0ustar multixusersafter-clean:: $(ECHO_NOTHING)\ rm -f conversions testtcp\ $(END_ECHO) netclasses-1.1.0/testsuite/testsuite.h0000644000175000001440000000412012345537310017351 0ustar multixusers/*************************************************************************** testsuite.h ------------------- begin : Mon Jul 11 20:01:57 CDT 2005 copyright : (C) 2005 by Andrew Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import #include #include unsigned int numtests = 0; unsigned int testspassed = 0; #define testWrite(format, args...) fprintf(stdout, "%s", \ [[NSString stringWithFormat: \ (format), ## args ] cString]) inline BOOL PASS(NSString *desc) { testWrite(@"PASS: %@\n" , desc); numtests++; testspassed++; return YES; } inline BOOL FAIL(NSString *desc) { testWrite(@"FAIL: %@\n" , desc); numtests++; return NO; } inline BOOL FINISH() { NSLog(@"Passed %lu/%lu tests.", testspassed, numtests); exit((testspassed == numtests) ? 0 : 1); } #define testTrue(desc, expression) \ (expression) ? PASS(desc) : FAIL(desc); #define testFalse(desc, expression) \ (expression) ? FAIL(desc) : PASS(desc); inline BOOL testEqual(NSString *desc, id o1, id o2) { desc = [NSString stringWithFormat: @"%@: %@ == %@", desc, o1, o2]; return [o1 isEqual: o2] ? PASS(desc) : FAIL(desc); } inline BOOL testNotEqual(NSString *desc, id o1, id o2) { desc = [NSString stringWithFormat: @"%@: %@ == %@", desc, o1, o2]; return (![o1 isEqual: o2]) ? PASS(desc) : FAIL(desc); } netclasses-1.1.0/testsuite/GNUmakefile.preamble0000644000175000001440000000015412345537310021012 0ustar multixusersifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_INCLUDE_DIRS = -I../Misc endif ADDITIONAL_OBJC_FLAGS += -Wall netclasses-1.1.0/testsuite/GNUmakefile0000644000175000001440000000117212345537310017225 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = conversions testtcp conversions_OBJC_FILES = conversions.m conversions_COPY_INTO_DIR = . testtcp_OBJC_FILES = testtcp.m testtcp_COPY_INTO_DIR = . ADDITIONAL_OBJCFLAGS = -Wall ifeq ($(OBJC_RUNTIME_LIB), apple) ADDITIONAL_OBJCFLAGS += -include GNUstep.h $(ADDITIONAL_FRAMEWORK_DIRS) MY_TOOL_LIBS = -framework netclasses $(ADDITIONAL_FRAMEWORK_DIRS) else MY_TOOL_LIBS = -lnetclasses endif conversions_TOOL_LIBS = $(MY_TOOL_LIBS) testtcp_TOOL_LIBS = $(MY_TOOL_LIBS) GUI_LIB = -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble netclasses-1.1.0/testsuite/testtcp.m0000644000175000001440000001204612345537310017021 0ustar multixusers/*************************************************************************** testtcp.m ------------------- begin : Mon Jul 11 21:34:17 CDT 2005 copyright : (C) 2005 by Andrew Ruder email : aeruder@ksu.edu ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #import "testsuite.h" #import #import #import int numConnections = 0; id lastserver = nil; @interface NumBytesServer : NSObject { id transport; } - (void)connectionLost; - connectionEstablished: (id )aTransport; - dataReceived: (NSData *)data; - (id )transport; @end @implementation NumBytesServer - (void)connectionLost { NSLog(@"Server: lost connection"); numConnections--; DESTROY(transport); } - connectionEstablished: (id )aTransport; { NSLog(@"Server: received connection"); numConnections++; ASSIGN(transport, aTransport); lastserver = self; [[NetApplication sharedInstance] connectObject: self]; return self; } - dataReceived: (NSData *)data { NSLog(@"Server: got some data"); [transport writeData: data]; return self; } - (id )transport { return transport; } @end @interface NumBytesClient : NSObject { id transport; int numBytes; } - (void)connectionLost; - connectionEstablished: (id )aTransport; - dataReceived: (NSData *)data; - (id )transport; - (int)numBytes; @end @implementation NumBytesClient - (void)connectionLost { [transport close]; DESTROY(transport); } - connectionEstablished: (id )aTransport; { ASSIGN(transport, aTransport); [[NetApplication sharedInstance] connectObject: self]; return self; } - dataReceived: (NSData *)data { numBytes += [data length]; return self; } - (id )transport { return transport; } - (int)numBytes { return numBytes; } @end #define RUNABIT() \ [[NSRunLoop currentRunLoop] runUntilDate: \ [NSDate dateWithTimeIntervalSinceNow: 5.0]] int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(apr); TCPSystem *tcp; TCPPort *port; NetApplication *net; uint16_t portnum; NumBytesClient *c1, *c2; NSHost *host = [NSHost hostWithAddress: @"127.0.0.1"]; FILE *randfile; char random[140]; NSData *randdata; net = [NetApplication sharedInstance]; tcp = [TCPSystem sharedInstance]; port = [[TCPPort alloc] initOnPort: 0]; portnum = [port port]; [port setNetObject: [NumBytesServer class]]; c1 = [NumBytesClient new]; c2 = [NumBytesClient new]; testTrue(@"?Initialized port", port); NSLog(@"Initialized server on port %lu", (long unsigned)portnum); NSLog(@"Making foreground connection..."); testTrue(@"?Made connection", [tcp connectNetObject: c1 toHost: host onPort: portnum withTimeout: 4]); RUNABIT(); testTrue(@"?Server got Connection", numConnections == 1); NSLog(@"Making background connection..."); testTrue(@"?Making connection", [tcp connectNetObjectInBackground: c2 toHost: host onPort: portnum withTimeout: 4]); RUNABIT(); testTrue(@"?Made connection", numConnections == 2); testTrue(@"?Open /dev/random", (randfile = fopen("/dev/random", "r"))); testTrue(@"?Reading data", (fread(random, sizeof(random), 1, randfile) == 1)); randdata = [NSData dataWithBytes: random length: sizeof(random)]; testTrue(@"?random data", randdata); testTrue(@"?transport c1", [c1 transport]); testTrue(@"?transport c2", [c2 transport]); NSLog(@"Sending random data to server"); [[c1 transport] writeData: randdata]; [[c2 transport] writeData: randdata]; RUNABIT(); testTrue(@"?Got all data back c1", ([c1 numBytes] == sizeof(random))); testTrue(@"?Got all data back c2", ([c2 numBytes] == sizeof(random))); NSLog(@"Disconnecting client 1"); [net disconnectObject: c1]; RUNABIT(); testTrue(@"?Server lost connection", numConnections == 1); NSLog(@"Disconnecting server 2"); [net disconnectObject: lastserver]; NSLog(@"Writing to server 2"); [[c2 transport] writeData: randdata]; RUNABIT(); testTrue(@"?No more servers...", numConnections == 0); testFalse(@"?c1 no transport", ([c1 transport])); testFalse(@"?c2 no transport", ([c2 transport])); [net disconnectObject: port]; [port close]; RUNABIT(); testFalse(@"?Can't make connection to port", [tcp connectNetObject: c1 toHost: host onPort: portnum withTimeout: 4]); FINISH(); RELEASE(apr); return 0; } netclasses-1.1.0/GNUmakefile.in0000644000175000001440000000033012503215220015561 0ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME = netclasses VERSION = @PACKAGE_VERSION@ INTERFACE_VERSION = 1 SUBPROJECTS = Source include $(GNUSTEP_MAKEFILES)/aggregate.make include GNUmakefile.postamble netclasses-1.1.0/version.plist0000644000175000001440000000072312503215220015652 0ustar multixusers BuildVersion 12 CFBundleVersion 1.0 ProductBuildVersion 7K571 ProjectName DevToolsWizardTemplates SourceVersion 3870000 netclasses-1.1.0/Info.plist0000644000175000001440000000131112503215220015052 0ustar multixusers CFBundleDevelopmentRegion English CFBundleExecutable netclasses CFBundleIconFile CFBundleIdentifier org.gnustep.netclasses CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleSignature ???? CFBundleVersion 1.1.0 NSPrincipalClass netclasses-1.1.0/netclasses.xcode/0000755000175000001440000000000012503215220016353 5ustar multixusersnetclasses-1.1.0/netclasses.xcode/project.pbxproj0000644000175000001440000002410712503215220021433 0ustar multixusers// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 39; objects = { 014CEA440018CDF011CA2923 = { buildSettings = { COPY_PHASE_STRIP = NO; GCC_CW_ASM_SYNTAX = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G3; GCC_OPTIMIZATION_LEVEL = 0; ZERO_LINK = YES; }; isa = PBXBuildStyle; name = Development; }; 014CEA450018CDF011CA2923 = { buildSettings = { COPY_PHASE_STRIP = YES; GCC_CW_ASM_SYNTAX = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = G3; ZERO_LINK = NO; }; isa = PBXBuildStyle; name = Deployment; }; //010 //011 //012 //013 //014 //030 //031 //032 //033 //034 034768DFFF38A50411DB9C8B = { children = ( 8DC2EF5B0486A6940098B216, ); isa = PBXGroup; name = Products; refType = 4; sourceTree = ""; }; //030 //031 //032 //033 //034 //080 //081 //082 //083 //084 0867D690FE84028FC02AAC07 = { buildSettings = { }; buildStyles = ( 014CEA440018CDF011CA2923, 014CEA450018CDF011CA2923, ); hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 0867D691FE84028FC02AAC07; productRefGroup = 034768DFFF38A50411DB9C8B; projectDirPath = ""; targets = ( 8DC2EF4F0486A6940098B216, ); }; 0867D691FE84028FC02AAC07 = { children = ( 08FB77AEFE84172EC02AAC07, 32C88DFF0371C24200C91783, 089C1665FE841158C02AAC07, 0867D69AFE84028FC02AAC07, 034768DFFF38A50411DB9C8B, ); isa = PBXGroup; name = netclasses; refType = 4; sourceTree = ""; }; 0867D69AFE84028FC02AAC07 = { children = ( 1058C7B0FEA5585E11CA2CBB, 1058C7B2FEA5585E11CA2CBB, ); isa = PBXGroup; name = "External Frameworks and Libraries"; refType = 4; sourceTree = ""; }; 0867D69BFE84028FC02AAC07 = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; refType = 0; sourceTree = ""; }; 0867D6A5FE840307C02AAC07 = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; refType = 0; sourceTree = ""; }; 089C1665FE841158C02AAC07 = { children = ( 8DC2EF5A0486A6940098B216, 089C1666FE841158C02AAC07, ); isa = PBXGroup; name = Resources; refType = 4; sourceTree = ""; }; 089C1666FE841158C02AAC07 = { children = ( 089C1667FE841158C02AAC07, ); isa = PBXVariantGroup; name = InfoPlist.strings; refType = 4; sourceTree = ""; }; 089C1667FE841158C02AAC07 = { fileEncoding = 10; isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; refType = 4; sourceTree = ""; }; 08FB77AEFE84172EC02AAC07 = { children = ( 857EEC941A8FC67D00EEC00A, 857EEC951A8FC67D00EEC00A, 857EEC961A8FC67D00EEC00A, 857EEC971A8FC67D00EEC00A, 857EEC981A8FC67D00EEC00A, 857EEC991A8FC67D00EEC00A, 857EEC9A1A8FC67D00EEC00A, 857EEC9B1A8FC67D00EEC00A, ); isa = PBXGroup; name = Classes; refType = 4; sourceTree = ""; }; //080 //081 //082 //083 //084 //100 //101 //102 //103 //104 1058C7B0FEA5585E11CA2CBB = { children = ( 1058C7B1FEA5585E11CA2CBB, ); isa = PBXGroup; name = "Linked Frameworks"; refType = 4; sourceTree = ""; }; 1058C7B1FEA5585E11CA2CBB = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; refType = 0; sourceTree = ""; }; 1058C7B2FEA5585E11CA2CBB = { children = ( 0867D69BFE84028FC02AAC07, 0867D6A5FE840307C02AAC07, ); isa = PBXGroup; name = "Other Frameworks"; refType = 4; sourceTree = ""; }; //100 //101 //102 //103 //104 //320 //321 //322 //323 //324 32C88DFF0371C24200C91783 = { children = ( 857EECA61A8FC6B500EEC00A, ); isa = PBXGroup; name = "Other Sources"; refType = 4; sourceTree = ""; }; //320 //321 //322 //323 //324 //850 //851 //852 //853 //854 857EEC941A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IRCObject.h; path = Source/IRCObject.h; refType = 4; sourceTree = ""; }; 857EEC951A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = IRCObject.m; path = Source/IRCObject.m; refType = 4; sourceTree = ""; }; 857EEC961A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LineObject.h; path = Source/LineObject.h; refType = 4; sourceTree = ""; }; 857EEC971A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = LineObject.m; path = Source/LineObject.m; refType = 4; sourceTree = ""; }; 857EEC981A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NetBase.h; path = Source/NetBase.h; refType = 4; sourceTree = ""; }; 857EEC991A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NetBase.m; path = Source/NetBase.m; refType = 4; sourceTree = ""; }; 857EEC9A1A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NetTCP.h; path = Source/NetTCP.h; refType = 4; sourceTree = ""; }; 857EEC9B1A8FC67D00EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NetTCP.m; path = Source/NetTCP.m; refType = 4; sourceTree = ""; }; 857EEC9C1A8FC67D00EEC00A = { fileRef = 857EEC941A8FC67D00EEC00A; isa = PBXBuildFile; settings = { ATTRIBUTES = ( Public, ); }; }; 857EEC9D1A8FC67D00EEC00A = { fileRef = 857EEC951A8FC67D00EEC00A; isa = PBXBuildFile; settings = { }; }; 857EEC9E1A8FC67D00EEC00A = { fileRef = 857EEC961A8FC67D00EEC00A; isa = PBXBuildFile; settings = { ATTRIBUTES = ( Public, ); }; }; 857EEC9F1A8FC67D00EEC00A = { fileRef = 857EEC971A8FC67D00EEC00A; isa = PBXBuildFile; settings = { }; }; 857EECA01A8FC67D00EEC00A = { fileRef = 857EEC981A8FC67D00EEC00A; isa = PBXBuildFile; settings = { ATTRIBUTES = ( Public, ); }; }; 857EECA11A8FC67D00EEC00A = { fileRef = 857EEC991A8FC67D00EEC00A; isa = PBXBuildFile; settings = { }; }; 857EECA21A8FC67D00EEC00A = { fileRef = 857EEC9A1A8FC67D00EEC00A; isa = PBXBuildFile; settings = { ATTRIBUTES = ( Public, ); }; }; 857EECA31A8FC67D00EEC00A = { fileRef = 857EEC9B1A8FC67D00EEC00A; isa = PBXBuildFile; settings = { }; }; 857EECA61A8FC6B500EEC00A = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = config.h; path = Source/config.h; refType = 4; sourceTree = ""; }; 857EECA71A8FC6B500EEC00A = { fileRef = 857EECA61A8FC6B500EEC00A; isa = PBXBuildFile; settings = { }; }; //850 //851 //852 //853 //854 //8D0 //8D1 //8D2 //8D3 //8D4 8DC2EF4F0486A6940098B216 = { buildPhases = ( 8DC2EF500486A6940098B216, 8DC2EF520486A6940098B216, 8DC2EF540486A6940098B216, 8DC2EF560486A6940098B216, ); buildRules = ( ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_CW_ASM_SYNTAX = NO; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G3; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; LIBRARY_STYLE = DYNAMIC; PRODUCT_NAME = netclasses; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; }; dependencies = ( ); isa = PBXNativeTarget; name = netclasses; productInstallPath = "$(HOME)/Library/Frameworks"; productName = netclasses; productReference = 8DC2EF5B0486A6940098B216; productType = "com.apple.product-type.framework"; }; 8DC2EF500486A6940098B216 = { buildActionMask = 2147483647; files = ( 857EEC9C1A8FC67D00EEC00A, 857EEC9E1A8FC67D00EEC00A, 857EECA01A8FC67D00EEC00A, 857EECA21A8FC67D00EEC00A, 857EECA71A8FC6B500EEC00A, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8DC2EF520486A6940098B216 = { buildActionMask = 2147483647; files = ( 8DC2EF530486A6940098B216, ); isa = PBXResourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8DC2EF530486A6940098B216 = { fileRef = 089C1666FE841158C02AAC07; isa = PBXBuildFile; settings = { }; }; 8DC2EF540486A6940098B216 = { buildActionMask = 2147483647; files = ( 857EEC9D1A8FC67D00EEC00A, 857EEC9F1A8FC67D00EEC00A, 857EECA11A8FC67D00EEC00A, 857EECA31A8FC67D00EEC00A, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8DC2EF560486A6940098B216 = { buildActionMask = 2147483647; files = ( 8DC2EF570486A6940098B216, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8DC2EF570486A6940098B216 = { fileRef = 1058C7B1FEA5585E11CA2CBB; isa = PBXBuildFile; settings = { }; }; 8DC2EF5A0486A6940098B216 = { fileEncoding = 4; isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; refType = 4; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 = { explicitFileType = wrapper.framework; includeInIndex = 0; isa = PBXFileReference; path = netclasses.framework; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; }; }; rootObject = 0867D690FE84028FC02AAC07; } netclasses-1.1.0/English.lproj/0000755000175000001440000000000012503215220015624 5ustar multixusersnetclasses-1.1.0/English.lproj/InfoPlist.strings0000644000175000001440000000040612503215220021146 0ustar multixusersþÿ/* Localized versions of Info.plist keys */ CFBundleName = "netclasses"; NSHumanReadableCopyright = "© __MyCompanyName__, 2015";